Separate kernel code from test code
Eventually I want the kernel to be loaded from the SD card as well, but it still needs to separate from user programs. At some point there should be a folder just for the BIOS, which should read from the boot block of the SD card and start executing, and thats it.
This commit is contained in:
24
sw/kernel/irq.c
Normal file
24
sw/kernel/irq.c
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
#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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user