Project structure and standard library string and VGA and terminal drivers

This commit is contained in:
Ben
2019-04-24 23:40:10 +01:00
parent 24409c3a17
commit fa35441595
16 changed files with 68 additions and 40 deletions

View File

@@ -0,0 +1,9 @@
#include "vga.h"
VGAChar_t* framebuffer = (VGAChar_t*)0xB8000;
void putchar(int x, int y, char c, char foreground, char background) {
framebuffer[(y * TERM_WIDTH) + x].c = c;
framebuffer[(y * TERM_WIDTH) + x].foreground = foreground;
framebuffer[(y * TERM_WIDTH) + x].background = background;
}

10
kernel/drivers/VGA/vga.h Normal file
View File

@@ -0,0 +1,10 @@
#define TERM_WIDTH 80
#define TERM_HEIGHT 25
struct VGAChar_t {
char c;
char foreground:4;
char background:4;
}__attribute__((packed));
void putchar(int x, int y, char c, char foreground, char background);

View File

View File

@@ -0,0 +1,5 @@
#include <kernel/drivers/VGA/vga.h>
void clear();
template <typename T>
void print(T input);

0
kernel/gdt.cpp Normal file
View File

0
kernel/gdt.h Normal file
View File