
XOS: Build your own operating system - gphilip
http://xosnitc.github.io/index.html
======
userbinator
_The machine simulator is known as eXperimental String Machine (XSM). It is an
interrupt driven uniprocessor machine. The machine handles data as strings. A
string is a sequence of characters terminated by ’\0’. The length of a string
is at most 16 characters including ’\0’. Each of these strings is stored in a
word. (Refer Section: Memory) The machine interprets a single character also
as a string._

What an... odd architecture. Fun for experimentation, I'm sure, but I think
it's too different from contemporary CPUs to give a good taste of what the
"real" thing is like.

~~~
al2o3cr
Yeah, that has me scratching my head as well. Especially once I realized
there's no way to index _into_ a string...

~~~
TehCorwiz
Caveat: I haven't read the spec. But at that level wouldn't you just be doing
pointer math to access specific parts of the word?

------
frozenport
Should use x86/ARM/MIPS so that students get real world experience. You might
never have to write an OS, but knowing x86 assembly will help you debug and
optimize code.

See the following course:
[https://courses.engr.illinois.edu/ece391/](https://courses.engr.illinois.edu/ece391/)

~~~
kriro
I don't think you "should" use anything. There's plenty of x86/ARM/MIPS
projets out there. I applaud the fact that they went with something different.

Isn't building what you consider fun what hacking is all about? I think it's
healthy to completely ignore "usefulness" at times and doodle along :)

~~~
netcan
Also, if we're talking about theoretical "students," quality is often more
important than subject. Academics often recommend undergraduates "choose your
course by the teacher, not the subject." Same principle here, if they work on
something fun and they have fun, they will learn more.

------
gphilip
"Project XOS or eXperimental Operating System is a platform to develop a toy
operating system. It is an instructional tool for students to learn and
implement OS data structures and functionalities on a simulated machine called
XSM (eXperimental String Machine)."

XOS is used at the National Institute of Technology Calicut, India to teach
Operating System principles [0]. The OS Lab essentially consists of students
designing and implementing a kernel for XOS, starting from scratch:

"Cross compiler, debugger, file system interface and other supporting software
tools are provided. The student will implement the scheduler, memory
management, process management, exception handling and file system management
functions of the OS."

[0]
[http://athena.nitc.ac.in/~kmurali/os/index.html](http://athena.nitc.ac.in/~kmurali/os/index.html)

------
zerr
Enough for operating systems and compilers. I'm still waiting for some "Build
your own ACID compliant database system".

~~~
jmnicolas
You might want to look at the blog of H2 database author. He wrote 2 DB from
scratch.

~~~
zerr
Hm, not easy to find. Could you please share the link of that blog?

------
shaurz
Someone should tell them that the names "XFS" and "APL" are already taken.

------
jey
Most people enticed by this headline probably actually want xv6 (a modern
simple implementation of UNIX v6) or {buildroot, OpenEmbedded} (frameworks for
generating Linux distros).

------
Zardoz84
I think that a more simple machine were anyone can program it on assembly (and
eventually on C) could be better :

[https://github.com/trillek-team/trillek-computer](https://github.com/trillek-
team/trillek-computer)

[https://github.com/trillek-team/trillek-vcomputer-
module](https://github.com/trillek-team/trillek-vcomputer-module)

~~~
userbinator
That's the first "toy architecture" I've seen that attempts to define a PCI-
like plug-and-play scheme... and a set of device classes that are suspiciously
reminiscent of USB. :-)

What's really unique is the option to use Notch's DCPU-16 or a MIPS-like
TR3200 as the main processor. The whole system has a good "real computer"
feeling to it, which I think is especially important for educational use.

~~~
Zardoz84
_That 's the first "toy architecture" I've seen that attempts to define a PCI-
like plug-and-play scheme... and a set of device classes that are suspiciously
reminiscent of USB. :-) _

Yeah, it get details of both. Also, we did take a look to Amiga's autoconfig
and Z80 and 8086 interrupt handling schemes.

The TR3200 itself is inspired on MIPS and ARC (a simplified SPARC cpu for
using on computer architecture courses )

------
ay
On the topic of experimental OSes:

[https://github.com/ayourtch/ayos](https://github.com/ayourtch/ayos)

a little experiment of my own to see what happens if I put Lua on bare metal
(currently KVM-only) in x86_64 mode.

Lots of fun to toy with, though it does not do much yet.

~~~
fabriceleal
How are you handling libc? you have your own (or is this even an issue with
Lua)? I've been thinking of putting a Common Lisp implementation on bare metal
(initially thinking of SBCL, but I think MKCL may be a easier challenge), but
haven't found the time to start yet.

~~~
ay
I've grabbed the missing routines from musl libc (and culled some parts of the
Lua standard library for the sake of reducing the number of requirements, e.g.
io.*), and used venerable Doug Lea's malloc for memory allocations.

The stock Lua 5.1 has the least number of dependencies, so I picked it - the
idea is to practice and then to eventually have LuaJIT run on bare metal.

~~~
pjmlp
Good luck with it. You are on the path of having Smalltalk. :)

------
li-ch
Don't we already have Nachos for students?

[http://en.wikipedia.org/wiki/Not_Another_Completely_Heuristi...](http://en.wikipedia.org/wiki/Not_Another_Completely_Heuristic_Operating_System)

------
chpatrick
At my University (Imperial College London), our operating systems coursework
was built around a toy OS called Pintos
([http://en.wikipedia.org/wiki/Pintos](http://en.wikipedia.org/wiki/Pintos)),
which is written in assembly and C and runs on x86. The project was to fill in
the blanks in the implementation (more advanced scheduling, memory management,
swapping etc) and I think most people thought it was one of the most fun
projects we had. Being more realistic wasn't really a problem as the really
arcane parts were already implemented.

------
abhididdigi
This is nice. I'm going to try this out over the weekend. Thanks!

------
eli_gottlieb
Or you could just go pick up a series of JOS exercises like they do in every
operating-systems class ever.

