package kernel; import haxe.MainLoop; import kernel.net.Routing; import cc.OS; import util.Debug; import kernel.ui.WindowManager; import kernel.peripherals.Peripherals.Peripheral; import kernel.net.Net; class Init { public static function initKernel() { // Init singeltons here because haxe is confused about the order to create them. KernelEvents.instance = new KernelEvents(); MainLoop.add(() -> { KernelEvents.instance.startEventLoop(); },1); Peripheral.instance = new Peripheral(); WindowManager.instance = new WindowManager(); MainTerm.instance = new MainTerm(); Log.init(); Routing.instance = new Routing(); Net.instance = new Net(); Routing.instance.init(); // Register default terminate handler KernelEvents.instance.onTerminate.handle(_->{ OS.reboot(); }); Debug.printBuildInfo(); Log.moveToOutput("main"); } }