Content area
Full Text
A lightweight, open-source operating system
NewOS is a freely available, opensource, lightweight operating system written from the ground up for a variety of platforms. At this stage of the project, NewOS (http://newos.sf.org/) is mostly a kernel, with little user-space interaction. As the project moves forward, however, the user-space applications and facilities will improve.
I had numerous design goals in mind when launching the project, most of which are common in modern day operating systems:
* Preemptive multiprocessing/multithreading.
* Symmetric multiprocessing (multiple CPUs).
* Full kernel reentrancy.
* Modern virtual memory system with protected memory.
* Modular filesystem layer.
* Architecture independence, easily ported to different platforms.
The kernel is written mostly in C, with some assembly. It should be possible to write user-space applications in just about any language, but for now, support is only in place for C and assembly.
At this writing, I've ported NewOS to the common Intel- and AMD-based PC platform, as well as the Sega Dreamcast-- a gaming console running on a Hitachi SH-4 processor. Ports to systems using MIPS and UltraSPARC processors are underway, with plans (but little progress) for ports to systems using Alpha and Motorola 68030 processors.
The build environment for the project consists of the GNU gcc, make, and binutils development tools. These tools can be built for the majority of common operating systems and target every platform that has a reasonable shot of being ported to. The project is built regularly on BeOS, Linux, FreeBSD, Solaris, Irix, and Windows NT. The current targeted processors are Intel IA-32 and Hitachi SH4. The flexibility of these tools is a great boon to the project.
Design Highlights
NewOS implements the traditional multiple threads per process model. Each process is defined as a set of threads sharing a single address space, file descriptors, and permissions. A special process exists that all of the kernel threads belong to.
The first thread in a process is treated in a slightly different way from the others. This thread is considered the primary thread and the process cannot exist without it. If the primary thread ever dies for any reason, the entire process will be killed. In the case of single-threaded applications, this has no effect, but in a multithread app,...