On Reinventing the Wheel
I have my little 68030 computer I built and I have my crude little kernel that lets the computer run BASIC for up to 8 users at the same time.
But wouldn't it be great if those users could do more than just type in small programs to watch an endless stream of HELLORLD fill the screen? You know ... silly things like print words on paper or, I don't know, save to a disk, maybe?
It would be great. I would love to be able to do that.
I'm not there yet.
See, I only have the one serial printer, so I really need some way to share it among the 8 users. Perhaps when a user wants to print something I could hold it in memory until the printer is free. I could print a page for one user, then move on to the next in queue so that everyone gets their turn at using the printer.
... I may have just reinvented the print spooler.
But that sounds like it would be difficult to add as a state machine to my kernel, and it would only make it more difficult to add other features later. It would be so much easier if I could just run this print spooler as if it were another user, just like I'm doing with BASIC.
... I may have just reinvented background processes.
If I'm running my print spooler program as a user-level process, then I could take advantage of the kernel function call I already have for writing data to a serial port. Oh, but I don't want to give up one of my 8 terminals; I would much prefer to use one of the two 6850 UARTs I had on the main board. I would need to update that kernel call to use the 6850 register set when the print spooler prices needs to send data, but still use the 16550 register set when the user programs need to send data. Perhaps I could just standardize the parameters and return values for the transmit/receive functions for the different devices and have the kernel call the right one based on what the process needs.
... I may have just reinvented device drivers.
Oh you know I bet I could do something very similar for reading & writing files. I could have a kernel function call for reading or writing a sector on the disk, but have another process that does the hard work of interpreting the disk data as the files requested by the user programs.
... I may have just reinvented the user-level file system driver.
I am absolutely reinventing the wheel. Every step of the way, every problem I come across is a solved problem. The Dartmouth Time Sharing System was doing all this with BASIC on a single computer 60 years ago, and it wasn't the first to try sharing a computer like this.
So yes, I am reinventing the wheel ... but I understand why it's round. I understand why the axel connects to the center of it. I understand why it must be able to spin independently of the cart.
Every step I take down this road, every solved problem I solve again helps me to understand why we do things the way we do. I have spent hours poring over the source code for Unix, for NetBSD, for Linux, Minix, Fuzix, DOS, CP/M, and others. Compared to what I have built, these are all massive, hugely complex beasts of programs that break my brain to try to understand.
But each time I reinvent the wheel I understand just a little bit more about how these existing systems work. I understand a little more about the problems the original programmers were trying to solve and the problems they faced, and I understand a little bit more about why they chose to build things the way they did.
And that is why I do this.








