Fix shift state and address BSS issue

This commit is contained in:
Robbe Van Herck 2020-01-10 09:48:21 +01:00
parent 3abf49f881
commit 95c0371065
No known key found for this signature in database
GPG Key ID: A66F76F7B81BD784
2 changed files with 6 additions and 4 deletions

View File

@ -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.

View File

@ -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);