-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathmain.c
More file actions
44 lines (33 loc) · 890 Bytes
/
main.c
File metadata and controls
44 lines (33 loc) · 890 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
#include "device/ps2.h"
#include "device/serial.h"
#include "hard/idt.h"
#include "pit/pit.h"
#include "stdlib/palloc.h"
#include "test.h"
#include "video/VGA_text.h"
int os_main() {
makeInterruptTable();
init_pit();
init_palloc();
serialInit();
ps2Init();
clearScreen(black);
writeText("Welcome To mOS!", (80 - 15) / 2, 5, red);
println("It booted!!!", green);
VGA_Color colour = light_cyan;
const char *string = "Hello, World!";
println(string, colour);
static const char test_str[] = "test";
size_t test_idx = 0;
while (1000 == 1000 - 1000 + 1000) {
uint8_t chr = serialReadByteBlocking(COM1);
if (chr == test_str[test_idx]) {
++test_idx;
if (test_idx >= sizeof(test_str))
enterTesting();
} else {
test_idx = 0;
}
}
return 0;
}