Skip to main content
Mod Moved Comments To Chat
Address the rephrased second point.
Source Link
Stephen Kitt
  • 131k
  • 19
  • 543
  • 502
  1. Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access to all the system’s address space up to just over 1 MiB (1 MiB strictly before the 286). You can write programs without paying attention to segments, and you’ll be limited to 64 KiB per segment register, but nothing enforces that; this is the memory model used by default for COM programs under DOS (with the additional constraint that all segment registers point to the same segment). There’s no practical distinction between “real mode flat model” and “real mode segmented model”.

    In “real mode flat model” as described in the document you’re referring to, all the above remains true: there is no limitation imposed by the architecture. Programs are written voluntarily without ever touching the segment registers, which means that they only have direct access to 64 KiB per segment register; as mentioned above, this is the model used by default in COM programs under DOS, and facilitates porting programs from 8-bit platforms. Programs always end up accessing other segments, indirectly, through operating system or BIOS services; for example when reading or writing files, or reading from the keyboard buffer, or writing to the screen. And nothing prevents programs from changing their segment registers and accessing other segments directly. When the operating system (DOS) starts a program, it gives it its own segments, separate from the operating system’s memory areas (and in systems with small amounts of memory, the program might not really have access to the full 64 KiB).

    Basically, the architecture doesn’t impose any limitations on the use of segments (that’s why protected mode was added, later).

  2. The 8086, 8088,/8088 and 80186/80188 CPUs only run in real, segmented mode. (Even if your program ignores segments, the CPU doesn’t.)

    The 80286 introduced 16-bit protected mode with a 24-bit address space. This protected mode is segmented; segment registers now point to segment descriptions, which specify the location of each segment in memory, and their length, access permissions etc. Segments are necessary to take advantage of the protection provided by protected mode. 

    The 80386 introduced 32-bit protected mode, which stillalso relies on segments (butsegments; however the availability of 32-bit addresses means that segments can provide directbe configured to give access to all 4 GiB GiB of address space, so programs can again be written without taking much account of segments (and this is what most people refer to as “flat mode”). The 386 also introduced paging, which allows memory protection to be implemented without relying on segments (once the segments are configured appropriately).

    Newer CPUs support all the modes available in older CPUs.

  3. Up to Windows 3.0 included, Windows could run in real mode, using segments. Windows/386, Windows 3.0 and later could also run in protected mode, on 286s (Windows 3.0) and 386s. Windows NT, Windows 95 and all subsequent versions of Windows run in 32-bit protected mode. MS-DOS always ran in real mode; there were several DOS extenders which allowed programs to run in protected mode on top of DOS, such as DOS/4GW.

    16- and 32-bit x86 protected mode still relies heavily on segments; like real mode, protected mode is always segmented. It’s possible to give the appearance of a flat mode in 32-bit protected mode, with segments set to cover all the address space, and that’s how most 32-bit operating systems work; instead of using segments to separate programs from each other, they rely on paging.

  1. Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access to all the system’s address space up to just over 1 MiB (1 MiB strictly before the 286). You can write programs without paying attention to segments, and you’ll be limited to 64 KiB per segment register, but nothing enforces that; this is the memory model used by default for COM programs under DOS (with the additional constraint that all segment registers point to the same segment). There’s no practical distinction between “real mode flat model” and “real mode segmented model”.

    In “real mode flat model” as described in the document you’re referring to, all the above remains true: there is no limitation imposed by the architecture. Programs are written voluntarily without ever touching the segment registers, which means that they only have direct access to 64 KiB per segment register; as mentioned above, this is the model used by default in COM programs under DOS, and facilitates porting programs from 8-bit platforms. Programs always end up accessing other segments, indirectly, through operating system or BIOS services; for example when reading or writing files, or reading from the keyboard buffer, or writing to the screen. And nothing prevents programs from changing their segment registers and accessing other segments directly. When the operating system (DOS) starts a program, it gives it its own segments, separate from the operating system’s memory areas (and in systems with small amounts of memory, the program might not really have access to the full 64 KiB).

    Basically, the architecture doesn’t impose any limitations on the use of segments (that’s why protected mode was added, later).

  2. The 8086, 8088, and 80186 CPUs only run in real mode. The 80286 introduced 16-bit protected mode with a 24-bit address space. The 80386 introduced 32-bit protected mode, which still relies on segments (but segments can provide direct access to all 4 GiB of address space). Newer CPUs support all the modes available in older CPUs.

  3. Up to Windows 3.0 included, Windows could run in real mode, using segments. Windows/386, Windows 3.0 and later could also run in protected mode, on 286s (Windows 3.0) and 386s. Windows NT, Windows 95 and all subsequent versions of Windows run in 32-bit protected mode. MS-DOS always ran in real mode; there were several DOS extenders which allowed programs to run in protected mode on top of DOS, such as DOS/4GW.

    16- and 32-bit x86 protected mode still relies heavily on segments; like real mode, protected mode is always segmented. It’s possible to give the appearance of a flat mode in 32-bit protected mode, with segments set to cover all the address space, and that’s how most 32-bit operating systems work; instead of using segments to separate programs from each other, they rely on paging.

  1. Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access to all the system’s address space up to just over 1 MiB (1 MiB strictly before the 286). You can write programs without paying attention to segments, and you’ll be limited to 64 KiB per segment register, but nothing enforces that; this is the memory model used by default for COM programs under DOS (with the additional constraint that all segment registers point to the same segment). There’s no practical distinction between “real mode flat model” and “real mode segmented model”.

    In “real mode flat model” as described in the document you’re referring to, all the above remains true: there is no limitation imposed by the architecture. Programs are written voluntarily without ever touching the segment registers, which means that they only have direct access to 64 KiB per segment register; as mentioned above, this is the model used by default in COM programs under DOS, and facilitates porting programs from 8-bit platforms. Programs always end up accessing other segments, indirectly, through operating system or BIOS services; for example when reading or writing files, or reading from the keyboard buffer, or writing to the screen. And nothing prevents programs from changing their segment registers and accessing other segments directly. When the operating system (DOS) starts a program, it gives it its own segments, separate from the operating system’s memory areas (and in systems with small amounts of memory, the program might not really have access to the full 64 KiB).

    Basically, the architecture doesn’t impose any limitations on the use of segments (that’s why protected mode was added, later).

  2. The 8086/8088 and 80186/80188 CPUs only run in real, segmented mode. (Even if your program ignores segments, the CPU doesn’t.)

    The 80286 introduced 16-bit protected mode with a 24-bit address space. This protected mode is segmented; segment registers now point to segment descriptions, which specify the location of each segment in memory, and their length, access permissions etc. Segments are necessary to take advantage of the protection provided by protected mode. 

    The 80386 introduced 32-bit protected mode, which also relies on segments; however the availability of 32-bit addresses means that segments can be configured to give access to all 4 GiB of address space, so programs can again be written without taking much account of segments (and this is what most people refer to as “flat mode”). The 386 also introduced paging, which allows memory protection to be implemented without relying on segments (once the segments are configured appropriately).

    Newer CPUs support all the modes available in older CPUs.

  3. Up to Windows 3.0 included, Windows could run in real mode, using segments. Windows/386, Windows 3.0 and later could also run in protected mode, on 286s (Windows 3.0) and 386s. Windows NT, Windows 95 and all subsequent versions of Windows run in 32-bit protected mode. MS-DOS always ran in real mode; there were several DOS extenders which allowed programs to run in protected mode on top of DOS, such as DOS/4GW.

    16- and 32-bit x86 protected mode still relies heavily on segments; like real mode, protected mode is always segmented. It’s possible to give the appearance of a flat mode in 32-bit protected mode, with segments set to cover all the address space, and that’s how most 32-bit operating systems work; instead of using segments to separate programs from each other, they rely on paging.

Clarify segments in protected mode.
Source Link
Stephen Kitt
  • 131k
  • 19
  • 543
  • 502
  1. Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access to all the system’s address space up to just over 1 MiB (1 MiB strictly before the 286). You can write programs without paying attention to segments, and you’ll be limited to 64 KiB per segment register, but nothing enforces that; this is the memory model used by default for COM programs under DOS (with the additional constraint that all segment registers point to the same segment). There’s no practical distinction between “real mode flat model” and “real mode segmented model”.

    In “real mode flat model” as described in the document you’re referring to, all the above remains true: there is no limitation imposed by the architecture. Programs are written voluntarily without ever touching the segment registers, which means that they only have direct access to 64 KiB per segment register; as mentioned above, this is the model used by default in COM programs under DOS, and facilitates porting programs from 8-bit platforms. Programs always end up accessing other segments, indirectly, through operating system or BIOS services; for example when reading or writing files, or reading from the keyboard buffer, or writing to the screen. And nothing prevents programs from changing their segment registers and accessing other segments directly. When the operating system (DOS) starts a program, it gives it its own segments, separate from the operating system’s memory areas (and in systems with small amounts of memory, the program might not really have access to the full 64 KiB).

    Basically, the architecture doesn’t impose any limitations on the use of segments (that’s why protected mode was added, later).

  2. The 8086, 8088, and 80186 CPUs only run in real mode. The 80286 introduced 16-bit protected mode with a 24-bit address space. The 80386 introduced 32-bit protected mode, which still relies on segments (but segments can provide direct access to all 4 GiB of address space). Newer CPUs support all the modes available in older CPUs.

  3. Up to Windows 3.0 included, Windows could run in real mode, using segments. Windows/386, Windows 3.0 and later could also run in protected mode, on 286s (Windows 3.0) and 386s. Windows NT, Windows 95 and all subsequent versions of Windows run in 32-bit protected mode. MS-DOS always ran in real mode; there were several DOS extenders which allowed programs to run in protected mode on top of DOS, such as DOS/4GW.

    16- and 32-bit x86 protected mode still relies heavily on segments; like real mode, protected mode is always segmented. It’s possible to give the appearance of a flat mode in 32-bit protected mode, with segments set to cover all the address space, and that’s how most 32-bit operating systems work; instead of using segments to separate programs from each other, they rely on paging.

  1. Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access to all the system’s address space up to just over 1 MiB (1 MiB strictly before the 286). You can write programs without paying attention to segments, and you’ll be limited to 64 KiB per segment register, but nothing enforces that; this is the memory model used by default for COM programs under DOS (with the additional constraint that all segment registers point to the same segment). There’s no practical distinction between “real mode flat model” and “real mode segmented model”.

    In “real mode flat model” as described in the document you’re referring to, all the above remains true: there is no limitation imposed by the architecture. Programs are written voluntarily without ever touching the segment registers, which means that they only have direct access to 64 KiB per segment register; as mentioned above, this is the model used by default in COM programs under DOS, and facilitates porting programs from 8-bit platforms. Programs always end up accessing other segments, indirectly, through operating system or BIOS services; for example when reading or writing files, or reading from the keyboard buffer, or writing to the screen. And nothing prevents programs from changing their segment registers and accessing other segments directly. When the operating system (DOS) starts a program, it gives it its own segments, separate from the operating system’s memory areas (and in systems with small amounts of memory, the program might not really have access to the full 64 KiB).

    Basically, the architecture doesn’t impose any limitations on the use of segments (that’s why protected mode was added, later).

  2. The 8086, 8088, and 80186 CPUs only run in real mode. The 80286 introduced 16-bit protected mode with a 24-bit address space. The 80386 introduced 32-bit protected mode, which still relies on segments (but segments can provide direct access to all 4 GiB of address space). Newer CPUs support all the modes available in older CPUs.

  3. Up to Windows 3.0 included, Windows could run in real mode, using segments. Windows/386, Windows 3.0 and later could also run in protected mode, on 286s (Windows 3.0) and 386s. Windows NT, Windows 95 and all subsequent versions of Windows run in 32-bit protected mode. MS-DOS always ran in real mode; there were several DOS extenders which allowed programs to run in protected mode on top of DOS, such as DOS/4GW.

  1. Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access to all the system’s address space up to just over 1 MiB (1 MiB strictly before the 286). You can write programs without paying attention to segments, and you’ll be limited to 64 KiB per segment register, but nothing enforces that; this is the memory model used by default for COM programs under DOS (with the additional constraint that all segment registers point to the same segment). There’s no practical distinction between “real mode flat model” and “real mode segmented model”.

    In “real mode flat model” as described in the document you’re referring to, all the above remains true: there is no limitation imposed by the architecture. Programs are written voluntarily without ever touching the segment registers, which means that they only have direct access to 64 KiB per segment register; as mentioned above, this is the model used by default in COM programs under DOS, and facilitates porting programs from 8-bit platforms. Programs always end up accessing other segments, indirectly, through operating system or BIOS services; for example when reading or writing files, or reading from the keyboard buffer, or writing to the screen. And nothing prevents programs from changing their segment registers and accessing other segments directly. When the operating system (DOS) starts a program, it gives it its own segments, separate from the operating system’s memory areas (and in systems with small amounts of memory, the program might not really have access to the full 64 KiB).

    Basically, the architecture doesn’t impose any limitations on the use of segments (that’s why protected mode was added, later).

  2. The 8086, 8088, and 80186 CPUs only run in real mode. The 80286 introduced 16-bit protected mode with a 24-bit address space. The 80386 introduced 32-bit protected mode, which still relies on segments (but segments can provide direct access to all 4 GiB of address space). Newer CPUs support all the modes available in older CPUs.

  3. Up to Windows 3.0 included, Windows could run in real mode, using segments. Windows/386, Windows 3.0 and later could also run in protected mode, on 286s (Windows 3.0) and 386s. Windows NT, Windows 95 and all subsequent versions of Windows run in 32-bit protected mode. MS-DOS always ran in real mode; there were several DOS extenders which allowed programs to run in protected mode on top of DOS, such as DOS/4GW.

    16- and 32-bit x86 protected mode still relies heavily on segments; like real mode, protected mode is always segmented. It’s possible to give the appearance of a flat mode in 32-bit protected mode, with segments set to cover all the address space, and that’s how most 32-bit operating systems work; instead of using segments to separate programs from each other, they rely on paging.

Address tofro’s comment, describe memory models.
Source Link
Stephen Kitt
  • 131k
  • 19
  • 543
  • 502
  1. Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access to all the system’s address space up to just over 1 MiB (1 MiB strictly before the 286). You can write programs without paying attention to segments, and you’ll be limited to 64 KiB per segment register, but nothing enforces that; this is the memory model used by default for COM programs under DOS (with the additional constraint that all segment registers point to the same segment). There’s no practical distinction between “real mode flat model” and “real mode segmented model”.

    In “real mode flat model” as described in the document you’re referring to, all the above remains true: there is no limitation imposed by the architecture. Programs are written voluntarily without ever touching the segment registers, which means that they only have direct access to 64 KiB;KiB per segment register; as mentioned above, this is the model used by default in COM programs under DOS, and facilitates porting programs from 8-bit platforms. Programs always end up accessing other segments, indirectly, through operating system or BIOS services; for example when reading or writing files, or reading from the keyboard buffer, or writing to the screen. And nothing prevents programs from changing their segment registers and accessing other segments directly. When the operating system (DOS) starts a program, it gives it its own segments, separate from the operating system’s memory areas (and in systems with small amounts of memory, the program might not really have access to the full 64 KiB).

    Basically, the architecture doesn’t impose any limitations on the use of segments (that’s why protected mode was added, later).

  2. The 8086, 8088, and 80186 CPUs only run in real mode. The 80286 introduced 16-bit protected mode with a 24-bit address space. The 80386 introduced 32-bit protected mode, which still relies on segments (but segments can provide direct access to all 4 GiB of address space). Newer CPUs support all the modes available in older CPUs.

  3. Up to Windows 3.0 included, Windows could run in real mode, using segments. Windows/386, Windows 3.0 and later could also run in protected mode, on 286s (Windows 3.0) and 386s. Windows NT, Windows 95 and all subsequent versions of Windows run in 32-bit protected mode. MS-DOS always ran in real mode; there were several DOS extenders which allowed programs to run in protected mode on top of DOS, such as DOS/4GW.

The different ways of using segments in real mode were given names, and most compilers offered the choice of different memory models:

  • tiny mode, with the same segment used for code, data and the stack (so 64 KiB for everything);
  • small mode, with one code segment, and one segment shared for data and the stack (so 64 KiB of code, and 64 KiB of data);
  • medium mode, with multiple code segments, and one segment shared for data and the stack (so more than 64 KiB of code, and 64 KiB of data);
  • compact mode, with a single code segment, and multiple data segments (so 64 KiB of code, and more than 64 KiB of data);
  • large mode, with multiple code and data segments (so more than 64 KiB of code and more than 64 KiB of data);
  • huge mode, same as large mode but with the ability to manipulate single objects larger than 64 KiB.
  1. Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access to all the system’s address space up to just over 1 MiB (1 MiB strictly before the 286). You can write programs without paying attention to segments, and you’ll be limited to 64 KiB, but nothing enforces that; this is the memory model used by default for COM programs under DOS. There’s no practical distinction between “real mode flat model” and “real mode segmented model”.

    In “real mode flat model” as described in the document you’re referring to, all the above remains true: there is no limitation imposed by the architecture. Programs are written voluntarily without ever touching the segment registers, which means that they only have direct access to 64 KiB; as mentioned above, this is the model used by default in COM programs under DOS, and facilitates porting programs from 8-bit platforms. Programs always end up accessing other segments, indirectly, through operating system or BIOS services; for example when reading or writing files, or reading from the keyboard buffer, or writing to the screen. And nothing prevents programs from changing their segment registers and accessing other segments directly. When the operating system (DOS) starts a program, it gives it its own segments, separate from the operating system’s memory areas (and in systems with small amounts of memory, the program might not really have access to the full 64 KiB).

    Basically, the architecture doesn’t impose any limitations on the use of segments (that’s why protected mode was added, later).

  2. The 8086, 8088, and 80186 CPUs only run in real mode. The 80286 introduced 16-bit protected mode with a 24-bit address space. The 80386 introduced 32-bit protected mode, which still relies on segments (but segments can provide direct access to all 4 GiB of address space). Newer CPUs support all the modes available in older CPUs.

  3. Up to Windows 3.0 included, Windows could run in real mode, using segments. Windows/386, Windows 3.0 and later could also run in protected mode, on 286s (Windows 3.0) and 386s. Windows NT, Windows 95 and all subsequent versions of Windows run in 32-bit protected mode. MS-DOS always ran in real mode; there were several DOS extenders which allowed programs to run in protected mode on top of DOS, such as DOS/4GW.

  1. Real mode is always segmented, and everything (CPU, operating system, programs, even peripherals on the CPU bus) has access to all the system’s address space up to just over 1 MiB (1 MiB strictly before the 286). You can write programs without paying attention to segments, and you’ll be limited to 64 KiB per segment register, but nothing enforces that; this is the memory model used by default for COM programs under DOS (with the additional constraint that all segment registers point to the same segment). There’s no practical distinction between “real mode flat model” and “real mode segmented model”.

    In “real mode flat model” as described in the document you’re referring to, all the above remains true: there is no limitation imposed by the architecture. Programs are written voluntarily without ever touching the segment registers, which means that they only have direct access to 64 KiB per segment register; as mentioned above, this is the model used by default in COM programs under DOS, and facilitates porting programs from 8-bit platforms. Programs always end up accessing other segments, indirectly, through operating system or BIOS services; for example when reading or writing files, or reading from the keyboard buffer, or writing to the screen. And nothing prevents programs from changing their segment registers and accessing other segments directly. When the operating system (DOS) starts a program, it gives it its own segments, separate from the operating system’s memory areas (and in systems with small amounts of memory, the program might not really have access to the full 64 KiB).

    Basically, the architecture doesn’t impose any limitations on the use of segments (that’s why protected mode was added, later).

  2. The 8086, 8088, and 80186 CPUs only run in real mode. The 80286 introduced 16-bit protected mode with a 24-bit address space. The 80386 introduced 32-bit protected mode, which still relies on segments (but segments can provide direct access to all 4 GiB of address space). Newer CPUs support all the modes available in older CPUs.

  3. Up to Windows 3.0 included, Windows could run in real mode, using segments. Windows/386, Windows 3.0 and later could also run in protected mode, on 286s (Windows 3.0) and 386s. Windows NT, Windows 95 and all subsequent versions of Windows run in 32-bit protected mode. MS-DOS always ran in real mode; there were several DOS extenders which allowed programs to run in protected mode on top of DOS, such as DOS/4GW.

The different ways of using segments in real mode were given names, and most compilers offered the choice of different memory models:

  • tiny mode, with the same segment used for code, data and the stack (so 64 KiB for everything);
  • small mode, with one code segment, and one segment shared for data and the stack (so 64 KiB of code, and 64 KiB of data);
  • medium mode, with multiple code segments, and one segment shared for data and the stack (so more than 64 KiB of code, and 64 KiB of data);
  • compact mode, with a single code segment, and multiple data segments (so 64 KiB of code, and more than 64 KiB of data);
  • large mode, with multiple code and data segments (so more than 64 KiB of code and more than 64 KiB of data);
  • huge mode, same as large mode but with the ability to manipulate single objects larger than 64 KiB.
Update based on the latest comments with the sources for the notion of real mode flat model.
Source Link
Stephen Kitt
  • 131k
  • 19
  • 543
  • 502
Loading
DOS/4GW.
Source Link
Stephen Kitt
  • 131k
  • 19
  • 543
  • 502
Loading
Address the comment.
Source Link
Stephen Kitt
  • 131k
  • 19
  • 543
  • 502
Loading
FRM, Windows/386.
Source Link
Stephen Kitt
  • 131k
  • 19
  • 543
  • 502
Loading
FRM, Windows/386.
Source Link
Stephen Kitt
  • 131k
  • 19
  • 543
  • 502
Loading
Source Link
Stephen Kitt
  • 131k
  • 19
  • 543
  • 502
Loading