Instead of using the bootsector to load a bootloader, just put the bootloader in the ROM and call it a day. It looks for a file on the SD card in the root directory named `kernel.bin` and loads it into memory. This is not a perfect solution, as the kernel will grow larger and the kernel load address will have to change. At this point I could add back the bootloader, but that is for later. Also the bootloader is just a copy of the kernel, so that can be trimmed down a lot.
24 lines
405 B
C
24 lines
405 B
C
|
|
#include <stdint.h>
|
|
#include <conio.h>
|
|
|
|
#include "devices/interrupt.h"
|
|
#include "devices/uart.h"
|
|
|
|
char lastchar;
|
|
|
|
|
|
void handle_irq() {
|
|
uint8_t status;
|
|
|
|
status = irq_get_status();
|
|
|
|
if (status & BUTTON) {
|
|
cputs("Button Interrupt!\n");
|
|
irq_set_status(status & ~BUTTON);
|
|
}
|
|
if (status & UART) {
|
|
lastchar = uart_rxb();
|
|
irq_set_status(status & ~UART);
|
|
}
|
|
} |