An Operating System.
Whew!  Only a couple of days lost to this.
Move boot splash stuff to pretty.c.


browse  log 



You can also use your local clone with git send-email.

Sun Feb 26 07:33:28 PST 2023


While I was goofing off Maxime Chevalier-Boisvert (she of Turing Drawings fame!) has gone and created UVM Virtual Machine ( uvmplatform.org ) which is pretty much perfect for what I want to do. It even has mouse. (I spent much of yesterday, Saturday, looking over various other OSes to see if I could figure out what I'm doing wrong in this one, I'm setting up IDT, enabling PIC, and configuring mouse, but still only zeroes on the screen. Oh well... Somebody Else's Problem now.)

I have been saved from writing an "OS" by the hand of God and maximecb. I'm very grateful. I only lost a few days to this what turned out to be side quest. Porting Joy to UVM seems like a fun task, or maybe I'll write a Forth? Or Scheme? ;P

God help me, I'm going to try to write an operating system.


An Operating System.

Status: evaporated vapor.

Tue Feb 21 10:52:38 PST 2023

I just ran through a bunch of the usual suspects: Minix, Zepher RTOS, even Hare/Helios, and there were problems. It's not worth ranting over.

The upshot of it all is that I find myself in the absurd position of attempting to write something like an OS for myself (mostly out of pique and a kind of stuborness.)

  • Simple
  • C because I do not want to deal with ASM, nor other HLs.
  • Simple
  • Targeting x86 even though I hate it because it's the path of least resistance. Eventually, at least RISC-V.
  • Simple
  • 64-bit? (Is it simpler than 32!? Why is that a hard question!!?)
  • Simple
  • Forthy until it can be Joyful
  • Pretty to look at.
  • Simple

It looks like following the garden path laid out by osdev.org will be a good way to start. I'd like to use a simpler C toolchain, but that might be harder to do (simplicity is multidimensional.)

Wed Feb 22 07:46:41 PST 2023

Soooo, I have a thing: it's bare metal (nothing in there but what we bring with us), 64 bit words, and I can draw (badly) to the screen. Mwoooo ha ha haaaaaaa!

I want to avoid learning anything about the x86 platform, the less I have to deal with the idiosyncracies of that damned thing the better, I've turned up my nose at 86 since '86. Heh.

I want to avoid writing C. Although I'm having a lovely time, I don't want to get into C, I want to kinda transcend it (if possible! Talk about hubris!?)

I want a Joy-based OS. Even if it's just a simple Forthy thing. I want pretty what-i-call "2.618 D" (as opposed to 2D and 3D) "voluminous" UI, and simplicity.

I've got to learn how to emit diagnosic info on the serial port, or whatever, trying to figure out the right way to write to the framebuffer by just poking around (pun intended) is going slowly. Because apparently I'm an idiot. (It can't be this hard?)

Then I guess drawing routines, once I know how to pixel and blit.

It's ironically amusing to be this excited about such an empty computer, but there you are. That's how allergic to complexity I've become in my dotage, eh?

There are two (three?) spaces to organize: 1) the RAM space of the machine: where does everything go? 2) the subjective perceptual space of the UI: "computers as theater". and 3) hardware perhipherals: what's the local bus service like?

Solar system metaphor:

  • CPU cores are suns
  • Hard drives are planets
  • Shell is a spaceship

#Current Directory Structure and Contents

├── GNUmakefile
├── README.md
├── image.iso
├── iso_root
│   ├── kernel.elf
│   ├── limine-cd-efi.bin
│   ├── limine-cd.bin
│   ├── limine.cfg
│   └── limine.sys
├── kernel.c
├── kernel.d
├── kernel.elf
├── kernel.o
├── limine.cfg
├── limine.h
├── linker.ld
└── log.txt


  • Manfred von Thun - Joy
  • Niklaus Wirth - Project Oberon
  • Brenda Laurel - "Computers as Theatre"
  • Scott McCloud - "Understanding Comics"
  • Ted Nelson - "Dream Machines"
  • Jef Raskin - "Humane Interface"
  • Leo Brodie - "Thinking Forth"


A single letter is 13x27 four by four is 25x53 2n-1 14 x 28

Fri Feb 24 08:44:43 PST 2023

Alrighty then.

I've got a tiny "kernel" that can draw to the screen. It's brittle and janky and doesn't do anything but throw up a splash screen and die, but it's mine and I love it.

I looked into talking to the mouse and it's either going to be really easy or a total shtshow. Maybe delay that?

Talking to the serial port shouldn't be that hard I hope. I suspect that talking to the PS/2 keyboard or USB whatever will be another thing that's either easy or terrible.

Part of this is building my own peripherals, so maybe just a single driver to talk to e.g. a Raspberry Pico? ("And then I don't care what you do.")

I guess the next thing to do is set up the GDT and IDT? Then a simple bump allocator? Set aside RAM for a virtual screen for double-buffering the display? Graphics routines? Song and dance routines?

Probably I should spend the morning cleaning up the code, before adding any more, eh?

Generating the font data depends on Imagemagick and Python PIL (Pillow. RIP effbot!) so that's a bit of technical dept that will take a long time to pay off. (What i mean is, it will be a while before Ghm can self-host the font data generation facility, eh?)

BTW I'm not actually some contradidactic jackass. I'm only pretending. I do kinda know what I'm doing, a little, and I'm willing to learn (and having fun doing it!) I just don't want to get off on side-quests and forget to make progress on the main.

Sat Feb 25 08:05:01 PST 2023

So there are a lot of these OSes out there. The ones I'm looking at include:

They're all based off of the limine skeleton, and most of them seem to use more or less the same code, just changing the organization of the surrounding machinery and sometimes the names. I've cribbed off of a couple of them, and in turn they have cribbed off of the code posted to OsDev, but I should keep a little better track of exactly which code i'm Frankensteining into this monster, eh? It's all GPL or MIT or whatever, so it's more-or-less fine. And as I say the original bits that do the actual work all seem to stem from the code posted to OsDev, like Sanik's mouse code.

In any event, I set up an IDT, I have something called the PIC (prog int cont) set up, and the mouse activation code is in there too. I'm polling the mouse and drawing the coords to the screen via the lumine terminal for now (because it respects '\r' so I can overwrite the same location rather than filling the screen. Neat!) However, it just prints zeroes. I believe this is because I am not setting up the PS/2 thingy, eh? Probably need that to talk to a PS/2 mouse, yeah? ;)

In any event, the kernel does not crash. "So I got that goin' for me, which is nice."

NanoShellOS in particular: compiled and ran under QEMU just fine; has working mouse support (and a pretty impressive GUI system as well!) so I know it can be done!