From e50cbe8eb763cf63fb44b047d5164f6fbf07eb39 Mon Sep 17 00:00:00 2001 From: Alejandro Sior Date: Fri, 13 May 2022 20:50:39 +0200 Subject: boot: longmode to realmode stub This is the initial commit to the repo. It adds all the code. The last proper thing that I got working before committing is calling real mode functions from long mode using a stub. Next up, I would like to implement a disk reader abstraction over the BIOS in order to read form partitions (most notably FAT32). --- rt/+x86_64/gdt32.S | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 rt/+x86_64/gdt32.S (limited to 'rt/+x86_64/gdt32.S') diff --git a/rt/+x86_64/gdt32.S b/rt/+x86_64/gdt32.S new file mode 100644 index 0000000..21ab796 --- /dev/null +++ b/rt/+x86_64/gdt32.S @@ -0,0 +1,20 @@ +gdt32: + .quad 0 +gdt32_code: + .short 0xFFFF + .short 0x0000 + .byte 0x00 + .byte 0b10011010 + .byte 0b11001111 + .byte 0x00 +gdt32_data: + .short 0xFFFF + .short 0x0000 + .byte 0x00 + .byte 0b10010010 + .byte 0b11001111 + .byte 0x00 +.globl gdtr32 +gdtr32: + .short gdtr32 - gdt32 - 1 + .int gdt32 -- cgit v1.2.3