def restart_os(): try: Kernel.Prepare_For_shutdown() time.sleep(1) Kernel.startup() except AttributeError: Kernel.Crash("Second_Restart_Error", True)
def restart(): try: Kernel.Clear() Kernel.Prepare_For_shutdown() Boot.Boot() except AttributeError: Kernel.Crash("Second_Restart_Error", True)
def Boot(): DoBoot = open("Cos/Cos64/Settings/Boot.ini", "r") DoBootContents = DoBoot.read() DoBoot.close() if DoBootContents == "Boot=True": DoBootFormat = True else: DoBootFormat = False if DoBootFormat: print("Press ] to open boot-settings") count = 0 while count != 500: Hotkey.While_Boot() count += 1 time.sleep(0.00000001) Kernel.Setup() Kernel.startup() if not DoBootFormat: CrashHandler.CrashHandler()
def SystemHotkeys(): global toggle if keyboard.is_pressed("f8"): print("Kernel running " + str(Kernel.running)) time.sleep(0.5) if keyboard.is_pressed("f3"): CrashHandler.CrashHandler("User_Started_Screen_Of_Death", True) if keyboard.is_pressed("f4"): Kernel.Prepare_For_shutdown() Kernel.Shutdown() if keyboard.is_pressed("f5"): try: Doc = open("Cos/doc.txt", "r") Doc_Contents = Doc.read() print(Doc_Contents) Doc.close() except FileExistsError: print("Could not find file") time.sleep(0.5) if keyboard.is_pressed("f2"): if toggle: toggle = False print("hotkey input") time.sleep(0.5) if not toggle: toggle = True print("text input") Kernel.Do_Input = True if toggle: Kernel.Read_Keyboard()
def SystemHotkeys(): global toggle if keyboard.is_pressed("f8"): print("Kernel running " + str(Kernel.running)) time.sleep(0.5) if keyboard.is_pressed("f3"): CrashHandler.CrashHandler("User_Started_Screen_Of_Death", True) if keyboard.is_pressed("f2"): if toggle: toggle = False print("hotkey input") time.sleep(0.5) if not toggle: toggle = True print("text input") Kernel.Do_Input = True if toggle: Kernel.Read_Keyboard()
def Find_In_Register(command, output): Register = open("Cos./Cos64/Register.reg", "r") Register_Contents = [] Register_Length = 0 for line in Register.readlines(): Register_Contents.append(line) Register_Length += 1 output = "" count = 0 while count != Register_Length: if Register_Contents[count] == str(command) + "\n": output = Register_Contents[count + 1][0:-1] print(output) Kernel.Run(output) break count += 2 if count == Register_Length: output = "Program location could not be found" print(output) count = Register_Length
def While_Boot(): if keyboard.is_pressed("]"): Kernel.OpenBootSettings()
def ScreenOfDeath(Text, Error_Code): print(colored(str(Text), "red"), Error_Code) input() Kernel.Prepare_For_shutdown() Kernel.Shutdown()
def Start(): Kernel.Setup() Kernel.startup()
def CrashHandler(Custom_Errorcode, Enable_Custom_Errorcode): if Enable_Custom_Errorcode: Kernel.Crash(message, Custom_Errorcode) else: Kernel.Crash(message, Error_Code)
def restart(): Kernel.Clear() Kernel.Prepare_For_shutdown() Start.Start()
def restart_os(): time.sleep(1) Kernel.startup()
def restart(): Kernel.Clear() Kernel.Prepare_For_shutdown() Boot.Boot()
def restart_os(): Kernel.Prepare_For_shutdown() time.sleep(1) Kernel.startup()