forked from PoliEcho-holding-org/kern
Continuing terminal I/O
- Made stdio.h work - Moved printFiletable back into kernel.c - TODO: Add stdio.h to all files that should use it (probably next commmit) - Added some more global addresses. There's a memory layout, but i'm not using it - Got cursor to be drawn - Calc program now gets user input
This commit is contained in:
@@ -2,20 +2,18 @@
|
||||
#define ISRS_H
|
||||
|
||||
#include <interrupt/idt.h>
|
||||
#include <screen/text.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// Exception handlers
|
||||
__attribute__ ((interrupt))
|
||||
void excp_divideErr(intFrame_t* iframe) { // ISR 0
|
||||
fgColor = RED;
|
||||
print("[ Division Error ]\n");
|
||||
print("\x1b[1M[ Division Error ]\n\x1b[8M");
|
||||
iframe->eip++;
|
||||
}
|
||||
|
||||
__attribute__ ((interrupt))
|
||||
void excp_doubleFault(intFrame_t* iframe, uint32_t errCode) { // ISR 8
|
||||
fgColor = RED;
|
||||
print("[ Double Fault ]\n"); // Error code should be 0 (TODO: Maybe check if it's != 0?)
|
||||
print("\x1b[1M[ Double Fault ]\n\x1b[8M"); // Error code should be 0 (TODO: Maybe check if it's != 0?)
|
||||
__asm__ volatile ("cli; hlt");
|
||||
}
|
||||
|
||||
@@ -26,19 +24,17 @@ void excp_pageFault(intFrame_t* iframe, uint32_t errCode) { // ISR 14
|
||||
// cr2 should contain invalid address
|
||||
__asm__ volatile("movl %%cr2, %0" : "=r"(badAddress));
|
||||
|
||||
fgColor = RED;
|
||||
print("[ Page Fault : 0x");
|
||||
print("\x1b[1M[ Page Fault : 0x");
|
||||
print(itoa(errCode, 16));
|
||||
print(" ] - Tried to access 0x");
|
||||
print(itoa(badAddress, 16));
|
||||
print(".\n");
|
||||
print(".\n\x1b[8M");
|
||||
__asm__ volatile ("cli; hlt");
|
||||
}
|
||||
|
||||
__attribute__ ((interrupt))
|
||||
void excp_reserved(intFrame_t* iframe) { // ISR 15
|
||||
fgColor = RED;
|
||||
print("[ Unknown Exception ]\n");
|
||||
print("\x1b[1M[ Unknown Exception ]\n\x1b[8M");
|
||||
__asm__ volatile ("cli; hlt");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user