Hi,
I am running a FreeDos distro (from http://www.ibiblio.org/pub/micro/pc-stu ... lder10.img) in QEMU.
Then at run time, I look at its registers, and see something like below:
ES =00d1 00000d10 0000ffff 00000000
CS =f000 000f0000 0000ffff 00000000
SS =00d1 00000d10 0000ffff 00000000
DS =00d1 00000d10 0000ffff 00000000
FS =04bc 00004bc0 0000ffff 00000000
GS =13de 00013de0 0000ffff 00000000
LDT=0008 00003ca4 00000020 00008200 DPL=0 LDT
TR =0010 00110000 00002069 00008911 DPL=0 TSS32-avl
MSR.EFER=0000000000000000
SYSENTER_CS=00000000 SYSENTER_EIP=00000000 SYSENTER_ESP=00000000
GDT= 00003c24 0000007f
IDT= 00124784 000007ff
CR0=e0000011 CR2=00000000 CR3=00125000 CR4=00000000
CR0 tells us that the OS is in protected mode, with paging enable. GDT size is 0x80 (0x7F is its limit).
However, CS has segment selector as 0xF000, which is clearly outside the scope of GDT. This is so strange!
Knowing that the OS is in protected mode, how is that possible???
Any explanation for this case??
Thanks,
J
Segment selector points to outside of GDT??
Re: Segment selector points to outside of GDT??
FreeDOS is MSDOS compatible, and therefore runs in real mode. The only reason for running in protected mode is that there's a EMS driver loaded. The EMS driver runs in protected mode, and runs the rest of the OS in a virtual 8086 mode. So the value of CS you see is the value of a real mode segment.junkoi wrote:Any explanation for this case??
JAL