Validating and writing system software to flash