First, download the project sample where I had all the necessary files setup, including a keyboard libray, which makes the function getchar
available, that is all you need to implement all the labwork goals.
We need a console via wich we will interact with the system, you have to take care about a bunch of stuff to make that happen, see Goals.
Goal
- make the output to screen easy:
- implement
putc
(print a character at the current cursor position and increase the position of the cursor) - implement
puts
(print a caracter at the current cursor position, and advance the position of the cursor with the length of the string) - implement
clrscr
(clear the screen)
- implement
- create a command prompt which can read and parse commands, and will respond to all commands with
"you typed: <command>"
- implement
gets
(get a string from keyboard) - when a command is typed, the output should be written below the command and the prompt should be moved below the output.
- (optional) when the prompt reaches the bottom, the whole text should scroll up, and the prompt should stay at the bottom of the screen. (+10 EXP)
- implement
Testing
As always, just run the make
command in the folder, and it will generate a floppy.img
which can be runned in a Virtual Machine.
Stuff I will be asking
(categorized by difficulty)
I’m too young to die (required)
We will have a friendly conversation about how you implemented the goals (I will look at the source code and ask questions)
Hurt me plenty
What lib/io.c
does? (+15 EXP)
Switch to a different video mode (more rows & columns) (+10 EXP)
Nightmare
Provide an elaborate description of how the reading from keyboard is done in lib/kbd.c
. (+45 EXP)