diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-22 12:58:29 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-22 12:58:29 +0200 |
commit | a9ca75c98b8e775cb48204c56d6ad02b272d6767 (patch) | |
tree | 0b97d9a1b14ddc1c6e4ef45fc30880eb3edbe802 /Kernel/init.cpp | |
parent | 8f941561b49015b867d8f87f6859b5bf77895aa2 (diff) | |
download | serenity-a9ca75c98b8e775cb48204c56d6ad02b272d6767.zip |
Add IRQHandler class that can be subclasses to handle an IRQ.
Also move Keyboard to a class implementation using this pattern.
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r-- | Kernel/init.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp index fb0ca20b98..65d784923b 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -27,25 +27,8 @@ #include "Console.h" #define TEST_VFS -#define TEST_ELF_LOADER -#define TEST_CRASHY_USER_PROCESSES - -#if 0 -/* Keyboard LED disco task ;^) */ - -static void led_disco() NORETURN; - -static void led_disco() -{ - BYTE b = 0; - for (;;) { - sleep(0.5 * TICKS_PER_SECOND); - Keyboard::unsetLED((Keyboard::LED)b++); - b &= 7; - Keyboard::setLED((Keyboard::LED)b); - } -} -#endif +//#define TEST_ELF_LOADER +//#define TEST_CRASHY_USER_PROCESSES static void motd_main() NORETURN; static void motd_main() @@ -115,7 +98,6 @@ static void init_stage2() NORETURN; static void init_stage2() { kprintf("init stage2...\n"); - Keyboard::initialize(); // Anything that registers interrupts goes *after* PIC and IDT for obvious reasons. Syscall::initialize(); @@ -192,10 +174,14 @@ static void init_stage2() kprintf("init stage2 is done!\n"); +#if 0 + // It would be nice to exit this process, but right now it instantiates all kinds of things. + // At the very least it needs to be made sure those things stick around as appropriate. DO_SYSCALL_A1(Syscall::PosixExit, 413); kprintf("uh, we're still going after calling sys$exit...\n"); HANG; +#endif for (;;) { asm("hlt"); @@ -217,6 +203,8 @@ void init() MemoryManager::initialize(); + auto keyboard = make<Keyboard>(); + PIT::initialize(); memset(&system, 0, sizeof(system)); |