mirror of
https://github.com/cowmonk/cowos.git
synced 2025-10-27 22:43:26 +00:00
cowos moves to 64bit! and framebuffers too ig
This commit is contained in:
parent
b78e4fc24d
commit
babc65305d
32 changed files with 4074 additions and 146 deletions
|
|
@ -1,10 +1,41 @@
|
|||
#include <drivers/video/vga.h>
|
||||
#include <string.h>
|
||||
#include <klibc/string.h>
|
||||
/* #include <drivers/video/vga.h> */
|
||||
#include <stddef.h>
|
||||
#include <bootloader.h>
|
||||
|
||||
static void hcf(void) {
|
||||
for (;;) {
|
||||
__asm__("hlt");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
kernel_main(void)
|
||||
{
|
||||
/* Make sure the bootloader understands our base revision */
|
||||
if (LIMINE_BASE_REVISION_SUPPORTED == 0) hcf();
|
||||
|
||||
/* ensure a framebuffer */
|
||||
if (framebuffer_request.response == NULL
|
||||
|| framebuffer_request.response->framebuffer_count < 1) hcf();
|
||||
|
||||
/* fetch the first framebuffer */
|
||||
struct limine_framebuffer *framebuffer = framebuffer_request.response->framebuffers[0];
|
||||
|
||||
/* assume framebuffer model is RGB w/32-bit pixels */
|
||||
for (size_t i = 0; i < 100; i++) {
|
||||
volatile uint32_t *fb_ptr = framebuffer->address;
|
||||
fb_ptr[i * (framebuffer->pitch / 4) + i] = 0xffffff;
|
||||
}
|
||||
|
||||
/* need to get an actual framebuffer driver working before we can use vga */
|
||||
|
||||
/*
|
||||
term_init();
|
||||
|
||||
term_writestr("Hello World!\n");
|
||||
term_writestr("Hello World!");
|
||||
*/
|
||||
|
||||
/* done so now hang */
|
||||
hcf();
|
||||
}
|
||||
|
|
|
|||
BIN
kernel/init/kernel.o
Normal file
BIN
kernel/init/kernel.o
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue