-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.c
More file actions
46 lines (39 loc) · 984 Bytes
/
kernel.c
File metadata and controls
46 lines (39 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "../cpu/headers/isr.h"
#include "../drivers/headers/screen.h"
#include "headers/kernel.h"
#include "../libc/headers/string.h"
#include "../libc/headers/mem.h"
#include "headers/commands.h"
#include <stdint.h>
void kernel_main() {
init_memory();
isr_install();
irq_install();
asm volatile("int $2");
asm volatile("int $3");
kprint("\n");
kprint("Welcome to BOOTA");
kprint("\n");
help();
terminal();
}
void user_input(char *input) {
if (strcmp(input, "POWEROFF") == 0) {
poweroff();
} else if (strcmp(input, "STACK") == 0) {
print_stack();
} else if (strcmp(input, "REBOOT") == 0) {
reboot();
} else if (strcmp(input, "HELP") == 0) {
help();
} else if (strcmp(input, "HALT") == 0) {
halt();
} else if (strcmp(input, "MEM") == 0) {
mem();
} else {
kprint("Unknown command: ");
kprint(input);
kprint("\n");
}
terminal();
}