This is a toy, monotasking, self-hosted operating system for the Arduino Due (ARM-v7M microcontroller, 96KB RAM, 512KB flash), in less than 3300 lines, for educational purposes(*). It is made of:
- a boot loader (~70 lines)
- a monolithic kernel with 3 drivers, a file system, and 10 system calls (~1080 lines)
- a small, statically typed, C-like compiler with only unsigned 32-bit ints and struct pointers (~1330 lines)
- a text editor (~220 lines), a shell (~230 lines), and 5 commands (ls, cp, rm, etc -- ~200 lines)
Links:
- book: https://ebruneton.github.io/toypc/toypc.pdf
- companion website: https://ebruneton.github.io/toypc/
- emulator: https://ebruneton.github.io/toypc/emula ... /final.txt
- source code: https://ebruneton.github.io/toypc/toys.zip
(*) the goal is not to teach how to write an OS. Instead, it is to introduce this topic via a practical example.
Announcing the "Toys" operating system
Re: Announcing the "Toys" operating system
It's good to see OSs for embedded hardware, I'm thinking of going that way myself. I sketched out a plan for an OS on a board with just 16KB RAM the other day, but that might be too small. The planning centered around using a Forth block scheme for virtual memory, but I doubt SD-card write speeds are fast enough for my taste.
It's interesting to see Toys clear the screen before running each command. I was just planning a script window in place of the command line for my larger OS, trying to decide whether or not it should clear after every run.
It's interesting to see Toys clear the screen before running each command. I was just planning a script window in place of the command line for my larger OS, trying to decide whether or not it should clear after every run.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie