Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

ROM-BIOS leaves ds and es limits beyond 64 KiB (Developers)

posted by bretjohn Homepage E-mail, Rio Rancho, NM, 30.10.2025, 16:49

> I just noticed that testing instructions like mov ax, [FFFF]
> and mov ax, [es:FFFF] do not cause a fault when I boot the
> physical Pentium 3 (686) machine into bootable lDebug. (You want to
> install intfaults before running such tests, to have the
> debugger catch these Real 86 Mode faults in case they do occur.) With cs,
> ss, or fs overrides the instruction does fault (int 0Ch for ss, int 0Dh
> else).
>
> If I boot using boot protocol msdos7 hda2 followed by
> q, which runs a Himem driver, then regardless of the involved
> segment the instruction does fault. (This is without an EMM that switches
> to Virtual 86 Mode, the machine is still in Real 86 Mode.)
>
> So I assume that the ROM-BIOS leaves ds and es limits in an "unreal mode"
> state of higher segment limits than the 64 KiB expected for Real 86 Mode.
> Did you know that this is done by some systems?

The way it works on the original 8086/8088 CPUs, which I think is what should be emulated by default, is obviously that it wouldn't generate a fault (the old CPU's didn't have segment faults). The issue is what byte ends up in AH when you do something like a MOV AX,[FFFFh]. Is it the byte at DS:[0000h] or the byte at the linear address one byte above DS:[FFFFh]. I believe it should be DS:[0000h], but am not 100% positive. I do know when you use high _segment_ numbers they roll over to zero so you can't access the HMA unless you enable A20 (which 8086/8088 CPU's didn't have, either).

 

Complete thread:

Back to the forum
Board view  Mix view
22789 Postings in 2123 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum