IRC channel logs

2023-07-22.log

back to list of logs

<muurkha>thinking about kerravon's PDOS and multitasking, I wrote an operating system the other night called Einkornix that does *only* multitasking. no filesystem, memory management, booting, memory protection, shell, preemption, or networking
<muurkha>it's 96 bytes: http://canonical.org/~kragen/sw/dev3/einkornix.h
<muurkha>I also wrote a cut-down version called Monokokko which doesn't support creating or destroying tasks and uses a slightly nonstandard ABI in order to get better efficiency. the example application embedding it is 236 bytes: http://canonical.org/~kragen/sw/dev3/monokokko.S
<muurkha>the example programs here run inside a Linux process, so instead of doing I/O by banging on memory-mapped devices, they do it by making Linux system calls, which makes them easier to test
<muurkha>but my target platform is ARM microcontrollers
<muurkha>the task switching in Einkornix is 24 bytes of code in 8 Thumb-2 instructions. The more compact version in Monokokko is 5 instructions and 20 bytes
<muurkha>somewhat annoyingly, -gnodir has been removed from GCC sometime in the last 30 years, so the size of the executables you get if you build them with the Makefile in that directory depends on the name of the directory you build them in
<muurkha>this is my first operating system
<muurkha>I think the big difficulties with multitasking are typically memory protection, stability under load, and deadlock, and none of those are addressed here
<muurkha>but I also feel like 8 instructions of assembly is pretty approachable