Protected mode works but is ugly, CS, SS work, failed lidt real mode attempt

This commit is contained in:
Ciro Santilli
2015-10-17 00:03:05 +02:00
parent b9b4da0d1e
commit febbb83254
20 changed files with 585 additions and 241 deletions

43
lidt.S Normal file
View File

@@ -0,0 +1,43 @@
/*
# lidt
TODO get working:
- http://wiki.osdev.org/Real_Mode
Sets the IDTR through a from a descriptor in memory, and tells the CPU where the IDT is on memory.
Expected outcome: 'ab' gets printed to the screen.
osdev says this is not compatible with older CPUs.
# sidt
Read the descriptor register to memory.
*/
#include "common.h"
BEGIN
CLEAR
lidt idt_descriptor
movw $handler, 0x04
mov %cs, 0x06
int $0
PUTC($0x62)
hlt
idt:
.word 2
.word 4
idt_end:
idt_descriptor:
.word idt_end - idt
.long idt
handler:
PUTC($0x61)
iret