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 ...
Stephen Kitt's user avatar
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 ...
Stephen Kitt's user avatar
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 ...
mcleod_ideafix's user avatar
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 ...
Peter Cordes's user avatar
  • 3,197
27 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 ...
davidbak's user avatar
  • 6,249
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 ...
user3840170's user avatar
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 ...
Stephen Kitt's user avatar
16 votes

The move to protected mode on x86

Where became protected mode the norm and real mode something for old people with fond memories? I think the answer to that question is with the 80386. Protected mode on the 286 had some issues in ...
JeremyP's user avatar
  • 11.6k
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 ...
Stephen Kitt's user avatar
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 ...
knol's user avatar
  • 11.9k
9 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 ...
Justme's user avatar
  • 30.4k
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 ...
tuomas's user avatar
  • 2,763
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. ...
Rico Pajarola's user avatar
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 ...
Spektre's user avatar
  • 7,268
6 votes

The move to protected mode on x86

But where was this step really done? Where became protected mode the norm and real mode something for old people with fond memories? My understanding is it was a gradual transition, spanning a decade....
Peter Green's user avatar
  • 2,884
6 votes

The move to protected mode on x86

A major weakness of the 80286 was the fact that most programs were limited to having two general-purpose segment registers loaded at a time. This was adequate if one wanted to copy a range of data ...
supercat's user avatar
  • 35.7k
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 ...
Stephen Kitt's user avatar
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 ...
Justme's user avatar
  • 30.4k
3 votes

The move to protected mode on x86

Early versions of OS/2 and SCO Xenix (Unix like system for PC) supported 286. Sometime after the 386 was released, Microsoft switched to Windows NT while IBM continued with later versions of OS/2. ...
rcgldr's user avatar
  • 631
2 votes

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:...
Mark Morgan Lloyd's user avatar
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 ...
supercat's user avatar
  • 35.7k
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 ...
rcgldr's user avatar
  • 631
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 ...
roentgen's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible