Skip to content
/ OS161 Public

The implementation of systems calls, lock, Virtual Memory and other file system implementation on OS161

Notifications You must be signed in to change notification settings

J4NN0/OS161

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OS161

OS/161 is a teaching operating system, that is, a simplified system used for teaching undergraduate operating systems classes. It is BSD-like in feel and has more "reality" than most other teaching OSes; while it runs on a simulator it has the structure and design of a larger system.

More info here: http://os161.eecs.harvard.edu

Modify the kernel

  1. Create a file in kern/main/yourfile.c and write a function

  2. Modify kern/main/main.c entering a call to your function

  3. In test.h:

    #include "opt-yourfile.h" //(opt-optname.h)
    Insert a prototype of your function  
    
  4. Modify kern/conf/conf.kern inserting the new file (#Startup and initialization):

     defoption yourfile
     optfile   yourfile   main/yourfile.c
    
  5. Generate in kern/conf a new file (for example YOURFILE)

     It can be a copy of DUMBVM adding a new line: "options yourfile"
    
  6. Finally do the make of the kernel:

       In kern/conf
           ./config YOURFILE
           
       In kern/compile/YOURFILE
           bmake depend
           bmake
           bmake install
    

Writing a new system call

  1. In kern/arch/mips/syscall/syscall.c there is switch case in which you can menage the system calls

  2. To menage a system call it's necessary an integer code. See:

    kern/include/kern/syscall.h
    
  3. Create your system call in kern/syscall/my_syscalls.c

  4. Modify kern/include/syscall.h adding a prototype of the syscall function

  5. Modify kern/conf/conf.kern inserting the new file (#System call layer):

    file syscall/my_syscalls.c
    
  6. Finally do the make of the kernel

     In kern/conf
       ./config DUMBVM
       
     In kern/compile/DUMBVM
         bmake depend
         bmake
         bmake install