J4NN0 / OS161

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
    

About

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


Languages

Language:C 76.9%Language:HTML 15.5%Language:Makefile 3.0%Language:Assembly 1.9%Language:Shell 1.1%Language:Python 0.8%Language:C++ 0.5%Language:Objective-C 0.1%Language:CSS 0.1%