37
votes
How does the ‘real mode flat model’ work?
I’m assuming you’re asking about x86 processors, not the older 8-bit CPUs.
Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access ...
35
votes
Accepted
How much slower was the 286 in protected mode?
Basically, anything that involves changing segments is slower, sometimes significantly so; this is unsurprising since descriptors have to be checked, privilege levels potentially changed etc. Other ...
29
votes
80286 can switch from real mode to protected mode - but why not back?
My guess is that it was merely a design decision based upon the assumption that once a protected mode OS is started, there is no need to go back. Most microprocessors at that time already booted in ...
28
votes
Accepted
How can a 32-bit x86 CPU start with reset vector 0xFFFFFFF0 even though it starts in 16-bit real mode?
When x86 boots, it's not strictly in classic real mode, it's in "unreal" mode, with CS.base = 0xFFFF0000 and CS.limit = 64K.
On 286 and later, memory addressing doesn't use the segment ...
26
votes
Accepted
80286 can switch from real mode to protected mode - but why not back?
This was intentional so that the CPU would support secure operating systems. In a secure operating system with rigorous memory access protections you could not allow any software - user or kernel ...
24
votes
Accepted
How can a protected-mode Watcom C program access memory that a real-mode interrupt service returned in a segment:offset register pair?
In OpenWatcom, which was used in the example given in the question, the intr function performs transparent translation between segment values and protected-mode selectors, presumably using DPMI ...
20
votes
Accepted
Are .COM executable binaries real mode or protected mode?
DOS programs always start in real mode (or an emulation thereof), so it’s best to start disassembling them assuming that. When disassembling, you should assume real mode, with 16-bit data and 16-bit ...
16
votes
How can a 32-bit x86 CPU start with reset vector 0xFFFFFFF0 even though it starts in 16-bit real mode?
To understand this, you need to understand the basics of segment:offset addressing in protected mode: the segment value points to a descriptor, which contains a base address, segment limit and various ...
10
votes
How can a protected-mode Watcom C program access memory that a real-mode interrupt service returned in a segment:offset register pair?
I've accepted user3840170's answer as it solved my issue but I want to add a second answer that contains just the concepts that I lacked in order to solve my problem:
The far keyword is still ...
9
votes
How does the ‘real mode flat model’ work?
All software sees the full 20bit address space, since there is no distinction between kernel and user land.
Flat mode is simply all segment descriptors set to maximum length and base offset 0. This ...
8
votes
How can a 32-bit x86 CPU start with reset vector 0xFFFFFFF0 even though it starts in 16-bit real mode?
In short, yes the 386 will boot from 0xFFFFFFF0 address mentioned in real mode, because CS selector base is set to 0xFFFF0000 and IP will be 0x0000FFF0. The value of the CS register itself is ...
7
votes
80286 can switch from real mode to protected mode - but why not back?
Just speculating here, but it might have been a product decision to encourage writing code for protected mode. It's also possible it was a combination of technical difficulties and product priorities.
...
7
votes
Are .COM executable binaries real mode or protected mode?
com files are not segmented (its just single segment). They have limitation that it can not cross 64K of code (filesize).
They always starts in real mode but I do not think there is any restriction to ...
6
votes
Accepted
8086 assembly relative addressing issue
As explained in Justme’s answer, there’s nothing inherently wrong with your code, and building a .COM file with
nasm -fbin -oloop.com loop.asm
produces a 29-byte file which works fine.
However there ...
4
votes
8086 assembly relative addressing issue
There is nothing inherently wrong in the source code.
Most likely explanation is that the NASM compiler was not told to output the binary in COM format and the memory offset of the variable which ...
2
votes
How does the ‘real mode flat model’ work?
I've not heard the phrase "real mode flat model", but it may be referring to the fact that real mode allows a memory manager to manage memory as a linear sequence of 65,536 16-byte paragraphs (of ...
2
votes
How does the ‘real mode flat model’ work?
There's one other legacy mode. On a 286, Windows 3.1 (possibly Windows 3.0), has a 286 protected mode, where GlobalAlloc() and GlobalLock() are used to allocate and lock a large amount of memory ...
1
vote
How can a 32-bit x86 CPU start with reset vector 0xFFFFFFF0 even though it starts in 16-bit real mode?
I'm putting this in as a separate answer since some people might disagree with my logic and it will give them a chance to downvote me.
If you're interested and have the time, I think you'll find https:...
1
vote
How does the ‘real mode flat model’ work?
"Flat model" is simply unsegmented linear address space (3.2.1).
https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3a-part-1-manual.pdf
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
real-mode × 7protected-mode × 4
x86 × 3
ms-dos × 2
80286 × 2
assembly × 1
programming × 1
intel × 1
performance × 1
8086 × 1
80386 × 1
books × 1
executables × 1
segmentation × 1
addressing × 1