Lately I’ve been following this series on dev.to on writing your own OS from the ground up - it makes a nice change of pace from the web stuff I’ve been doing, from very near the top of abstractions to right down the bottom.

I did fall into one gotcha which I didn’t see it mentioned anywhere else on the web, so I thought I’d post it for the next person.

When you get to the point of switching to 32-bit protected mode and changing how text is output, the text is meant to appear at the top left (initially) of the VGA buffer.

If you’re running qemu with -nographic (i.e. in text mode), that doesn’t happen, even though the rest of it - the 16-bit real mode text - does come out. So your code can be working perfectly but you won’t see it. Hopefully that’ll save someone a day’s worth of debugging...

I’ve actually found Bochs is better for the really low-level debugging (of boot-sector code etc). I haven’t got a good way to debug “kernel” stuff yet, but Bochs does have a means to output to it’s console from inside the running code. I’ll let you know if I figure that out!