os3/stage1/stage1.c
John Stefanelli 7a1f072e4a
[Stage1] Add RSDP and basic ACPI parsing
[Stage1] Add HEX display to screen.h
[Stage1] Handle IRQ1 semi-gracefully
[Stage1] Try (unsuccessfully) to "wait" for IRQ 1 (os_interrupt_wait())
2023-06-05 13:13:37 +02:00

61 lines
1.1 KiB
C

#include "../os3_common/datatypes.h"
#include "include/screen.h"
#include "include/interrupts.h"
#include "include/pic_8259.h"
#include "include/rsdp.h"
#include "include/acpi.h"
int main() {
screen_clear();
screen_write_string("-------- OS3 Stage 1 --------\n", 0);;
setup_interrupts();
screen_write_string("Interrupts OK\n", 0);
setup_pic();
screen_write_string("PIC OK\n", 0);
enable_interrupts();
screen_write_string("STI OK\n", 0);
OS_RSDPDescriptor* rsdp = os_find_RSDP();
if (rsdp == 0) {
screen_write_string("ERROR: RSDP Not found", 0);
while (1) {
}
}
screen_write_string("RSDP OK\n", 0);
os_bool acpi_ok = os_acpi_init(rsdp);
if (acpi_ok != OS_TRUE) {
screen_write_string("ERROR: ACPI Init failed.", 0);
while(1) {
}
}
screen_write_string("ACPI Ok\n", 0);
screen_write_string("Waiting for any key....\n", 0);
os_bool res = os_interrupt_wait(33, 300);
if (res == OS_TRUE) {
screen_write_string("Keyboard interrupt OK\n", 0);
} else {
screen_write_error("Keyboard interrupt timed out\n", 0);
while(1) {
}
}
while(1) {
}
return 0;
}