I know the difference between a real mode and protected mode from the OS and hardware perspective.
But I am trying to figure out What does a program 'knows' about real mode or protected mode? how can you say while looking at an source code/object code that it is a real mode program or not?
Looking for an answer, All I could come up with is that a 'real mode' program uses BIOS subroutines along with OS subroutines whereas a 'protected mode' program uses only OS subroutines. instruction code differs since opcodes for registers are different and offset addresses are of different length. Is there any other feature that differentiates a real and protected mode program?
Real mode memory exists at locations 00000H-FFFFFH the first 1M byte of the memory system—and is present on all versions of the microprocessor. Protected mode memory exists at any location in the entire memory system, but is available only to the 80286—Pentium II, not to the earlier 8086 or 8088 microprocessors.
Files from the Internet and from other potentially unsafe locations can contain viruses, worms, or other kinds of malware that can harm your computer. To help protect your computer, files from these potentially unsafe locations are opened as read only or in Protected View.
Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs. The mode gets its name from the fact that addresses in real mode always correspond to real locations in memory.
The only data structure you need to switch from Real Mode to Protected Mode is GDT correctly set and loaded. Everything else (preparing IDT, loading TSS, reloading new GDT, etc.) is not strictly necessary to switch into Protected Mode. And you can accomplish these tasks when you are already in Protected Mode.
a 'real mode' program uses BIOS subroutines along with OS subroutines whereas a 'protected mode' program uses only OS subroutines.
instruction code differs since opcodes for registers are different and offset addresses are of different length.
The main difference is the mode the cpu is in. In protected mode the OS can use features like paging and virtual memory. Also real mode code is never in 32 bits whereas protected mode code can be 16 bits or 32 bits. Every x86 cpu starts in real mode and the OS must switch to protected mode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With