#include "config.h"
+#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <ctype.h>
#include "asm.h"
+#include "rpi.h"
+#include "contty.h"
#include "serial.h"
#include "video.h"
void dbgled(int x);
-void exit(int x);
static void cmdrun(char *cmd);
static char cmdbuf[256];
static int cmdend;
+ rpi_init();
init_serial(115200);
- ser_printstr("Starting rpikern\n");
+ con_init();
+
+ printf("Detected raspberry pi %d, I/O base: %x\n", rpi_model, rpi_iobase);
video_init();
- ser_printstr("Going interactive\n");
+ printf("Going interactive\n");
for(;;) {
- int c = ser_getchar();
+ int c = getchar();
switch(c) {
case '\r':
case -1:
lastnl = 0;
- ser_printstr("error!\n");
+ printf("error!\n");
break;
default:
return 0;
}
-void panic(void)
-{
- ser_printstr("PANIC!\n");
- exit(0);
-}
-
static void cmdrun(char *cmd)
{
char *ptr, *args;
args = ptr + 1;
if(strcmp(cmd, "help") == 0) {
- ser_printstr("help not implemented yet\n");
+ printf("help not implemented yet\n");
} else if(strcmp(cmd, "ver") == 0) {
- ser_printstr("rpikern version 0.0\n");
+ printf("rpikern version 0.0\n");
} else {
- ser_printstr("Unknown command: ");
- ser_printstr(cmd);
- ser_printstr("\n");
+ printf("Unknown command: %s\n", cmd);
}
}