Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
296 views

Operating System NACHOS

Nachos is an educational operating system developed at UC Berkeley used to teach undergraduate operating systems concepts. It runs as a user process on a host OS and simulates a MIPS processor. Students complete assignments that involve implementing OS functionality in Nachos, such as creating new system calls. The authors created two new system calls - Test1 prints numbers 2 to 5, and Test2 prints numbers 25 to 20. They faced issues during installation but resolved them by uninstalling an older Nachos version and installing the latest version. Overall, the project helped them learn how an OS works and how to modify the kernel.

Uploaded by

Chris Lazar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
296 views

Operating System NACHOS

Nachos is an educational operating system developed at UC Berkeley used to teach undergraduate operating systems concepts. It runs as a user process on a host OS and simulates a MIPS processor. Students complete assignments that involve implementing OS functionality in Nachos, such as creating new system calls. The authors created two new system calls - Test1 prints numbers 2 to 5, and Test2 prints numbers 25 to 20. They faced issues during installation but resolved them by uninstalling an older Nachos version and installing the latest version. Overall, the project helped them learn how an OS works and how to modify the kernel.

Uploaded by

Chris Lazar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

OPERATING

SYSTEMS

STUDY OF NACHOS
NAME: VIVEK AGRAWAL 17BCE0201
CHRIS LAZAR 17BCE2160
ABHISHEK NAIK 17BCE0115
ROUANK STANLEY 17BCE2233
FACULTY: DR. R. PADMA PRIYA
COURSE CODE: CSE2005
SLOT: F1
ABSTRACT

 Not Another Completely Heuristic Operating


System, or Nachos, is instructional software for
teaching undergraduate, and potentially
graduate level operating systems courses. It
was developed at the University of California,
Berkeley, designed by Thomas Anderson, and
is used by numerous schools around the
world.
 Originally written in C++ for MIPS, Nachos runs
as a user-process on a host operating system.
A MIPS simulator executes the code for any
user programs running on top of the Nachos
operating system. Ports of the Nachos code
exist for a variety of architectures.
 In addition to the Nachos code, a number of
assignments are provided with the Nachos
system. The goal of Nachos is to introduce
students to concepts in operating system
design and implementation by requiring
them to implement significant pieces of
functionality within the Nachos system.
The Architecture of Nachos

System Start-Up Flowchart


SOFTWARES and TOOLS used for
installation of NACHOS and
CROSS COMPILER

 Virtual Machine & Image


Virtual machine runs on your current OS.
eg. virtual box, vmware…
 Ubuntu Desktop
http://www.ubuntu.com/download/desktop/
• Download the image (.iso file).
• Load the image into your virtual machine.
• Or you can set up your own new virtual machine
of course.
 NACHOS-4.0 version was downloaded and extracted
manually,
 MIPS-DECSTATION-ULTRIX cross compiler was downloaded
and extracted manually.
 Install g++, csh and su
sudo apt-get install g++
sudo apt-get install csh
sudo -su
 EMACS 24 editor was installed and used.
 MIPS-DECSTATION compiler was moved from home to
usr/local and that path was used in the makefile.
STEP 1: mv decstation-Ultrix /usr/local

STEP 2: ncahos-4.0/code/make
STEP 3: code/threads# ./nachos

This nachos shows that nachos is installed on the


system.
STEP 4: /code/userprog# ./nachos –x
../test/halt

NOW NACHOS IS COMPLETELY INSTALLED IN


THE MACHINE AND THE CROSSED COMPILER
IS ALREADY IN /usr/local
CREATION OF A SYSCALL

System Call Procedure

SYSCALLS that are created by me:


• Test1(prints no. from 2 to 5)
• Test2(prints no. from 25 to 20)
STEPS FOR CREATION AND
IMPLEMENTATION OF A SYSCALL

STEP 1: nachos-4.0/code/userprog/vi syscall.h


STEP 2: nachos-4.0/code/userprog/exception.cc
STEP 3: nachos-4.0/code/test/start.s

STEP 4: copy the same start.s code in


start.c file and save it
STEP 5: nachos-4.0/code/test
emacs Makefile
STEP 6: create a c file in test folder.
* test1.c
* test2.c
test1.c
STEP 7: nachos-4.0/code/make all
In the test folder, binary and .coff files are
created which shows that syscalls and
tests were compiled successfully. Now we
will implement them
STEP 8: nachos-4.0/code#
./userprog/nachos –rs 1023 –x./test/sub

This is how syscalls are created and


implemented in NACHOS using MIPS
CROSS COMPILER
ISSUES FACED WHILE
INSTALLING AND CREATING
SYSCALLS

 The code : make when typed in test directory after


typing the code of the syscalls in start.s , start.o and
Makefile, was putting forth a critical error.
 This was over come by Uninstalling the nachos-3.4
 And installing nachos-4.0 on a 32-bit i-386 ubuntu
operating system
INFERENCE FROM THE
PROJECT

 Through this project we got know the


actual working of an operating system,
how a bootloader boots the first instance
of an operating system. Through the
kernel files we observed how actually the
system calls are written in C and
assembly language. With several failed
tries and eventually after much hard-
work and effort we learned and
successfully able to change the kernel files
and observe the changes in the operating
system. We researched on the system calls
and added and modified them in the
kernel of the NACHOS and modified the
kernel. Through this we learned how can
the kernel of a system can be modified.
 The next work we did was on developing
the NACHOS application. For
understanding and writing the code we
studied the beginner’s assembly language
and interpreted and write a code by
taking reference from an available
example.
REFERENCES

 "Guide to Nachos, University of


Pittsburgh".
 "Compiling C and C++
Programs, University of
Wisconsin".
"Nachos Beginner's Guide, Level
2: System calls and exceptions,
Linköping University".
 "Machine Class at Nachos
Documentation, University of
California, Berkeley".
"A road map through NachOS,
Duke University".

You might also like