8 Comments
User's avatar
Anthony DeChiaro's avatar

Great writeup and what a lovely reminder of these old days! I had a similar curiosity of protected mode back around the same time, and ended up embarking on writing a very simplistic OS - I highly recommend it, if you have interest as there was a great deal I learned.

Expand full comment
Jason's avatar

In the sample code, you are setting the data_base_mid twice. Is this intended?

mov [code_base_mid], al

mov [data_base_mid], al

mov [code_base_high], ah

mov [data_base_mid], al

Expand full comment
Julio Merino's avatar

Thanks! Fixed now. Last-minute copy/paste error IIRC.

Expand full comment
Kilian Hekhuis's avatar

I see you conveniently skipped over VCPI, very wise :D.

Expand full comment
Julio Merino's avatar

Good thing I didn't know about it!

Expand full comment
DJ Delorie's avatar

FYI the reason I wrote my first dos extender (go32) was because the available ones at the time didn't support virtual memory, and compiling gcc wasn't possible on my 4Mb PC otherwise... necessity is indeed the mother of invention!

Expand full comment
Julio Merino's avatar

Thanks for chiming in! I'm curious: did you have to implement swapping as well? Or more generally, does any extender bother implementing it?

Expand full comment
DJ Delorie's avatar

I did - that was the whole point. There wasn't enough RAM to hold all of gcc, so I had to swap out unused parts of it to disk.

Expand full comment