CeDOS - src/kernel/drivers/graphics.c

src/kernel/drivers/graphics.c (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "cedos/drivers/graphics.h"
#include "cedos/mm/paging.h"

#include "string.h"
#include "linker.h"

#include <stdint.h>

extern void realmode_int10h(uint32_t eax, uint32_t ebx, uint32_t ecx);

int graphics_init(void) {
    VIRT_ADDR src = (VIRT_ADDR)((uint32_t)(KERNEL_VMA) + (uint32_t)(REALMD_LMA));
    uint32_t size = REALMD_SIZE;
    VIRT_ADDR dest = (VIRT_ADDR)(REALMD_VMA);

    memcpy(dest, src, size);
}

int graphics_set_mode(int mode) {
    realmode_int10h((uint32_t)(mode), 0, 0);
}