38 lines
883 B
C
38 lines
883 B
C
#include "../includes/io.h"
|
|
#include "../includes/screen.h"
|
|
|
|
void kmain()
|
|
{
|
|
clear_screen();
|
|
print_banner();
|
|
//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);
|
|
//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);
|
|
asm("hlt");
|
|
}
|
|
|
|
void write_screen(unsigned int i, char c, unsigned char fg, unsigned char bg)
|
|
{
|
|
char *fb = (char *) 0x000B8000;
|
|
fb[i] = c;
|
|
fb[i + 1] = ((fg & 0x0F) << 4) | (bg & 0x0F);
|
|
}
|
|
|
|
void move(unsigned short pos)
|
|
{
|
|
outb(0x3D4, 14);
|
|
outb(0x3D5, ((pos >> 8 ) & 0x00FF));
|
|
outb(0x3D4, 15);
|
|
outb(0x3D5, pos & 0x00FF);
|
|
}
|