Add: graphics fb cursor
This commit is contained in:
@@ -61,15 +61,14 @@ uint8_t *tags = mb_info->tags;
|
||||
tags += ((tag_size + 7) & ~7);
|
||||
}
|
||||
|
||||
serial_printf(3, "Framebuffer Address: 0x%x\r\n", fb_info->framebuffer_addr);
|
||||
serial_printf(3, "Framebuffer Width: %u\r\n", fb_info->framebuffer_width);
|
||||
serial_printf(3, "Framebuffer Height: %u\r\n", fb_info->framebuffer_height);
|
||||
serial_printf(3, "Framebuffer Pitch: %u\r\n", fb_info->framebuffer_pitch);
|
||||
serial_printf(3, "Framebuffer BPP: %u\r\n", fb_info->framebuffer_bpp);
|
||||
serial_printf(3, "Framebuffer Address: 0x%x\r", fb_info->framebuffer_addr);
|
||||
serial_printf(3, "Framebuffer Width: %u\r\n", fb_info->framebuffer_width);
|
||||
serial_printf(3, "Framebuffer Height: %u\r\n", fb_info->framebuffer_height);
|
||||
serial_printf(3, "Framebuffer Pitch: %u\r\n", fb_info->framebuffer_pitch);
|
||||
serial_printf(3, "Framebuffer BPP: %u\r\n", fb_info->framebuffer_bpp);
|
||||
|
||||
|
||||
if (fb_info) {
|
||||
log("Entered fb_info\r\n", 3);
|
||||
framebuffer = (uint32_t *)(uintptr_t) fb_info->framebuffer_addr;
|
||||
|
||||
uint32_t width = fb_info->framebuffer_width;
|
||||
@@ -77,6 +76,7 @@ serial_printf(3, "Framebuffer BPP: %u\r\n", fb_info->framebuffer_bpp);
|
||||
uint32_t pitch = fb_info->framebuffer_pitch;
|
||||
uint32_t bpp = fb_info->framebuffer_bpp;
|
||||
|
||||
|
||||
//8x16 font, not padded
|
||||
VGA_WIDTH = width/8;
|
||||
VGA_HEIGHT = height/16;
|
||||
@@ -92,41 +92,14 @@ serial_printf(3, "Framebuffer BPP: %u\r\n", fb_info->framebuffer_bpp);
|
||||
draw_char(0+i, 0+i, y_offset, white, black);
|
||||
}
|
||||
*/
|
||||
|
||||
/* TEST print red square
|
||||
for (uint32_t y = 0; y < 10; y++) {
|
||||
for (uint32_t x = 0; x < 10; x++) {
|
||||
putpixel(framebuffer, (int)pitch, (int)bpp, x, y, red);
|
||||
//framebuffer[y * (pitch / 4) + x] = 0xFF0000; // Rouge
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
log("Drew to framebuffer.\r\n", 3);
|
||||
}
|
||||
/*
|
||||
puts("This should work by now! Enter Graphics Mode.");
|
||||
printf("\nMy name is %s, and I'm %d. 0x%x", "Alan", 34, 0xdeadbeef);
|
||||
|
||||
for (int i=0; i<512; i++)
|
||||
{
|
||||
printf("%d ", i);
|
||||
}
|
||||
*/
|
||||
|
||||
for (int i=0; i<100; i++)
|
||||
{
|
||||
printf("%d\n", i);
|
||||
}
|
||||
|
||||
//colorputs("Wow, such colorful output!", green, blue);
|
||||
|
||||
printf("[kernel] framebuffer discovered at 0x%x\n", fb_info->framebuffer_addr);
|
||||
printf("[kernel] fb0: width=%u, height=%u, pitch=%u, bpp=%u\n", fb_info->framebuffer_width, fb_info->framebuffer_height, fb_info->framebuffer_pitch, fb_info->framebuffer_bpp);
|
||||
|
||||
colorputs(ascii_title, green, black);
|
||||
|
||||
while (1);
|
||||
|
||||
|
||||
/*
|
||||
init_serial();
|
||||
log("serial connection established\n", 3);
|
||||
gdt_install();
|
||||
@@ -139,17 +112,16 @@ serial_printf(3, "Framebuffer BPP: %u\r\n", fb_info->framebuffer_bpp);
|
||||
__asm__ __volatile__("sti");
|
||||
log("initialized IRQs\n", 2),
|
||||
|
||||
clear();
|
||||
colorputs(ascii_title, 10);
|
||||
colorputs(" by @xamidev - star the repo for a cookie!\n\n", 14);
|
||||
//clear();
|
||||
//colorputs(ascii_title, 10);
|
||||
//colorputs(" by @xamidev - star the repo for a cookie!\n\n", );
|
||||
|
||||
init_paging();
|
||||
printf("Hello, paging world!\n");
|
||||
//init_paging();
|
||||
|
||||
//test_read_sector();
|
||||
|
||||
uint32_t *ptr = (uint32_t*)0xA0000000;
|
||||
uint32_t do_page_fault = *ptr;
|
||||
//uint32_t *ptr = (uint32_t*)0xA0000000;
|
||||
//uint32_t do_page_fault = *ptr;
|
||||
|
||||
timer_install();
|
||||
serial_printf(2, "%d\tinitialized timer handler", global_ticks);
|
||||
@@ -157,5 +129,5 @@ serial_printf(3, "Framebuffer BPP: %u\r\n", fb_info->framebuffer_bpp);
|
||||
serial_printf(2, "%d\tinitialized keyboard handler", global_ticks);
|
||||
shell_install();
|
||||
serial_printf(2, "%d\tstarted system shell", global_ticks);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user