diff --git a/sys/drv/vga/Makefile b/sys/drv/vga/Makefile new file mode 100644 index 0000000..833e2a6 --- /dev/null +++ b/sys/drv/vga/Makefile @@ -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) + diff --git a/sys/drv/vga/include/video.h b/sys/drv/vga/include/video.h index 42b34f3..1c3ff3f 100644 --- a/sys/drv/vga/include/video.h +++ b/sys/drv/vga/include/video.h @@ -1,10 +1,13 @@ #ifndef VIDEO_H #define VIDEO_H -#define VGA_START 0xB8000 +#include + #define SIZE 4000 -void vga_write(char *, char, short); +s8 *vga_vidmem = (s8 *)0xb8000; + +void vga_write(s8 *, s8); void vga_clearscreen(); #endif diff --git a/sys/drv/vga/vga.o b/sys/drv/vga/vga.o new file mode 100644 index 0000000..95df105 Binary files /dev/null and b/sys/drv/vga/vga.o differ diff --git a/sys/drv/vga/video.c b/sys/drv/vga/video.c index 2e10bea..72c66d6 100644 --- a/sys/drv/vga/video.c +++ b/sys/drv/vga/video.c @@ -1,12 +1,16 @@ -#define VGA_START 0xB8000 -#define SIZE 4000 +#include +#include -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; - } -} \ No newline at end of file + while (*sequence != '\0') { + vga_vidmem[i] = *sequence; + *sequence++; + i++; + vga_vidmem[i] = flags; + i++; + } +} diff --git a/sys/sysinit.c b/sys/sysinit.c new file mode 100644 index 0000000..af45b09 --- /dev/null +++ b/sys/sysinit.c @@ -0,0 +1,4 @@ +void +sysinit() { + write("Om Smart.", 0x0F, 10); +}