diff --git a/docs/bootloader.md b/docs/bootloader.md index 26c7344..ac4dc75 100644 --- a/docs/bootloader.md +++ b/docs/bootloader.md @@ -63,6 +63,6 @@ As I don't quite get how segments work in real mode, there are most likely error I reserve 32KiB of SFS reserved area for the ELF file of the kernel. This is currently for "historic reasons" (a.k.a. I'm too lazy to load the filesystem in the bootloader). The kernel then handles the filesystem. -### Second ELF program header does not get loaded +### BSS does not get cleared -This will most likely fix the issue of missing global strings. +I do calculate the size of the BSS, so either I intialize every variable in a function or things like global variables that are false by default don't work. It does work in emulators because they initialize all memory to 0, but real computerss don't always do that. diff --git a/kernel/drivers/keyboard/keyboard.c b/kernel/drivers/keyboard/keyboard.c index 4785aff..a71dc66 100644 --- a/kernel/drivers/keyboard/keyboard.c +++ b/kernel/drivers/keyboard/keyboard.c @@ -10,8 +10,8 @@ #define KEY_QUEUE_EMPTY FIFO_QUEUE_EMPTY -bool keyboard_shift_state = false; -bool keyboard_caps_state = false; +bool keyboard_shift_state; +bool keyboard_caps_state; fifo* key_queue = NULL; @@ -72,6 +72,8 @@ char getchar() { } void keyboard_init() { + keyboard_shift_state = false; + keyboard_caps_state = false; key_queue = fifo_new(); uint8_t mask = inb(0x21);