my PC Reboots with this GDT..any ideas why?
GDTpointer:
GDTbase DD GDT
GDTlim DW ENDGDT-GDT
GDT:
NULLsel EQU $-GDT ;required
DD 0x00
DD 0x00
CODEsel EQU $-GDT
DW 0xFFFF
DW 0x00
DB 0x00
DB 0x9A
DB 0xCF
DB 0x00
DATAsel EQU $-GDT
DW 0xFFFF
DW 0x00
DB 0x00
DB 0x92
DB 0xCF
ENDGDT:
DB 0x00
GDT reboot
Re:GDT reboot
Well, I am very sure but you must set PHYSICAL address in GDTbase, are you exactly doing this by:
?
Code: Select all
GDTpointer:
GDTbase DD GDT
GDTlim DW ENDGDT-GDT
Re:GDT reboot
Hey I made a mistake I had miswritten I must have said "...I am NOT very sure..." instead of "I am very sure", sorry... ;D
Re:GDT reboot
actually the lmit comes before the base..that was my problem..thanks anyways
Re:GDT reboot
ok i got the GDT workin now but im having trouble trying to relocate it to 0x50:0x00:
any ideas why my PC reboots?
;--------------------------constants--------------------------
GDTpointer:
GDTlim DW ENDGDT-GDT
GDTbase DD 0x500
Selectors: ;used as offset from start of GDT
NULLsel EQU 0x0
CODEsel EQU 0x0008
DATAsel EQU 0x0010
;--------------------------gdt-------------------------------
GDT: ;flat memory model
;NULLsel ;required
DD 0x00
DD 0x00
;CODEsel
DW 0xFFFF
DW 0x00
DB 0x00
DB 0x9A
DB 0xCF
DB 0x00
;DATAsel
DW 0xFFFF
DW 0x00
DB 0x00
DB 0x92
DB 0xCF
ENDGDT:
DB 0x00
;------------------relocate gdt--------------------
mov AX, 0x50
mov ES, ax
mov DI, 0x00
mov SI, GDT
mov CX, 24
moveit:
movsb
INC DI
INC SI
loop moveit
lgdt [GDTpointer]
any ideas why my PC reboots?
;--------------------------constants--------------------------
GDTpointer:
GDTlim DW ENDGDT-GDT
GDTbase DD 0x500
Selectors: ;used as offset from start of GDT
NULLsel EQU 0x0
CODEsel EQU 0x0008
DATAsel EQU 0x0010
;--------------------------gdt-------------------------------
GDT: ;flat memory model
;NULLsel ;required
DD 0x00
DD 0x00
;CODEsel
DW 0xFFFF
DW 0x00
DB 0x00
DB 0x9A
DB 0xCF
DB 0x00
;DATAsel
DW 0xFFFF
DW 0x00
DB 0x00
DB 0x92
DB 0xCF
ENDGDT:
DB 0x00
;------------------relocate gdt--------------------
mov AX, 0x50
mov ES, ax
mov DI, 0x00
mov SI, GDT
mov CX, 24
moveit:
movsb
INC DI
INC SI
loop moveit
lgdt [GDTpointer]