46 lines
1.5 KiB
C
46 lines
1.5 KiB
C
#include "../includes/io.h"
|
|
#include "../includes/gdt.h"
|
|
#include "../includes/serial.h"
|
|
#include "../includes/screen.h"
|
|
|
|
void kmain()
|
|
{
|
|
set_serial_baud_rate(COM1_PORT, 0x03);
|
|
configure_serial_line(COM1_PORT);
|
|
write_to_com(COM1_PORT, "Info From Kernel: Set up COM1 for messaging.\n");
|
|
clear_screen();
|
|
write_to_com(COM1_PORT, "Info From Kernel: Clearing screen.\n");
|
|
print_banner();
|
|
write_to_com(COM1_PORT, "Info From Kernel: Displaying OS banner.\n");
|
|
//draw_rect(20, 5, 50, 7, 0x4, 0xF);
|
|
draw_rect(0, 5, 5, 13, 0xF, 0x4);
|
|
draw_rect(5, 8, 10, 10, 0x4, 0xF);
|
|
draw_rect(10, 5, 15, 13, 0x8, 0x6);
|
|
draw_rect(20, 5, 25, 7, 0xF, 0x1);
|
|
draw_rect(20, 8, 25, 13, 0x5, 0x3);
|
|
set_cursor(0, 14);
|
|
move_cursor(0, 14);
|
|
move_cursor(0, 15);
|
|
draw_string("Test print", 0x8, 0xF);
|
|
move_cursor(0, 16);
|
|
draw_string("And now the cursor has been moved to y = 16.", 0x1, 0xF);
|
|
move_cursor(5, 20);
|
|
draw_string("Cursor moved over 5 cells and down 4 cells.", 0xF, 0x0);
|
|
draw_string("And the cursor moves to the end of the string", 0x1, 0xF);
|
|
draw_string("Now this string should have a newline now:\nAnd now a new line is here.\n", 0xF, 0x0);
|
|
//draw_rect(20, 5, 50, 7, 0x4, 0xF);
|
|
//draw_rect(20, 5, 50, 7, 0x4, 0xF);
|
|
//draw_rect(20, 5, 50, 7, 0x4, 0xF);
|
|
//draw_s("Hello, World!", 2, 9);
|
|
//row = 2;
|
|
///column = 80;
|
|
//draw_s("And 2nd Row. Now the 3rd row.", 2, 9);
|
|
move_cursor(0, 3);
|
|
draw_string("Installing GDT...\n", 0xF, 0x0);
|
|
gdt_install();
|
|
move_cursor(0, 4);
|
|
draw_string("Installed GDT\n", 0xf, 0x0);
|
|
|
|
asm("hlt");
|
|
}
|