Recent from talks
Nothing was collected or created yet.
This article needs additional citations for verification. (February 2015) |
| XINU | |
|---|---|
| Developer | Douglas Comer |
| Written in | C |
| Working state | Current |
| Source model | Open source[1] |
| Initial release | 1981 |
| Latest release | 2nd ed. / 2015 |
| Repository | Xinu_Book_And_Code |
| Marketing target | Higher education, embedded systems |
| Default user interface | Command-line interface |
| Official website | www |
XINU Is Not Unix (XINU, a recursive acronym), is an operating system for embedded systems,[2] originally developed by Douglas Comer for educational use at Purdue University in the 1980s. The name is both recursive, and is Unix spelled backwards. It has been ported to many hardware platforms, including the DEC PDP-11 and VAX systems, Motorola 68k (Sun-2 and Sun-3 workstations, AT&T UNIX PC, MECB), Intel x86, PowerPC G3, MIPS, ARM architecture and AVR (atmega328p/Arduino). Xinu was also used for some models of Lexmark printers.[2]
Despite its name suggesting some similarity to Unix, Xinu is a different type of operating system, written with no knowledge of the Unix source code, or compatibility goals. It uses different abstractions, and system calls, some with names matching those of Unix, but different semantics.[2]
History
[edit]Xinu first ran on the LSI-11 platform. A Motorola 68000 port was done by Derrick Burns in 1983. A VAX port was done in 1986 by Comer and Tom Stonecypher, an IBM PC compatible port in 1988 by Comer and Timothy Fossum, a second Motorola 68000 (Sun 3) port circa 1988 by Shawn Ostermann and Steve Chapin, a Macintosh platform port in 1989 by Comer and Steven Munson, an Intel 80486 version by John Lin in 1995, a SPARC port by Jim Griffioen, and a PowerPC port in 2005 and MIPS port of Embedded Xinu in 2008 by Dennis Brylow.
Later developments
[edit]Dennis Brylow at Marquette University has ported Xinu to both the PowerPC and MIPSEL (little-endian MIPS) processor architectures. Porting Xinu to reduced instruction set computing (RISC) architectures greatly simplified its implementation, increasing its ability to be used as a tool for teaching and research.
MIPSEL was chosen as a target architecture due to the proliferation of the MIPSEL-based WRT54GL router and the cool incentive that motivates some students to become involved in projects. The first embedded Xinu systems laboratory based on the WRT54GL router was developed at Marquette University. In collaboration with the Marquette Xinu team, an embedded Xinu laboratory was formed at the University of Mississippi, laying the groundwork for further work on developing a Virtual Xinu Laboratory.
Embedded Xinu
[edit]Embedded Xinu is a fresh reimplementation of the Xinu design, in ANSI C, on an embedded RISC architecture. The MIPS port of Embedded Xinu was developed from 2006 to 2010 at Marquette University, under the direction of Dr. Dennis Brylow. The Embedded Xinu operating system is copyright (c) 2007, 2008, 2009, and 2010 by Douglas Comer and Dennis Brylow.
University of Mississippi Embedded Xinu Laboratory
[edit]The Xinu Laboratory in the University of Mississippi's Department of Computer and Information Science was formed during the summer of 2008 by Dr. Paul Ruth. Assisting him in the project were Jianshu Zhao and Patrick Hoover, who were both graduate students at the time. Also assisting him were Chelsea Norman and Kevin Kent, who were undergraduates at the time. The initial laboratory is based on the Marquette University Embedded Xinu Laboratory. Located in the server room of Weir Hall on the campus of the University of Mississippi, is composed of a dozen modified Linksys WRT54GL wireless routers, a 32 port Digi Etherlite serial annex, a 24 port 10/100 Mbit/s Ethernet switch, a BayTech serial controlled power strip, and quite a few wires. The system is controlled by a standard PC running Debian Linux. The whole system cost less than $3000, not including the PC.
The WRT54G routers use the MIPSEL architecture and are used as backend devices on which the Xinu embedded operating system runs. The PC runs several daemons which enable and manage the users ability to access the backends.
Nexos Project
[edit]The Nexos Project is a joint effort between Marquette University, the University at Buffalo, and the University of Mississippi to build curriculum materials and a supporting experimental laboratory for hands-on projects in computer systems courses. The approach focuses on low cost, flexible, commodity embedded hardware, freely available development and debugging tools, and a fresh implementation of a classic operating system, Embedded Xinu, that is ideal for student exploration. Virtual Xinu addresses two challenges that limit the effectiveness of Nexos. First, potential faculty adopters have clearly indicated that even with the current minimal monetary cost of installation, the hardware modifications, and time investment remain troublesome factors that scare off interested educators. Second, overcoming inherent complications that arise due to the shared subnet that allow student projects to interfere with each other in ways that are difficult to recreate, debug, and understand. Ultimately, porting the Xinu operating systems to QEMU virtual hardware, and developing the virtual networking platform have produced results showing success using Virtual Xinu in the classroom during one semester of the Operating Systems course at the University of Mississippi by Dr Ruth.
Latest versions
[edit]There are several versions of Xinu available for platforms such as an x86, ARM, AVR (Arduino) and MIPS. The last versions by Douglas Comer is for both the Intel x86 (Galileo) and ARM Cortex-A8 (BeagleBone Black).[3] The version for AVR requires 32 KB of flash, thus Arduino Uno boards and alike are supported.[4] The source code of these versions is freely available.[5]
See also
[edit]References
[edit]- ^ Xinu license
- ^ a b c Garfinkel, Simson; Spafford, Gene; Schwartz, Alan (2003). Practical UNIX and Internet Security. O'Reilly. p. 19.
- ^ Comer, Douglas (2015). Operating System Design - The Xinu Approach, Second Edition. United States of America: CRC Press. ISBN 9781498712439.
- ^ Xinu AVR version (Arduino)
- ^ Xinu avr atmega328p source code
External links
[edit]- Official website
- Douglas Comer at Purdue University
- Embedded Xinu and RISC Xinu at Marquette University Archived 2006-08-31 at the Wayback Machine
- Books On Computer Architecture and Operating Systems
- Xinu for the LSI-11 in the Unix Archive
- XINU FAQ (very old)
- installation instructions
- University of Mississippi embedded Xinu lab
- Nexos Project
Origins and History
Initial Development
Xinu's development began in the late 1970s at Purdue University, initiated by Douglas Comer as an instructional operating system for teaching core concepts in operating systems courses.[1] The project aimed to create a simple, modular kernel that would allow students to explore fundamental principles without the complexity of commercial systems, focusing on integration of network protocols alongside traditional OS elements.[1] Supported by hardware donations from Digital Equipment Corporation, the effort started around 1979-1980 to address the need for a hands-on educational tool in an era when access to source code for systems like Unix was limited.[1] The first release of Xinu occurred in 1981, targeted specifically at the DEC LSI-11 minicomputer, a platform with constrained resources such as 64KB of memory.[4] Written primarily in the C programming language with some assembly code for low-level operations like context switching, the system emphasized portability and clarity over performance optimizations.[2] The name Xinu serves as a recursive acronym for "Xinu Is Not Unix," underscoring its independent design philosophy; it neither relied on Unix source code nor sought binary compatibility, instead prioritizing educational transparency and modularity.[1] Early versions comprised approximately 8,000 to 10,000 lines of code, keeping the implementation compact to facilitate student comprehension and modification.[5] Xinu's original goals centered on providing a straightforward framework for demonstrating key operating system mechanisms, including process management, memory allocation, and basic networking.[1] Among its initial features were dynamic process creation for multitasking, semaphore-based synchronization to handle concurrency, message passing for inter-process communication using one-word messages, and a rudimentary file system supporting local storage operations.[5] These components were designed to be device-independent where possible, with a simple shell and input/output abstractions, enabling practical experiments in a controlled academic environment.[1]Early Ports and Implementations
Following its initial implementation on the LSI-11, a variant of the PDP-11, Xinu was ported to the full PDP-11 architecture in 1983, which facilitated its adoption in a wider array of university laboratories for hands-on operating systems education.[6] In the same year, a port to the Motorola 68000 (68k) processor was developed by Derrick Burns, targeting embedded-like systems and workstations such as the Sun-2 and Sun-3; this version was refined in 1988 to enhance support for resource-constrained environments.[1][7] The VAX port, completed in 1986 by Douglas Comer and Tom Stonecypher, adapted Xinu for minicomputer settings, allowing experimentation with larger-scale multiprocessing and networking in academic settings.[8] By 1988, Xinu was ported to the IBM PC, supporting 8086 and 80286 processors through the PC-Xinu edition, which emphasized compatibility with personal computing hardware while preserving the system's educational focus on process management and I/O handling. The 1989 Macintosh port, led by Comer and Steven Munson, tailored Xinu to Apple's hardware, incorporating adaptations for graphics interfaces and basic networking demonstrations to illustrate device interaction in a graphical user environment.[9] In 1995, John Lin developed a port for the Intel 80486, introducing early enhancements to multitasking capabilities that built on prior versions while maintaining Xinu's lightweight footprint for instructional use. Throughout these early ports, Xinu's design emphasized modularity, isolating hardware-specific functionality in device drivers to ensure portability across architectures without altering the core kernel structure.System Architecture
Kernel Design
Xinu employs a monolithic kernel architecture, in which all core operating system components—such as process management, memory allocation, and input/output operations—execute within a single, shared address space without separation into user and kernel modes typical of microkernel designs. This structure integrates the entire system into one executable image, linking processes and kernel services tightly to facilitate simplicity and direct access to hardware resources. The absence of protection rings or address space isolation means that all processes share the kernel's memory, promoting ease of implementation for educational purposes but limiting scalability in more complex environments.[10] Memory management in Xinu follows a flat physical model without support for paging or virtual memory, relying instead on a single free list to manage available physical memory as a unified resource. Allocation occurs in fixed partitions with a minimum granularity of eight bytes, using first-fit for heap requests from lower addresses and last-fit for stack requests from higher addresses to minimize fragmentation. The system initializes the free list at startup with all non-kernel memory, supporting dynamic allocation through functions likegetmem and getstk, while coalescing adjacent free blocks during deallocation to maintain efficiency. This approach ensures straightforward memory handling but precludes advanced features like demand paging or memory protection.[11]
Process management utilizes priority-based preemptive scheduling, where the highest-priority ready process executes immediately, with round-robin time-sharing among processes of equal priority via a linked list of ready queues ordered by priority level. Context switching is handled by low-level assembly routines that save and restore process states—including registers and stack pointers—on the process's own stack, enabling efficient transitions without hardware-assisted virtualization. A null process at the lowest priority ensures the scheduler always has an idle task to run, preventing system hangs during low load. Synchronization relies on counting semaphores for mutual exclusion and coordination, manipulated via wait and signal operations to manage access to shared resources. Inter-process communication occurs through synchronous message passing, primarily using ports as bounded buffers that support many-to-many exchanges, with senders and receivers blocking on full or empty conditions respectively, and underlying semaphores ensuring atomicity.[12][13][14]
The input/output subsystem provides device independence through a layered abstraction, featuring high-level interfaces like open, close, read, and write that insulate applications from hardware specifics, while lower layers include modular drivers for devices such as networks and storage. These drivers handle device-specific operations, including direct memory access for high-performance peripherals like Ethernet, enabling support for both local file systems and networked I/O without requiring application-level changes. Xinu's design omits multi-user capabilities and security mechanisms, such as user authentication or access controls, tailoring it instead for single-user, educational scenarios where simplicity outweighs robustness needs.[13][1]
Core Components and Features
Xinu's network stack provides support for Ethernet, Internet Protocol (IP), User Datagram Protocol (UDP), and Transmission Control Protocol (TCP), enabling basic networked operations such as client-server communication and remote booting. The Ethernet layer uses a DMA-based driver with separate transmit and receive descriptor rings for efficient packet handling, while the IP implementation focuses on minimal IPv4 datagram transfer without fragmentation, relying on a default router for routing. UDP supports port-based multiplexing for concurrent connections via functions likeudp_init, udp_send, and udp_recv, with the core UDP module comprising approximately 400 lines of code; TCP is included for reliability but often simplified in educational contexts. This stack facilitates features like message sequencing, retransmission (up to three retries with 1000 ms timeouts), and packet demultiplexing through a dedicated network input process (netin), all within a compact design optimized for embedded systems.[5]
The file system in Xinu employs a simple hierarchical structure supporting directories and files, with local access managed through an index-based mechanism using index blocks (i-blocks) and data blocks (d-blocks) for device-independent I/O. Local files allow dynamic growth without preallocation, accommodating concurrent operations, where each index block references up to 8192 bytes and data blocks are typically 512 or 1024 bytes in size. Remote file access operates via NFS-like primitives, utilizing a remote disk driver for operations such as create, read, write, seek, truncate, and delete, limited to one open instance per file for simplicity; this integrates with pseudo-devices like RFILE0 to RFILE9 and supports stable storage through RAM disks or networked servers. Buffer management in the file system uses in-memory copies with dirty bits to track modifications, enhancing I/O efficiency.[5]
Dynamic memory allocation in Xinu utilizes a free list allocator to manage heap and stack storage efficiently in resource-constrained environments. The allocator maintains a linked list of free blocks, rounding requests to multiples of 8 bytes (with a minimum block size of 8 bytes) and employing coalescing to mitigate fragmentation; key functions include getmem and freemem for general allocation, alongside getstk and freestk for stack-specific needs, ensuring 4-byte alignment for structures like descriptor rings. Complementing this, buffer pool management handles I/O operations through fixed-size pools synchronized via semaphores, supporting up to 2048 buffers per pool with a free list and cache for quick access. Buffers vary in size—such as 2048 bytes for network packets, 128 characters for input, and 512-1024 bytes for file data—and are initialized via bufinit, enabling DMA integration and modes like raw or cooked for device control.[5][15]
In comparison to other teaching operating systems, Xinu's monolithic kernel integrates these components in approximately 10,000 lines of code total, emphasizing simplicity and network functionality over advanced features like symmetric multiprocessing (SMP), virtual memory (VM), or memory protection, which are absent to facilitate understanding of core concepts. Unlike Minix, which adopts a modular microkernel design with mandatory MMU support for process isolation, or xv6, a Unix-like system incorporating paging and basic protection rings, Xinu prioritizes a streamlined, unprotected environment similar to Pintos in its project-based educational focus but distinguishes itself through stronger emphasis on networked subsystems like its compact TCP/IP stack.[15][16]
