NACHOS Source Code

Most of what you learn in this class you will learn by reading and modifying NACHOS source code. You need to become very familiar with the structure of that code, as early as possible. Here are some important points.

  • Source Code
  • System Utilities
    Debugging flags, ASSERT, miscellaneous arithmetic
  • code/threads/utility.h
  • code/threads/utility.cc
  • List manipulation
  • code/threads/list.h
  • code/threads/list.cc
  • Bitmap manipulation
    User address spaces are bitmaps.
  • code/userprog/bitmap.h
  • code/userprog/bitmap.cc
  • Basic System Code
    Bootstrap the kernel
  • code/threads/main.cc
  • Global system data, initialization, cleanup
  • code/threads/system.h
  • code/threads/system.cc
  • Threads
    Representation of thread, fork, finish, yield, sleep operations
  • code/threads/thread.h
  • code/threads/thread.cc
  • Scheduler for threads
  • code/threads/scheduler.h
  • code/threads/scheduler.cc
  • Context switch
  • code/threads/switch.h
  • code/threads/switch.s (machine-dependent, do not modify)
  • Synchronization primitives (semaphores, locks, condition variables)
  • code/threads/synch.h
  • code/threads/synch.cc
  • Synchronized list access
  • code/threads/synchlist.h
  • code/threads/synchlist.cc
  • Test program: two threads alternating This test is executed by the system from the main function in code/threads/main.cc. It is not a user program.
  • code/threads/threadtest.cc
  • User programs
    Manage user address space
  • code/userprog/addrspace.h
  • code/userprog/addrspace.cc
  • Enter System from User Program (system call, exception, interrupt)
  • code/userprog/syscall.h
  • code/userprog/exception.cc
  • Test programs: run user program or test console
    One of the test functions StartProcess or ConsoleTest is executed by the system from the main function in code/threads.main.cc.
  • code/userprog/progtest.cc
  • File System
    General operations
  • code/filesys/filesys.h
  • code/filesys/filesys.cc
  • Directory management
  • code/filesys/directory.h
  • code/filesys/directory.cc
  • Open file management
  • code/filesys/openfile.h
  • code/filesys/openfile.cc
  • Synchronous disk access
  • code/filesys/synchdisk.h
  • code/filesys/synchdisk.cc
  • Disk file header
  • code/filesys/filehdr.h
  • code/filesys/filehdr.cc
  • Test program for file system assignment
  • code/filesys/fstest.cc
  • Networking
  • User programs for testing
  • Utilities (bin)
  • MIPS Simulator (do not modify)
  • Makefiles
  • code/Makefile
  • code/Makefile.common
  • code/Makefile.dep
  • code/threads/Makefile
  • code/userprog/Makefile
  • code/vm/Makefile
  • code/filesys/Makefile
  • code/network/Makefile
  • code/bin/Makefile
  • code/test/Makefile
  • Direct access to all the directories and files.
  • Back to CS 546 Homepage


    Last modified: Thu Sep 12 13:22:42 1996 by
    <jmontgomery@cti.depaul.edu>