Team Size -- 4
Individual Role -- Interface Programmer
Software & Languages -- Visual Studio; x86 Assembly; C; C++
Operating Systems are incredibly intricately designed, able to handle dozens of tasks and processes at once. But what are the fundamental aspects of an OS? What is the minimum amount required to handle something as simple as printing 1-1000 as an executable? Well, for about three months, my team and I built up a Linux Kernel from an initial state of not booting to running three tasks across three different displays at once.
Our first task was to implement the booting system. The exact specifics are not needed. Suffice it to say that it required initializing a couple of global look up tables and interrupt handlers. One key interrupt handler involved the keyboard, whose driver I implemented.
Later on, the team was given the task of implementing memory management (paging) and fleshing out the terminal. I was in charge of getting the terminal to print according to the specifications (see below).
Jumping ahead, our final few tasks involved getting the OS to read and start executable files. The files had a special key in them confirming them as an executable type. Furthermore, the terminal we had created now needed to handle three different screens. Behind the scenes, the OS also got to replicate multithread processing by splitting the processor's time across programs run on the three terminals.
The Keyboard Driver had to handle several aspects of user input. Obviously, it had to handle most of the standard QWERTY keyboard's keys. More interestingly, it had to account for combinations of Shift and Caps Lock, which resulted in the four lookup tables pictured on the right. When a key gets pressed, it sends a scancode to the handler, and based on the current flags set, the correct output is placed into a buffer. That buffer is simultaneously printed to the terminal screen, and this buffer helps prevent edge cases involving backspaces and tab characters.
Additionally, the terminal was required to have a clear command, which is traditionally CTRL+L. Manually halting a program (CTRL+C) was also implemented to ensure that programs would not run forever. Both of those commands were detected in the Keyboard Driver. The terminal itself had a maximum line length of 128 characters, which was longer than the width of the screen. Therefore, horizontal wrapping and vertical scrolling were also implemented.