Loading gdt
Posted: Sun Mar 22, 2020 6:57 pm
I've read tutorials on GDT several times but I can't find the problem.
Right after loading the GDT in protected mode when updating the ss register the system resets and restarts. (Along with the BochsDBG report, are the values of the sregs records loaded in LoaderStage2 in real mode.)
Can someone please help fix this problem?
the code can be found at <https://github.com/zecarlos1957/learnos>
Please need help
Right after loading the GDT in protected mode when updating the ss register the system resets and restarts. (Along with the BochsDBG report, are the values of the sregs records loaded in LoaderStage2 in real mode.)
Can someone please help fix this problem?
the code can be found at <https://github.com/zecarlos1957/learnos>
Please need help
Code: Select all
========================================================================
Bochs x86 Emulator 2.6.9
Built from SVN snapshot on April 9, 2017
Compiled on Apr 9 2017 at 09:49:25
========================================================================
00000000000i[ ] reading configuration from bochsrc.txt
00000000000e[ ] bochsrc.txt:737: ataX-master/slave CHS set to 0/0/0 - autodetection enabled
00000000000i[ ] installing win32 module as the Bochs GUI
00000000000i[ ] using log file bochsout.txt
Next at t=0
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0
<bochs:1> lb 0x103e70
<bochs:2> c
(0) Breakpoint 1, 0x0000000000103e70 in ?? ()
Next at t=112966319
(0) [0x000000103e70] 0008:0000000000103e70 (unk. ctxt): mov eax, dword ptr ss:[e
sp+4] ; 8b442404
<bochs:3> sreg
es:0x0010, dh=0x00cf9300, dl=0x0000ffff, valid=1
Data segment, base=0x00000000, limit=0xffffffff, Read/Write, Accessed
cs:0x0008, dh=0x00cf9b00, dl=0x0000ffff, valid=1
Code segment, base=0x00000000, limit=0xffffffff, Execute/Read, Non-Confo
rming, Accessed, 32-bit
ss:0x0010, dh=0x00cf9300, dl=0x0000ffff, valid=31
Data segment, base=0x00000000, limit=0xffffffff, Read/Write, Accessed
ds:0x0010, dh=0x00cf9300, dl=0x0000ffff, valid=31
Data segment, base=0x00000000, limit=0xffffffff, Read/Write, Accessed
fs:0x07c0, dh=0x00009300, dl=0x7c00ffff, valid=1
Data segment, base=0x00007c00, limit=0x0000ffff, Read/Write, Accessed
gs:0x07c0, dh=0x00009300, dl=0x7c00ffff, valid=1
Data segment, base=0x00007c00, limit=0x0000ffff, Read/Write, Accessed
ldtr:0x0000, dh=0x00008200, dl=0x0000ffff, valid=1
tr:0x0000, dh=0x00008b00, dl=0x0000ffff, valid=1
gdtr:base=0x00000000000005f3, limit=0x17
idtr:base=0x0000000000000000, limit=0x3ff
-------------------------------------------------------------------------------------------------------------------------------------------------
(0) [0x000000103e70] 0008:0000000000103e70 (unk. ctxt): mov eax, dword ptr ss:[esp+4] ; 8b442404
<bochs:4> s
Next at t=112966320
(0) [0x000000103e74] 0008:0000000000103e74 (unk. ctxt): lgdt ds:[eax] ; 0f0110
<bochs:5>
Next at t=112966321
(0) [0x000000103e77] 0008:0000000000103e77 (unk. ctxt): mov ax, 0x0010 ; 66b81000
<bochs:6>
Next at t=112966322
(0) [0x000000103e7b] 0008:0000000000103e7b (unk. ctxt): mov ds, ax ; 8ed8
<bochs:7>
Next at t=112966323
(0) [0x000000103e7d] 0008:0000000000103e7d (unk. ctxt): mov es, ax ; 8ec0
<bochs:8>
Next at t=112966324
(0) [0x000000103e7f] 0008:0000000000103e7f (unk. ctxt): mov fs, ax ; 8ee0
<bochs:9>
Next at t=112966325
(0) [0x000000103e81] 0008:0000000000103e81 (unk. ctxt): mov gs, ax ; 8ee8
<bochs:10>
Next at t=112966326
(0) [0x000000103e83] 0008:0000000000103e83 (unk. ctxt): mov ss, ax ; 8ed0
<bochs:11>
(0).[112966326] [0x000000103e83] 0008:0000000000103e83 (unk. ctxt): mov ss, ax ; 8ed0
Next at t=112966327
(0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0