vga.c:
Code: Select all
#include "../Kernel/system.h"
#include "vga.h"
unsigned char *VGA;
unsigned short offset;
extern void enableVideoMode();
extern void disableVideoMode();
void initializeVGA() {
enableVideoMode();
*VGA = (unsigned char*)0xA0000;
}
void plotPixle(int x, int y, char color) {
offset = (y << 8) + (y << 6) + x;
VGA[offset] = color;
}
void test() {
for (int y = 3; y < 180; y++) { for (int i = 0; i < 319; i++) { offset = (y << 8) + (y << 6) + i; VGA[offset] = 1; } }
}
Code: Select all
global enableVideoMode
global disableVideoMode
enableVideoMode:
mov ah, 0x00
mov al, 0x13
int 0x10
disableVideoMode:
mov ah, 0x00
mov al, 0x03
int 0x10
Code: Select all
qemu-system-i386 -cdrom Binaries/caffieneOS.iso