Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How good can an operating system be in Real Mode?

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.

like image 613
exebook Avatar asked Nov 06 '13 07:11

exebook


People also ask

What is a real mode in operating system?

Real mode is characterized by a 20-bit segmented memory address space (giving 1 MB of addressable memory) and unlimited direct software access to all addressable memory, I/O addresses and peripheral hardware. Real mode provides no support for memory protection, multitasking, or code privilege levels.

Why is real mode used?

Real mode is an operating mode that enables the Intel 286 and newer processors to take on the attributes of the lower 8086 or 8088 processors, allowing them to run older software programs.

Is real mode 16 bit?

Real Mode is a simplistic 16-bit mode that is present on all x86 processors. Real Mode was the first x86 mode design and was used by many early operating systems before the birth of Protected Mode. For compatibility purposes, all x86 processors begin execution in Real Mode.

How protected mode is better than real mode?

The advantages of protected mode (compared to real mode) are: Full access to all of the system's memory. There is no 1 MB limit in protected mode. Ability to multitask, meaning having the operating system manage the execution of multiple programs simultaneously.


2 Answers

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

like image 123
johnfound Avatar answered Oct 10 '22 11:10

johnfound


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. :-)

like image 36
Brian Knoblauch Avatar answered Oct 10 '22 10:10

Brian Knoblauch