| Preparation |
|---|
First, make a fresh copy of your work thus far.
   cp -R xinu-hw6 xinu-hw7
Untar the new project files on top of this directory:
   tar xvzf ~brylow/cosc125/xinu-hw7.tar.gz
You should now see the new project files in with your old files. Be certain to make clean before compiling for the first time.
| Sleep |
|---|
Modify system/sleep.c, system/wakeup.c, system/insertd.c, and system/clkintr.c to add the sleep() system call to the operating system. Test this thoroughly before moving on to the next section.
Create a main program that demonstrates sleep() is working, called main-sleep.c, and make sure that it works when copied over main.c.
| Getmem and Freemem |
|---|
The files include/mem.h and system/initialize.c define and initialize a free list of available memory blocks on the heap. Implement system/getmem.c and system/freemem.c to dole out blocks of requested memory and properly maintain the free list. Use First Fit with simple compaction.
Delete the file system/getstk.c, and replace the lone call to this function in system/create.c with a proper call to getmem() instead. The new system/kill.c has already been modified to call freemem() to deallocate the process stack.
| Testing |
|---|