Import backup from 2005-11-01

This commit is contained in:
josh committed 2017-07-25 22:23:51 -04:00
1 parent 79ca453f66
commit 7daa1c5336
3 files changed
+37 -18

No files matched your search

+20 -7
View File
@@ -89,10 +89,7 @@ segmented_start:
mov ecx, _rm_params ; put real mode params here (video mode etc...)
sub ecx, VIRT_OFFSET
mov eax, cr0
and eax, 0x7FFFFFFE ; leave PM
mov cr0, eax
jmp 0x0:0x5010 ; jump to rmmod
jmp 0xC0005010 ; jump to rmmod
;Next we enable paging with the first 4mb mapped 1:1 virtual:physical
; and with the 4mb starting at 0xC000_0000 mapped to the first 4mb physical.
@@ -191,12 +188,12 @@ idle_loop: ; system idle loop
gdtrbs32:
dw gdt_endbs32-gdtbs32-1
dd gdtbs32-VIRT_OFFSET
gdtbs32: ;null descriptor
gdtbs32: ; 0 = null descriptor
dd 0
dd 0
;a base of 0x4000_0000, when added to 0xC000_0000 will produce 0x0000_0000 physical before paging in effect
KERNEL_CODE_BS32 equ $-gdtbs32
KERNEL_CODE_BS32 equ $-gdtbs32 ; 8
db 0xff ;limit 7:0
db 0xff ;limit 15:8
db 0x00 ;base 7:0
@@ -206,7 +203,7 @@ KERNEL_CODE_BS32 equ $-gdtbs32
db 0xcf ;flags / limit 19:16
db 0x40 ;base 31:24
KERNEL_DATA_BS32 equ $-gdtbs32
KERNEL_DATA_BS32 equ $-gdtbs32 ; 16
db 0xff ;limit 7:0
db 0xff ;limit 15:8
db 0x00 ;base 7:0
@@ -216,6 +213,22 @@ KERNEL_DATA_BS32 equ $-gdtbs32
db 0xcf ;flags / limit 19:16
db 0x40 ;base 31:24
KERNEL_CODE_BS6_ equ $-gdtbs32 ; 24
dw 0xffff ;limit 15:0
dw 0x0000 ;base 15:0
db 0x00 ;base 23:16
db 0x9A ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A])
db 0x00 ;flags ([G][D/B][0][0]) / limit 19:16
db 0x00 ;base 31:24
KERNEL_DATA_BS16 equ $-gdtbs32 ; 32
dw 0xffff ;limit 15:0
dw 0x0000 ;base 15:0
db 0x00 ;base 23:16
db 0x92 ;access ([P][DPL][1][Executable][Direction/Conforming][Writable/Readable][A])
db 0x00 ;flags ([G][D/B][0][0]) / limit 19:16
db 0x00 ;base 31:24
gdt_endbs32:
%include "gdt.inc"
+6 -6
View File
@@ -6,11 +6,11 @@
gdtr:
dw gdt_end-gdt-1
dd GDT_V
gdt:
gdt: ; 0
dd 0
dd 0
KERNEL_CODE equ $-gdt
KERNEL_CODE equ $-gdt ; 8
dw 0xffff ;limit 15:0
dw 0x0000 ;base 15:0
db 0x00 ;base 23:16
@@ -18,7 +18,7 @@ KERNEL_CODE equ $-gdt
db 0xCF ;flags ([G][D/B][0][0]) / limit 19:16
db 0x00 ;base 31:24
KERNEL_DATA equ $-gdt
KERNEL_DATA equ $-gdt ; 16
dw 0xffff ;limit 15:0
dw 0x0000 ;base 15:0
db 0x00 ;base 23:16
@@ -27,7 +27,7 @@ KERNEL_DATA equ $-gdt
db 0x00 ;base 31:24
USER_CODE equ $-gdt
USER_CODE equ $-gdt ; 24
dw 0xffff ;limit 15:0
dw 0x0000 ;base 15:0
db 0x00 ;base 23:16
@@ -35,7 +35,7 @@ USER_CODE equ $-gdt
db 0xCF ;flags ([G][D/B][0][0]) / limit 19:16
db 0x00 ;base 31:24
USER_DATA equ $-gdt
USER_DATA equ $-gdt ; 32
dw 0xffff ;limit 15:0
dw 0x0000 ;base 15:0
db 0x00 ;base 23:16
@@ -43,7 +43,7 @@ USER_DATA equ $-gdt
db 0xCF ;flags ([G][D/B][0][0]) / limit 19:16
db 0x00 ;base 31:24
TSS0_SEG equ $-gdt
TSS0_SEG equ $-gdt ; 40
dw 0x67 ;limit 15:0
dw 0 ;base 15:0
db 0 ;base 23:16