mirror of
https://github.com/cowmonk/cowos.git
synced 2025-10-27 22:43:26 +00:00
cowos attempted gdt, but at least we have vga drivers now
This commit is contained in:
parent
b08b0728ae
commit
41b34d2a9d
14 changed files with 253 additions and 140 deletions
|
|
@ -1,12 +1,15 @@
|
|||
#include <gdt.h>
|
||||
#include <klibc/string.h>
|
||||
/* #include <drivers/video/vga.h> */
|
||||
#include <drivers/video/vga.h>
|
||||
#include <stddef.h>
|
||||
#include <bootloader.h>
|
||||
|
||||
static void hcf(void) {
|
||||
for (;;) {
|
||||
__asm__("hlt");
|
||||
}
|
||||
static void
|
||||
hcf(void)
|
||||
{
|
||||
for (;;) {
|
||||
__asm__("hlt");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -14,27 +17,10 @@ kernel_main(void)
|
|||
{
|
||||
/* Make sure the bootloader understands our base revision */
|
||||
if (LIMINE_BASE_REVISION_SUPPORTED == 0) hcf();
|
||||
|
||||
vga_set_mode_13h();
|
||||
|
||||
/* 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!");
|
||||
*/
|
||||
/* initGDT(); */
|
||||
|
||||
/* 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