DEV Community

Phil Ashby
Phil Ashby

Posted on • Updated on

Everyone should write an operating system once

The saying goes: Try everything once except incest and folk dancing, which for me at the tender age of 25 included attempting to write my own x86 kernel, bootloader and a few hardware drivers. Yeah I was and still am slightly mad.

This self-education / masochism ate up many evenings and weekends from 1992-95 then languished on a backup tape for 25 years, until today. Be nice to me :)

[edit - moved to sourcehut]
https://git.sr.ht/~phlash/litetask

For anyone interested in following a similar path, I now recommend the OSDev Wiki, which would have really helped back in the day of almost no Internet!

Top comments (25)

Collapse
 
ben profile image
Ben Halpern

If I took on the project of building an OS I'd get a lot less fresh air and exercise, which is already lacking.

It's an appealing proposition in a bad way for me πŸ˜‹

Collapse
 
supunkavinda profile image
Supun Kavinda

You have already created a system called "DEV". And, now you are operating it. Operating System. 😎

Collapse
 
phlash profile image
Phil Ashby

Yeah, I was young and had no idea how much time I was committing to this. At the time I also had a Netware server under my bed for storage and two young children, with another four yet to arrive... at least having the server under the bed meant I couldn't work late, my wife insisted it was turned off at her bedtime (and rightly so!)

Collapse
 
bacloud22 profile image
aben

Good stuff, let me start by creating a web server on Raspberry Pi if I can first though πŸ˜‚πŸ˜­

Collapse
 
nestedsoftware profile image
Nested Software

I find it's often the case these days that I want to do something with a given tool, so I look up how to do that thing. I get the answer, and I can move on. Often I don't really understand why the specific syntax is the way it is, but if it works, that's all I need most of the time. I think in those days, that presented a huge difficulty, because you had to actually parse the documentation to figure out how to do the thing! I imagine a lot of the time, if someone could have told you, "oh, here's the format/syntax/structure you need," it would have been a lot less painful! I'm guessing a bit less fun if you're already the type inclined to that sort of thing though! :D

Collapse
 
phlash profile image
Phil Ashby

I'm definitely the sort of person that cannot use 'magic solutions', I need to know how stuff works, which is a curse in some ways as it can tarpit my progress on things, but I have coping mechanisms (like pomodoro) that can limit this effect, the upside is I'm a mine of useless technical trivia :D

Collapse
 
nestedsoftware profile image
Nested Software

I think these days we have to limit ourselves to define an interface between our work and some external system - I mean that in a very general way, e.g. the system could be a piece of math or science, not necessarily a computer API. I generally try to understand the principles behind things to the extent that I can, but there is just too much stuff out there, so I believe it's simply necessary nowadays to make a decision about how important it is know a given tool or concept in more depth...

Collapse
 
gabbersepp profile image
Josef Biehler

I have already done this. I think about 15 years ago.
A time without youtube and only a few resources in the internet.
I also would recommend it. You can learn so much.

github.com/gabbersepp/assembler/tr...

Collapse
 
phlash profile image
Phil Ashby

Nice - all in assembly too by the look of it!

Collapse
 
gabbersepp profile image
Josef Biehler

Yes most parts. I started with assembler and later I tried a bit c code. :-)

Collapse
 
raguay profile image
Richard Guay

When I designed my first computer in 8-9th grade (8085 based system with a huge 32 MB ram! Okay, I’m showing my age), I wrote the OS for it based on a TIL core. It worked okay until a voltage spike burned out the wire-wrapping in collage (I then learned about voltage regulators and why they are needful). Learning is about the β€œhard knocks”! An OS has lot’s of them!

Collapse
 
adityamitra profile image
Aditya Mitra

Yeah, we should develop an operating system once in our career. A software is a collection of codes but an OS is a collection of softwares.

Collapse
 
raguay profile image
Richard Guay

And then work on a language! Either interpreter or complier. Both teach a lot of software practices that are very useful.

Collapse
 
phlash profile image
Phil Ashby

In this case, it's only a kernel & bootloader, but there were intentions to go wider - I have enormous respect for people who get to a shippable, useful system (such as Beos, Plan9, Oberon).

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ

I've never quite gone that far, but I've written display drivers in the past for languages I was using that lacked support for some graphics modes

Collapse
 
phlash profile image
Phil Ashby

It's a slippery slope - I started with writing games.. a gateway drug to bare metal coding :D

Collapse
 
jonrandy profile image
Jon Randy πŸŽ–οΈ • Edited

I'm not sure what my parents knew what to think when I asked Santa for this for Christmas...

EGA/VGA A Programmers Refernce Guide

Collapse
 
fdrobidoux profile image
FΓ©lix Dion-Robidoux

This is what I call "Mad Science".

Collapse
 
bittnkr profile image
bittnkr

I would like to mention
includeos.org/
An OS built entirely in C++, by now focused on cloud computing and bootable in virtual machines. A very nice and promising project.

Collapse
 
phlash profile image
Phil Ashby

Ah, nice! A unikernel (aka library OS), which is pretty much what I was creating, inspired by things like VxWorks and FreeRTOS. There are mixed opinions on such things, I found this article well balanced:

hpe.com/us/en/insights/articles/wh...

Collapse
 
bittnkr profile image
bittnkr

Ahh... The power of youth with enough energy and to dare start from zero...

A modern version of your code, to mad guys, is Bare metal 64.
github.com/ReturnInfinity/BareMeta...
Pure X64 assembly, bootable in hardware, sized in kbs, and yet understandable.

Collapse
 
fultonbrowne profile image
Fulton Browne

I am going to try this very soon, thanks (I think I just heard my old raspi scream)

Collapse
 
phlash profile image
Phil Ashby

Saw the fork - have fun!

Collapse
 
faraazahmad profile image
Syed Faraaz Ahmad • Edited

What do you think of the series made by Philip Oppermann?

os.phil-opp.com/

Collapse
 
phlash profile image
Phil Ashby

I had a quick look last year, probably time to have another read, it's looking good at a glance!