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:
42
sw/kernel/main.c
Normal file
42
sw/kernel/main.c
Normal file
@@ -0,0 +1,42 @@
|
||||
#include <stdint.h>
|
||||
#include <conio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "devices/board_io.h"
|
||||
#include "devices/uart.h"
|
||||
#include "devices/mapper.h"
|
||||
#include "devices/sd_card.h"
|
||||
#include "filesystem/fat.h"
|
||||
#include "exec.h"
|
||||
|
||||
uint8_t buf[512];
|
||||
|
||||
int main() {
|
||||
int i;
|
||||
uint16_t rca;
|
||||
|
||||
clrscr();
|
||||
cprintf("Hello, world!\n");
|
||||
|
||||
for (i = 0; i < 16; i++){
|
||||
//cprintf("Mapping %1xxxx to %2xxxx\n", i, i);
|
||||
mapper_write(i, i);
|
||||
}
|
||||
|
||||
cprintf("Enabling Mapper\n");
|
||||
mapper_enable(1);
|
||||
|
||||
sd_init();
|
||||
|
||||
rca = sd_get_rca();
|
||||
cprintf("rca: %x\n", rca);
|
||||
|
||||
sd_select_card(rca);
|
||||
|
||||
fat_init();
|
||||
exec("/test.o65");
|
||||
|
||||
cprintf("Done!\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user