The kernel now has a keyboard driver, the driver is being loaded into the list of Dos Devices as KBD:, KBD: is being opened as file number 0 (which corresponds with the standard input device). The C library file functions are wired up to the kernel functions (using the function lookup mechanism) and the CLI uses the C library functions for its input and output.
At some point, the CLI could easily be extracted and made into a program with minimal changes.
Now, just to carefully enable ... the ... IRQ ... handler ... and ... BANG! :( General Protection Fault.
Ok, there may have been a few last issues with the interrupt handler, but with those fixed, the console is receiving key-presses from the keyboard via the Dos layer, file descriptor table, kernel API, and the C library.
One thing I still need to address is when in the process the system converts scan codes into ASCII codes. In fact, the C library only deals with characters in the stream rather actual key-presses with key-down and key-up which some programs will need, so I guess I'll need to add some API for that. We'll leave that for another day though.
No comments:
Post a Comment