From ed0f5cc05b8e4c9b6d2c4ab22a9556aa9be37a97 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 6 Aug 2021 22:26:57 +0200 Subject: [PATCH] GDT --- src/pm/gdt.asm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/pm/gdt.asm diff --git a/src/pm/gdt.asm b/src/pm/gdt.asm new file mode 100644 index 0000000..cfe2a75 --- /dev/null +++ b/src/pm/gdt.asm @@ -0,0 +1,20 @@ +; GDT + +gdt_start: + +gdt_null: ; NULL descriptor + dd 0x0 ; 4-bytes of + dd 0x0 ; 0x0 (0) = NULL + +gdt_code: ; Code SD + ; Range: 0x0 - 0xfffff + ; Flags1: 1001b (present:2 privilege:descriptor type) + ; Type: 1010b (code:conforming:readable:accessed) + ; Flags2: 1100b (granularity:32bit default:64bit seg:AVL) + + dw 0xffff ; Limit (bits 0-15) + dw 0x0 ; Base (bits 0-15) + dw 0x0 ; Base (bits 16-23) + db 10011010b ; Flags1 : Type + db 11001111b ; Flags2 : Limit (16-19) + db 0x0 ; Base (bits 24-31)