Files
riscv-operating-system-mooc/code/os/03-contextswitch/kernel.c
2021-04-01 20:02:31 +08:00

27 lines
446 B
C

#include "os.h"
/*
* Following functions SHOULD be called ONLY ONE time here,
* so just declared here ONCE and NOT included in file os.h.
*/
extern void uart_init(void);
extern void page_init(void);
extern void sched_init(void);
extern void schedule(void);
void start_kernel(void)
{
uart_init();
uart_puts("Hello, RVOS!\n");
page_init();
sched_init();
schedule();
uart_puts("Would not go here!\n");
while (1) {}; // stop here!
}