-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
125 lines (111 loc) · 10.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<title>xinu-avr: The Xinu OS for AVR atmega328p</title>
<!--link rel="stylesheet" type="text/css" href="./www/files/mainpage.css"-->
<link rel="stylesheet" media="(orientation: portrait)" href="./www/files/page_p.css">
<link rel="stylesheet" media="(orientation: landscape)" href="./www/files/page_l.css">
<script language="JavaScript" type="text/javascript">
</script>
</head>
<body>
<!--center>
<img src="./www/files/xinu_web_page_heading.jpeg">
</center-->
<h2><strong>xinu-avr</strong>: the Xinu OS for AVR atmega328p devices (e.g. Arduino)</h2>
<center>
<h4>
[<a href="http://se.fi.uncoma.edu.ar/xinu-avr/index.html#whatisxinu">What is Xinu?</a>]
[<a href="https://se.fi.uncoma.edu.ar/xinu-avr/index.html#code">code for download</a>]
[<a href="https://se.fi.uncoma.edu.ar/xinu-avr/index.html#authors">authors</a>]
[<a href="https://se.fi.uncoma.edu.ar/xinu-avr/index.html#douglas">Douglas Comer</a>]
[<a href="https://se.fi.uncoma.edu.ar/xinu-avr/howtouse.html">getting started</a>]
[<a href="https://se.fi.uncoma.edu.ar/xinu-avr/index.html#notes">notes</a>]
[<a href="mailto:[email protected]">contact us</a>]
</h4>
</center>
<hr>
<a name="description">
<h3>Introduction</h3>
<p>The <strong>xinu-avr</strong> project is a <strong>Xinu Operating System</strong> subset, modified to run on an AVR atmega328p microcontroller (e.g. Arduino boards). </p>
<p><a href="https://www.youtube.com/watch?v=JAcUuP-BKIU" title="Demo video: Xinu OS into AVR atmega328p"><img style="float: right;" alt="Demo video: Xinu OS into atmega328p MCU" src="http://se.fi.uncoma.edu.ar/xinu-avr/www/files/placa3.jpg" /></a></p>
<p>At present, the core pieces of Xinu are working, so you can already integrate it
in the development of multi-tasking embedded systems (you will also need any bare AVR MCU, or Arduino board, of course).</p>
<p>For lovers of "because small is beautiful" (FusixOS, retrobsd, unix in microcontrollers, etc) this project provides a user interface example as well: The <strong>Xinu shell</strong> and some tiny versions of utilities like echo, a text editor, a basic interpreter, ps, kill, free, date, cal, and some more. Check the <a href="https://www.youtube.com/watch?v=JAcUuP-BKIU">demo video</a> if you want to see a xinu-avr session in a little AVR MCU (like a retro computer system).</p>
<p>The source code is comprise of:</p>
<ol>
<li>The <strong>Xinu OS</strong> for AVR atmega328p (microkernel)</li>
<li>Basic examples (<strong>apps</strong>) of how to use Xinu</li>
<li>A complete example: <strong>The Xinu shell</strong> and tiny versions of several <strong>UNIX-like utilities</strong></li>
</ol>
<p><a name="whatisxinu"></a></p>
<h3>What is Xinu?</h3>
<p>Xinu is a small, elegant, and easy to understand operating system, originally developed by Douglas Comer for instructional purposes at Purdue University in the 1980s. Since then it has been ported to many architectures and hardware platforms.
Xinu uses powerful primitives to provides all the componentes and the same functionality many conventional operating sytems supply. Because the whole source code size is small, <strong>Xinu is suitable for embedded systems</strong>.</p>
<p><strong>The Xinu Operating System includes</strong>: dynamic process creation, dynamic memory allocation, real-time clock management, process coordination and synchronization, local and remote file systems, a shell, and device-independent I/O functions. </p>
<p>The Xinu Operating System is
documented in the book
<a href="https://xinu.cs.purdue.edu/#textbook">D. Comer, Operating System Design - The Xinu Approach, Second Edition CRC Press, 2015. ISBN 9781498712439</a></p>
<p>Many sites defines Xinu as a free Unix system, or similar statements. It is not. Xinu differs completely from the internal structure of Unix (or Linux). For academic purposes Xinu is smaller, elegant, and easier to understand. Applications written for one system will not run on the other without modification. <strong>Xinu is not Unix</strong>.</p>
<h4>History</h4>
<p>Xinu originally ran on Digital Equipment Corporation LSI 11's with only 64K bytes of memory, at the end of 1979 and the inning of 1980. Over the years Xinu have been expanded and ported to a wide variety of architectures and platforms, including: IBM PC, Macintosh, Digital Equipment Corporation VAX and DECStation 3100, Sun Microsystems Sun 2, Sun 3 and Sparcstations, and for several ARM, MIPS and x86 embedded boards. It has been used as the basis for many research projects. Furthermore, Xinu has been used as an embedded system in products by companies such as Motorola, Mitsubishi, Hewlett-Packard, and Lexmark. There is a full TCP/IP stack, and even the original version of Xinu (for the PDP-11) supported arbitrary processes and network I/O.</p>
<p>There are current versions of Xinu for Galileo Intel boards, ARM Beagle Boards, several MIPS platforms, and for x86 PC hardware and virtual machines.</p>
<p><a name="code"></a></p>
<h3>source code:</h3>
<p>There is just one git repository, and it has everything (<a href="http://github.com/zrafa/xinu-avr/">git</a>). The list below is just for convenience:</p>
<ul>
<li><a href="https://github.com/zrafa/xinu-avr">The Xinu OS for AVR atmega328p</a></li>
<li><a href="https://github.com/zrafa/xinu-avr/tree/master/apps/">example apps</a></li>
<li><a href="https://github.com/zrafa/xinu-avr/tree/master/apps/shell/">The xinu shell and tiny UNIX-like utilities (editor, basic interpreter, ps, kill, echo, uptime, sleep, etc)</a></li>
<li><a href="https://xinu.cs.purdue.edu/">The official Xinu Page and Code</a></li>
</ul>
<p><a name="authors"></a></p>
<h4>Authors:</h4>
<ul>
<li>Xinu OS Copyright (c) 2012, 2015
Douglas E. Comer and CRC Press, Inc.</li>
<li>This version for AVR atmega328p v0.1 (c) 2020
Rafael Ignacio Zurita <a href="mailto:rafa@fi.uncoma.edu.ar">rafa@fi.uncoma.edu.ar</a></li>
</ul>
<p><strong>Acknowledgments</strong></p>
<ul>
<li>Michael M. Minor: he is the author of another AVR port os Xinu (<a href="https://sites.google.com/site/avrxinu/">avrxinu</a>. We use his context switch code, the addargs in Xinu shell, and a few lines more. His port is for bigger AVR microcontrollers (16KB+ of RAM), and he used an old version of Xinu (Xinu from the 1987 book edition).</li>
</ul>
<p><a name="notes"></a></p>
<h3>Notes about the Xinu OS port for AVR atmega328p</h3>
<p>Current official Xinu versions are designed for ARM, MIPS and x86 architectures . The hardware differences between those and the ultra small AVR microcontroller required changes to some low-level data structures of Xinu, mainly using the FLASH memory in the AVR MCU, for keeping several read-only data structures, previously in RAM. Also, several limits were imposed, so the read-write data structures fits into the SRAM AVR memory. The Xinu version for AVR atmega328p has the core functionality of Xinu, and provides some extensions, including an eeprom file system and several UNIX like utilities for the Xinu shell.</p>
<p>This MCU has just 2KB of SRAM, 32KB of FLASH memory, and 1KB of EEPROM. The Xinu version for AVR uses 12KB of FLASH and 0.9KB of RAM, so there is still 50% of room (SRAM and FLASH) for the embedded application running on Xinu (concurrent processes).</p>
<p>So this project might be stimulating and very fun for lovers of embedded systems development and operating system internals.</p>
<p>Notes about the port:</p>
<ol>
<li>Max. number of processes (4 to 8)</li>
<li>main process is now the embedded application process</li>
<li>Max. number of semaphores (2 to 6) (the size of the table of process queues depends on this)</li>
<li>Max. number of devices (4 to 5)</li>
<li>The clkhandler() wakeup() a process (preemption) for CPU every 100ms</li>
<li>Several limits for buffers: 32bytes for tty input, 16bytes for names of devices, 1byte for the queues keys, and the list continues</li>
<li>sleepms() is now delay sleep100ms() (and the key for queue "char" in ms * 100)</li>
<li>Many vars in data structures have a smaller size (e.g. before:int32, now:char)</li>
<li>sleep sleeps max. 20 seconds (date type)</li>
<li>most of the libc are from avr-libc</li>
<li>init (load bss and data from flash to ram) from avr-libc</li>
<li>shell manages max. 6 tokens</li>
<li>date and time is managed by a little lib. No NTP or RTC</li>
<li>Most of the const char in source code were moved to FLASH (program space) via __flash directive from gcc, or PROGMEM from avr-libc</li>
<li>tty_in is asynchronous (with interrupts) (ok). But tty_out is polled based (synchronous).</li>
<li>open, read, write, seek, close use struct dentry. It is on flash on this port</li>
<li>remote file systems, local file systems, ram file systems are disabled so far.</li>
<li>ports (ptinit, ptsend, ptrecv, etc) are disabled so far.</li>
<li>null process has priority 1.</li>
</ol>
<p><a name="douglas"></a></p>
<h3>Douglas Comer</h3>
<p>Douglas Comer is a Professor of Computer Science at Purdue University who
was inducted into the Internet Hall of Fame on September, 2019.</p>
<p>As one of the earliest TCP/IP and internetworking researchers, Comer wrote the first series of textbooks explaining the scientific principles underlying the design of the Internet and its communications protocols, providing some of the earliest formal guidance for building efficient networks and applications that use the Internet.
Comer's three-volume textbook series, Internetworking with TCP/IP, written in 1987, is widely considered to be the authoritative reference for Internet protocols. The series played a key role in popularizing Internet protocols by making them more understandable to a new generation of engineers and IT professionals.</p>
<p>Prof. Douglas Comer designed and developed the Xinu operating system in 1979-1980.</p>
<p><a href="https://www.cs.purdue.edu/homes/comer/">Douglas Comer Page</a></p>
<p><a href="https://www.cs.purdue.edu/news/articles/2019/comer_ihof.html">Internet Hall of Fame</a></p><br><br><hr><small><i> last edit: Thu Jul 30 20:19:50 -03 2020 - Rafael Ignacio Zurita (rafa at fi.uncoma.edu.ar)</i></small> <br><br>
</body></html>