16-bit protected mode
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
16-bit protected mode
Can anyone please tell me what exactly this 16-bit protected mode is? Please don't answer with something like "that sounds pointless" because I'm only asking out of curiosity... Intel docs don't say anything about this and I'm not even sure if it's something that 80286 CPUs had instead of the current 32-bit protected mode or a mode modern CPUs could still use (which would make sense, bause of compatibility issues). Any knowledge about this?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Well unreal mode is a switch to 32bit protected mode and back (once) using a special GDT. Thus, real mode no longer has the 64K segment limit. 16-bit protected mode is 16-bit protected mode, it's not unreal mode. In 16-bit protected mode you can address max. 16 MB of RAM (correct me if i'm wrong). For example Windows 2.0/286, Windows 3.0 and Windows 3.1 could run in 16-bit protected mode or real mode. And yes, pmode was in 80286 too, but slightly different from the 386 one.
I can post you some example asm code in TASM for setting the 16bit pmode back and forth (there wasn't a method how to switch back to real mode on 80286. That's why games for 80286 weren't in pmode [but it wasn't a big deal, since 80286's had ~1 MB RAM installed] - but later, the function how to exit pmode has been "exploited" by Windows.)
I can post you some example asm code in TASM for setting the 16bit pmode back and forth (there wasn't a method how to switch back to real mode on 80286. That's why games for 80286 weren't in pmode [but it wasn't a big deal, since 80286's had ~1 MB RAM installed] - but later, the function how to exit pmode has been "exploited" by Windows.)
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
short answer:
The 286 was the first CPU to feature protected mode - you could put it in that mode, and have process isolation based on segmentation. Since the 286 didn't feature 32-bit registers, the only option was to use 16-bit code and registers. A new register was added, the machine status word, which held the bit to enter protected mode.
in the 386, all registers became 32-bit. They renamed the 32-bit version of the machine status word to cr0. Then they added paging and 32-bit code and new addressing modes on top of the 16-bit versions present.
The current intel manuals are pretty vague about what protected-mode features were present on the 286, and which ones were added on the 386 and later, so I don't have the details on the modifications made to the GDT and IDT to allow for this upgrade. Most likely, parts of the GDT are ignored since IIRC the 286 only had a 24-bit address bus (16MB), while the 386 featured the full 32 bits (4GB)
But yes, 286 protected mode code should still work. The consensus however is to stay away from that infant version of protected mode and either require a 386 or use real or unreal mode (which is a completely different thing, note that unreal mode doesn't exist on a 286 as well)
long answer:pcmattman wrote:16-bit protected mode is PMode with 16-bit instructions (correct me if I'm wrong).
The 286 was the first CPU to feature protected mode - you could put it in that mode, and have process isolation based on segmentation. Since the 286 didn't feature 32-bit registers, the only option was to use 16-bit code and registers. A new register was added, the machine status word, which held the bit to enter protected mode.
in the 386, all registers became 32-bit. They renamed the 32-bit version of the machine status word to cr0. Then they added paging and 32-bit code and new addressing modes on top of the 16-bit versions present.
The current intel manuals are pretty vague about what protected-mode features were present on the 286, and which ones were added on the 386 and later, so I don't have the details on the modifications made to the GDT and IDT to allow for this upgrade. Most likely, parts of the GDT are ignored since IIRC the 286 only had a 24-bit address bus (16MB), while the 386 featured the full 32 bits (4GB)
But yes, 286 protected mode code should still work. The consensus however is to stay away from that infant version of protected mode and either require a 386 or use real or unreal mode (which is a completely different thing, note that unreal mode doesn't exist on a 286 as well)