-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.c
More file actions
29 lines (24 loc) · 690 Bytes
/
Copy pathkernel.c
File metadata and controls
29 lines (24 loc) · 690 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
#include "graphics.h"
#include "keyboard.h"
#include "keymap.h"
#include "multiboot.h"
#define COLOR_BG 0x1A1A1A
#define COLOR_WINDOW 0x2D2D2D
void draw_shell_ui() {
clear_screen_gfx(COLOR_BG);
draw_rect(50, 50, 700, 450, COLOR_WINDOW);
}
void kmain(unsigned long magic, unsigned long addr) {
if (magic == 0x2BADB002) {
multiboot_info_t *mbi = (multiboot_info_t *) addr;
if (mbi->flags & (1 << 12)) {
set_vga_buffer((uint32_t *)(uintptr_t)mbi->framebuffer_addr);
set_vga_pitch(mbi->framebuffer_pitch);
}
}
draw_shell_ui();
keyboard_init();
while(1) {
__asm__ __volatile__("hlt");
}
}