Not Another Completely Heuristic Operating System

Operative System

This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (November 2009) (Learn how and when to remove this message)

|

Operating system

Nachos

Developer| University of California, Berkeley
(Thomas Anderson, Wayne A. Christopher, Steven J. Procter)
Written in| C++
Working state| Discontinued
Initial release| 1992; 33 years ago (1992)
Latest release| 3.4
Latest preview| 4.0 / 1996; 29 years ago (1996)
Supported platforms| MIPS architecture
Kernel type| Monolithic
License| Berkeley Software Distribution
Official website| www.cs.washington.edu/homes/tom/nachos/

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.

In Nachos' case, Operating System simulator simply means that you can run an OS (a guest OS) on top of another one (the host OS), similar to Bochs/VMware. It features emulation for:

* A CPU (a MIPS CPU)
* A hard drive
* An interrupt controller, timer, and misc. other components

which are there to run the Nachos[1] user space applications. That means that you can write programs for Nachos, compile them with a real compiler (an old gcc compiler[2] that produces code for MIPS) and run them. The Nachos kernel instead is compiled to the platform of the Host OS and thus runs natively on the Host OS' CPU.

Nachos version 3.4 has been the stable, commonly used version of Nachos for many years. Nachos version 4.0 has existed as a beta since approximately 1996.

## Implementation

[edit]

Nachos has various modules implementing the functionality of a basic operating system. The wrapper functions for various system calls of the OS kernel are generally implemented in a manner similar to that of the UNIX system calls .[3] Various parts of the OS are instantiated as objects using the native code. For example, a class `Machine`is used as the master class of the simulated machine.[4] It contains various objects, such as `FileSystem`, `Processor`, `Timer`, etc. which are defined to simulate various hardware aspects.

### Major components

[edit]

NachOS Machine \- Nachos simulates a machine that roughly approximates the MIPS architecture. The machine has registers, memory and a CPU. The Nachos/MIPS machine is implemented by the Machine object, an instance of which is created when Nachos starts up. It contains methods like Run, ReadRegister, WriteRegister, etc. It also defines an interrupt object to handle interrupts. Timer and statistics are also implemented in this.

NachOS Threads \- In NachOS a thread class is defined. A thread has an associated state with it which may be ready, running, blocked or just created. The thread object has various methods like PutThreadToSleep, YieldCPU, ThreadFork, ThreadStackAllocate, etc. Each thread runs at a virtual address space.

NachOS UserPrograms \- Nachos runs user programs in their own private address space. Nachos can run any MIPS binary, assuming that it restricts itself to only making system calls that Nachos understands. In Unix, "a.out" files are stored in "coff" format. Nachos requires that executables be in the simpler "Noff" format. To convert binaries of one format to the other, use the coff2noff program.

[5]

## Successors

[edit]

As Nachos has not been in active development for a number of years, and possesses a number of recognized flaws (particularly with regards to portability: Nachos relies on MIPS assembly code, and requires porting to run on x86 architecture), successor projects have been initiated. In 2004, Stanford University created Pintos, a Nachos-inspired system written in C and designed to run on actual x86 hardware. In 2000, Dan Hettena at UC Berkeley ported Nachos to Java as Nachos 5.0j, in an effort to make Nachos more portable, more accessible to undergraduates, and less susceptible to subtle bugs in student code that had in earlier versions often dominated student project development time. Another Java-based version was created by Professor Peter Druschel at Rice University. It was later adapted by Professor Eugene Stark at Stony Brook University in 2003 and applied in the operating systems course. At Graz University of Technology (Austria), a system called SWEB ("Schon wieder ein Betriebssystem") has been implemented and is used to teach operating system principles.

## See also

[edit]

* Xv6
* Pintos
* Minix

## References

[edit]

1. ^ "Guide to Nachos, University of Pittsburgh". Retrieved 2014-02-17.
2. ^ "Compiling C and C++ Programs, University of Wisconsin". Retrieved 2014-02-17.
3. ^ "Nachos Beginner's Guide, Level 2: System calls and exceptions, Linköping University". Retrieved 2014-09-09.
4. ^ "Machine Class at Nachos Documentation, University of California, Berkeley". Retrieved 2014-09-09.
5. ^ "A road map through NachOS, Duke University". Retrieved 2015-05-05.

## External links

[edit]

* Nachos Home Page
* Original Usenix 1993 paper by Christopher, Procter, and Anderson.
* Extensive writeup on Nachos
* Thomas Narten's Nachos Roadmap
* Nachos for Java Walkthrough
* JNachos Home Page, another Java-based version; ported by Patrick J. McSweeney and WonKyung Park

* v
* t
* e

Operating systems

General|

* Comparison
* Forensic engineering
* History
* List
* Timeline
* Usage share
* User features comparison

Variants|

* Disk operating system
* Distributed operating system
* Embedded operating system
* Hobbyist operating system
* Just enough operating system
* Mobile operating system
* Network operating system
* Object-oriented operating system
* Real-time operating system
* Supercomputer operating system

Kernel|

| Architectures|

* Exokernel
* Hybrid
* Microkernel
* Monolithic
* Multikernel
* vkernel
* Rump kernel
* Unikernel

|

Components|

* Device driver
* Loadable kernel module
* User space and kernel space

Process management|

| Concepts|

* Computer multitasking (Cooperative, Preemptive)
* Context switch
* Interrupt
* IPC
* Process
* Process control block
* Real-time
* Thread
* Time-sharing

|

Scheduling
algorithms|

* Fixed-priority preemptive
* Multilevel feedback queue
* Round-robin
* Shortest job next

Memory management,
resource protection|

* Bus error
* General protection fault
* Memory paging
* Memory protection
* Protection ring
* Segmentation fault
* Virtual memory

Storage access,
file systems|

* Boot loader
* Defragmentation
* Device file
* File attribute
* Inode
* Journal
* Partition
* Virtual file system
* Virtual tape library

Supporting concepts|

* API
* Computer network
* HAL
* Live CD
* Live USB
* Shell
* CLI
* User interface
* PXE

*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template