This commit is contained in:
spikey 2024-02-17 17:19:28 -05:00
parent 55f0657bdd
commit a5bc53102d
5 changed files with 33 additions and 12 deletions

10
sys/drv/vga/Makefile Normal file
View File

@ -0,0 +1,10 @@
CC=cc
FLAGS=-Wall -c -g -Wextra -ffreestanding -m32 -nostdlib
SRCS=$(wildcard *.c)
INCLUDE=include/
MAIN_INCLUDE=../../include/
BIN=vga.o
all:
$(CC) $(FLAGS) -I $(INCLUDE) -I $(MAIN_INCLUDE) $(SRCS) -o $(BIN)

View File

@ -1,10 +1,13 @@
#ifndef VIDEO_H
#define VIDEO_H
#define VGA_START 0xB8000
#include <types.h>
#define SIZE 4000
void vga_write(char *, char, short);
s8 *vga_vidmem = (s8 *)0xb8000;
void vga_write(s8 *, s8);
void vga_clearscreen();
#endif

BIN
sys/drv/vga/vga.o Normal file

Binary file not shown.

View File

@ -1,12 +1,16 @@
#define VGA_START 0xB8000
#define SIZE 4000
#include <types.h>
#include <video.h>
void vga_write(char*, char, short) {
void
vga_write(s8 *sequence, s8 flags)
{
u32 i = *vga_vidmem;
}
void vga_clearscreen() {
for (int i = 0; i <= SIZE; i++) {
VGA_START[i] = 0;
}
}
while (*sequence != '\0') {
vga_vidmem[i] = *sequence;
*sequence++;
i++;
vga_vidmem[i] = flags;
i++;
}
}

4
sys/sysinit.c Normal file
View File

@ -0,0 +1,4 @@
void
sysinit() {
write("Om Smart.", 0x0F, 10);
}