mirror of
https://github.com/plctlab/riscv-operating-system-mooc.git
synced 2025-12-26 09:09:11 +00:00
initial versioin
This commit is contained in:
35
code/os/06-interrupts/kernel.c
Normal file
35
code/os/06-interrupts/kernel.c
Normal file
@@ -0,0 +1,35 @@
|
||||
#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);
|
||||
extern void os_main(void);
|
||||
extern void trap_init(void);
|
||||
extern void plic_init(void);
|
||||
|
||||
void start_kernel(void)
|
||||
{
|
||||
uart_init();
|
||||
uart_puts("Hello, RVOS!\n");
|
||||
|
||||
page_init();
|
||||
|
||||
trap_init();
|
||||
|
||||
plic_init();
|
||||
|
||||
sched_init();
|
||||
|
||||
os_main();
|
||||
|
||||
schedule();
|
||||
|
||||
uart_puts("Would not go here!\n");
|
||||
while (1) {}; // stop here!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user