diff options
| author | Alejandro Sior <aho@sior.be> | 2022-05-13 20:50:39 +0200 |
|---|---|---|
| committer | Alejandro Sior <aho@sior.be> | 2022-05-13 20:50:39 +0200 |
| commit | e50cbe8eb763cf63fb44b047d5164f6fbf07eb39 (patch) | |
| tree | 8acb610a4f33462c843f54016861780ffadc010d /rt/+x86_64/gdt16.S | |
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).
Diffstat (limited to 'rt/+x86_64/gdt16.S')
| -rw-r--r-- | rt/+x86_64/gdt16.S | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/rt/+x86_64/gdt16.S b/rt/+x86_64/gdt16.S new file mode 100644 index 0000000..6b74819 --- /dev/null +++ b/rt/+x86_64/gdt16.S @@ -0,0 +1,27 @@ +.globl gdt16 +gdt16: + .quad 0 +.globl gdt16_code +gdt16_code: + .short 0xFFFF + .short 0x0000 + .byte 0x00 + .byte 0b10011010 + .byte 0b10001111 + .byte 0x00 +.globl gdt16_data +gdt16_data: + .short 0xFFFF + .short 0x0000 + .byte 0x00 + .byte 0b10010010 + .byte 0b10001111 + .byte 0x00 +.globl gdtr16 +gdtr16: + .short gdtr16 - gdt16 - 1 + .int gdt16 + + + + |
