Project Goal Set III - Lighting Up the Console

From Maryville College CS Wiki
< Os‎ | spring2019
Jump to: navigation, search


Your goal this week is to provide a rudimentary busy-waiting console IO system. The end result is that when your operating system boots up, it should do the following:

 Kernel Started
 What is your name? *user types name*
 Hello, *user types name*, how are you?


Take a look in xv6's uart.c. Most of what you need is in there, however we will not be doing interrupt handling just yet. You should initialize the UART with interrupts disabled. (See the lecture slides for info on how to do this.) You should also implement a console_getchar function which waits until character input is available and then returns it. Likewise, your console_putchar function should write a character and only return once it is completed.

Your main function should basically call your uart_init function and then use your high level functions to perform the above exchange. After you are done, you will then go into the infinite loop we put in place last week.

Higher Level Functions

It would be a good idea to go ahead and write functions that mimic the read and write functions from unix sys calls. For now, you can ignore the file descriptors as there will be only keyboard and TTY input. You may also want to write functions that read and write null terminated strings.

Most of all, have fun with it! This will be your first bootable program with IO!