Commit 781eab06 by malcolm

More attempted fixes

parent ed95d5f7
Showing with 38 additions and 3 deletions
......@@ -114,7 +114,21 @@ Main: ;main section
int 0x15
;; now to try protected mode...
cli
lgdt [gdt]
gdtr: dw 0
dd 0
setGdt:
xor eax, eax
mov ax, ds
shl eax, 4
add eax, gdt
;jp $
mov [gdtr + 2], eax
;jp $ ;
mov eax, gdt_end
;jp $
sub eax, gdt
mov [gdtr], ax
lgdt [gdtr]
mov eax, cr0
or al, 1
mov cr0, eax
......@@ -122,7 +136,6 @@ Main: ;main section
jmp 08h:PMain
gdt:
times 16 db 0
dw 0xffff ; segment limit
.src:
......@@ -137,8 +150,30 @@ gdt:
db 0x93 ; data access rights
dw 0
times 16 db 0
gdt_end:
;; .null: times 8 db 0
;; .code: dw 0x0400 ; limit (4MiB)
;; dw 0x0000 ; base 0-15
;; db 0x00 ; base 16-23
;; db 0x9A ; access byte
;; db 0xC0 ; flags/limit 16-19
;; db 0x04 ; base 24-31
;; .data: dw 0x0400
;; dw 0x0000
;; db 0x00
;; db 0x92
;; db 0xC0
;; db 0x08
;; .tss: dw 0x0400
;; dw 0x0000
;; db 0x00
;; db 0x89
;; db 0xC0
;; db 0x0C
PMain:
mov si, str1
call PrintStr
nop
nop
hlt
jp $
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment