diff --git a/src/kernel.c b/src/kernel.c index 4e118be..c45e836 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -27,6 +27,12 @@ #error "This tutorial needs to be compiled with a ix86-elf compiler" #endif +static void put_pixel(uint32_t color, uint32_t x, uint32_t y) +{ + const uint32_t coords = x + y * display.pitch; + display.buff[coords] = color; +} + void kernel_main(multiboot_info_t *mbd, uint32_t magic) { /* terminal_initialize(); */ @@ -40,6 +46,14 @@ void kernel_main(multiboot_info_t *mbd, uint32_t magic) /* "complex 8*unknown quantity -byte descriptor table. -- Troy " */ /* "Martin 03:50, 22 March 2009 (UTC)\n"); */ - memset(display.buff, 255, 1024 * 1024); + uint32_t color = 0 << 16 | 128 << 8 | 128; + for (size_t i = 0; i < 100; i++) { + put_pixel(color, 10, i); + put_pixel(color, 11, i); + put_pixel(color, 12, i); + put_pixel(color, 13, i); + put_pixel(color, 14, i); + } + /* memset(display.buff, 255, 1024 * 1024); */ /* shell_init(); */ }