Browse Source

better

pull/2/head
Jakob Kjær-Kammersgaard 7 years ago
parent
commit
7b2996afaf
  1. 20
      go32bit.nasm

20
go32bit.nasm

@ -1,5 +1,6 @@
; %define GDT 0xfe00
%define GDT_Paragraph 0x1000
%define GDT (GDT_Paragraph*16)
%define GDT_CodeSegIndex 1
%define GDT_DataSegIndex 2
%define GDT_Selector(DescriptorIndex, TableIndicator, RequestorPrivLevel) ((DescriptorIndex << 3) | ((TableIndicator & 1) << 2) | (RequestorPrivLevel & 0x3))
@ -177,7 +178,7 @@ Go32Bit:
;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Global Descriptor Table ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov ax, 0x1000
mov ax, GDT_Paragraph
mov es, ax
mov cx, 1024
lea si, [GO32_COPY_BEGIN]
@ -213,7 +214,7 @@ ClearPrefetchQueue:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
db 0x66 ; 32bit override
db 0xea ; Long jump
dd 0x1000*16 + 512 ; Absolute address
dd ProtectedModeBaby ; Absolute address
dw GDT_CodeSegmentSelector ; Descriptor Selector
GDT_Record:
@ -222,15 +223,14 @@ GDT_Record:
align 512
GO32_COPY_BEGIN:
segment Go32Bit vstart=(0x1000*16)
BITS 32
GDT:
.null_selector: dq 0
.code_selector: dq 0
.data_selector: dq 0
align 512
GO32_COPY_BEGIN:
segment Go32Bit vstart=GDT
GDT_SPACE: times 3 dq 0
ProtectedModeBaby:
; Update Other Segments

Loading…
Cancel
Save