Files
super6502/sw/kernel/main.c
Byron Lathi c6098f2d1f 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.
2022-04-16 21:58:37 -05:00

43 lines
625 B
C

#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;
}