How good can an operating system be in Real Mode?

3.4k views Asked by At

There are real and unreal modes of x86 CPU, contrary to the protected mode. BIOS provides basic drivers to access hardware. Could those drivers be used by the OS?

Sure MS-DOS is that kind of OS, but it also has memory limit issue.

Wikipedia says that OS must be also in real mode to use BIOS drivers as BIOS is a real mode program. There is System Maintenance Mode as well, but is it connected to BIOS drivers?

The basic idea is to use BIOS drivers to have a extremely small OS. This is hobby of course (having your own small OS is just an exciting prospective).

Anyone can explain is that possible and can the whole memory also be accessed?

Real mode seem to be different from CPU to CPU, maybe latest processors provide more functions to this mode.

Most of OS are written in Protected mode, because Real Mode cannot do multitasking and separate privilege. But for me it is OK to have no multitask and no privilege, I am talking about hobby OS. What is important is to reuse BIOS drivers, because writing drivers is the most difficult part of OS development.

Multitasking can be "emulated" if the whole OS is interpreter-based.

So summarizing it, please analyze the possibility of writing the x86 Real Mode OS, in regards to disk, graphics, memory, CPU resources and overall.

2

There are 2 answers

0
johnfound On

As you already know DOS works in real mode. There are even GUI shells for DOS.

But the real mode is here only for compatibility purposes and it really misses almost all modern computer features. Nevertheless, some people successfully make real mode OSes - for example MikeOS.

On the other hand, working in protected mode is not so complex. There are many hobby OSes that use protected mode with success. Check for example Kolibri OS or DexOS

See some screenshots:

MikeOS: MikeOS

KolibriOS: Kolibri OS

DexOS: DexOS

0
Brian Knoblauch On

Back in the day, there were individual applications that used "DOS extenders". Those extenders would allow the app to run in protected mode, gaining access to all the resources there (primarily for memory, since you could do 32-bit processing in real mode already). There's no reason you couldn't use the same concept in your OS. Run your kernel in protected mode and bounce back down to real mode to access the BIOS. Sure, it has a performance impact, but we found it worthwhile way back in the day for a certain subset of problems. :-)