Not Another Completely Heuristic Operating System, or Nachos, is instructional software for teaching
undergraduate
Undergraduate education is education conducted after secondary education and before postgraduate education, usually in a college or university. It typically includes all postsecondary programs up to the level of a bachelor's degree. For example, ...
, and potentially graduate level operating systems courses. It was developed at the
University of California, Berkeley
The University of California, Berkeley (UC Berkeley, Berkeley, Cal, or California), is a Public university, public Land-grant university, land-grant research university in Berkeley, California, United States. Founded in 1868 and named after t ...
, 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
A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating hard disk drive platter, pla ...
* An
interrupt controller, timer, and misc. other components
which are there to run the Nachos
[
] user space applications. That means that you can write programs for Nachos, compile them with a real
compiler
In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
(an old
gcc compiler
[
] 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
Beta (, ; uppercase , lowercase , or cursive ; or ) is the second letter of the Greek alphabet. In the system of Greek numerals, it has a value of 2. In Ancient Greek, beta represented the voiced bilabial plosive . In Modern Greek, it represe ...
since approximately 1996.
Implementation
Nachos has various modules implementing the functionality of a basic operating system. The
wrapper function
A wrapper function is a function (another word for a ''subroutine'') in a software library or a computer program whose main purpose is to call a second subroutine or a system call with little or no additional computation. Wrapper functions sim ...
s for various
system call
In computing, a system call (syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive ...
s of the OS kernel are generally implemented in a manner similar to that of the
UNIX system calls
.
[
] 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.
[
] It contains various objects, such as
FileSystem
,
Processor
,
Timer
, etc. which are defined to simulate various hardware aspects.
Major components
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
interrupt
In digital computers, an interrupt (sometimes referred to as a trap) is a request for the processor to ''interrupt'' currently executing code (when permitted), so that the event can be processed in a timely manner. If the request is accepted ...
s. 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
In computing, a virtual address space (VAS) or address space is the set of ranges of virtual addresses that an operating system makes available to a process. The range of virtual addresses usually starts at a low address and can extend to the h ...
.
NachOS UserPrograms - Nachos runs user programs in their own private
address space
In computing, an address space defines a range of discrete addresses, each of which may correspond to a network host, peripheral device, disk sector, a memory cell or other logical or physical entity.
For software programs to save and retrieve ...
. 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
executable
In computer science, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instruction (computer science), in ...
s be in the simpler "Noff" format. To convert binaries of one format to the other, use the coff2noff program.
[
]
Successors
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
x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel, based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. Th ...
architecture), successor projects have been initiated. In 2004,
Stanford University
Leland Stanford Junior University, commonly referred to as Stanford University, is a Private university, private research university in Stanford, California, United States. It was founded in 1885 by railroad magnate Leland Stanford (the eighth ...
created
Pintos, a Nachos-inspired system written in
C and designed to run on actual
x86
x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel, based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. Th ...
hardware. In 2000, Dan Hettena at UC Berkeley ported Nachos to
Java
Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
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
William Marsh Rice University, commonly referred to as Rice University, is a Private university, private research university in Houston, Houston, Texas, United States. Established in 1912, the university spans 300 acres.
Rice University comp ...
. It was later adapted by Professor Eugene Stark at
Stony Brook University
Stony Brook University (SBU), officially the State University of New York at Stony Brook, is a public university, public research university in Stony Brook, New York, United States, on Long Island. Along with the University at Buffalo, it is on ...
in 2003 and applied in the
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s 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
*
Xv6
*
Pintos
*
Minix
References
External links
Nachos Home PageOriginal Usenix 1993 paper by Christopher, Procter, and Anderson.Extensive writeup on NachosJNachos Home Page, another Java-based version; ported by Patrick J. McSweeney and WonKyung Park
{{Operating system
Discontinued operating systems
Educational operating systems
MIPS operating systems