I remember playing with Caldara OpenDOS and Concurrent DOS years ago, and it always seemed like it might be fun to make my own.
If you want nothing more than a filesystem and program loader, you can fit everything in 512 bytes: https://news.ycombinator.com/item?id=20569438
The original DOS boot sector was also a "filesystem and program loader", albeit one that wasn't able to do much other than find IO.SYS, load it, and run it.
I think the real hard thing would be writing a full BIOS for an 8086 from scratch, capable of running a real DOS. I also wanted to do that, but...
The basic idea (which I think originated from FLEX[1]?) is that you have something that accepts typed commands, like "DIR A:", splits on spaces, takes the first part and loads the disk program called "DIR" (or "DIR.COM" etc) into memory and runs it, passing the rest of the parameters on the stack.
From that you can see you'll need a very basic filesystem (to load the command from), and a few system calls (eg. print a character, input a character, open a file, list the directory). The earlier DOSes like CP/M didn't have subdirectories, and only had a handful of system calls, so it was all very simple - by necessity because the hardware was limited.
You can expand on the idea endlessly, eg. writing lots of utilities, your own compiler and assembler, editor, etc.
Presto, you've got your own Disk Operating System!
There's a guy on YouTube you runs all these early proto-DOSes[2] on original hardware so you can get a sense of the extreme limitations of these early home computers.
I've had fun updating the shell, and code, of CP/M, in assembly, and writing emulators of it. But as always there is no shortage of programs making specific assumptions that make everything more complex than they should be.
https://www.amazon.com/Dissecting-DOS-Code-Level-Operating-S...
And i've seen it 1998/1999 as i remember.
In that sense DOS programs run without any guard rails. Video memory is just a memory address where you can throw data in and it shows up on screen, but it also means that any kind of memory pointer issue can write over almost anything in RAM. It was trial and error to ensure everything worked and seeing as machines were not always online, there was a much smaller risk of security issues being leveraged.
Come to think of it, maybe things aren't so different today -- if something goes wrong in your container/vm, many teams just wipe it and start from a clean snapshot
>Once I return to work and get approval to open up the source code, I’ll make the repo public as well.
Guess approval wasn't given?
[0]: https://archive.org/details/The_MS-DOS_Encyclopedia_Ray_Dunc...