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:
29
code/os/04-multitask/kernel.c
Normal file
29
code/os/04-multitask/kernel.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#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);
|
||||
|
||||
void start_kernel(void)
|
||||
{
|
||||
uart_init();
|
||||
uart_puts("Hello, RVOS!\n");
|
||||
|
||||
page_init();
|
||||
|
||||
sched_init();
|
||||
|
||||
os_main();
|
||||
|
||||
schedule();
|
||||
|
||||
uart_puts("Would not go here!\n");
|
||||
while (1) {}; // stop here!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user