gdt: dw 0
dw 0
db 0
db 0
db 0
db 0
;Linear data segment
LINEAR_SEL equ $-gdt
dw 0xFFFF
dw 0
db 0
db 0x92
db 0xCF
db 0
;code segment descriptor
SYS_CODE_SEL equ $-gdt
gdt1: dw 0xFFFF
dw 0
db 0
db 0x9A
db 0xCF
db 0
;data segment descriptor
gdt2: dw 0xFFFF
dw 0
db 0
db 0x92
db 0xCF
db 0
That's about it, this is the same code that is found in Alex F.'s pmode
tutorials. And I use the method he uses to set the bases of each
descriptor by placing the value of the current code segment (I think that's
what it does!) in the base field. However his code [ORG 0] and mine
[ORG 0x7c00] so I think setting the bases might be superflous, but, hell I
don't know what I'm doing
All I know is when I read the bochs's output
file it has every segment loaded with a selector with a base of 0 and a limit
of fffff, except that the CS is loaded with the code segment.
I was curious that even though I've set SS, I have never set the value of ESP
and I didn't know if that was important. Also if I needed local stack space for
assembly functions. I wouldn't think so because the function works fine if an
actual character is passed to it. But who knows.....Thanks once again everyone.
Carbon get some sleep! ;)
Thanx,
Nicole