X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/7c7b5f05d39b7739d990f71256a2267ec67a6913..1eeed1150149b63d6e49e033697454bc12b533b9:/lunaix-os/kernel/proc0.c diff --git a/lunaix-os/kernel/proc0.c b/lunaix-os/kernel/proc0.c index 3c7b225..a935a3b 100644 --- a/lunaix-os/kernel/proc0.c +++ b/lunaix-os/kernel/proc0.c @@ -1,25 +1,13 @@ -#include #include #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include #include #include - -#include - -#include +#include #include @@ -35,12 +23,12 @@ mount_bootmedium() int errno = 0; struct device* dev = probe_boot_medium(); if (!dev) { - kprintf(KERROR "fail to acquire device. (%d)", errno); + ERROR("fail to acquire device. (%d)", errno); return 0; } if ((errno = vfs_mount("/mnt/lunaix-os", "iso9660", dev, 0))) { - kprintf(KERROR "fail to mount boot medium. (%d)", errno); + ERROR("fail to mount boot medium. (%d)", errno); return 0; } @@ -59,7 +47,7 @@ exec_initd() fail("should not reach"); fail: - kprintf(KERROR "fail to load initd. (%d)", errno); + ERROR("fail to load initd. (%d)", errno); return 0; } @@ -85,9 +73,7 @@ __proc0() init_proc_user_space(__current); if (!mount_bootmedium() || !exec_initd()) { - while (1) { - asm("hlt"); - } + FATAL("failed to initd"); // should not reach } } @@ -95,26 +81,11 @@ __proc0() void init_platform() { - kprintf(KINFO "\033[11;0mLunaixOS (gcc v%s, %s)\033[39;49m\n", - __VERSION__, - __TIME__); + device_postboot_load(); + invoke_init_function(on_postboot); twifs_register_plugins(); - /* - * all device registering and loading must defered to here! - * due to limited stack size and partial scheduling context - */ - pci_load_devices(); - - // debugger - serial_init(); - sdbg_init(); - - // FIXME ps2 kbd is a device, must not be here - ps2_kbd_init(); - - // console - console_start_flushing(); - console_flush(); + // FIXME Re-design needed!! + // sdbg_init(); } \ No newline at end of file