starting work on page tables

This commit is contained in:
2026-01-28 19:34:59 +11:00
parent 3b8bd6f0da
commit 823b13234e
15 changed files with 66 additions and 23 deletions

View File

@@ -3,17 +3,18 @@
BasicRenderer::BasicRenderer(Framebuffer* framebuffer, PSF1_FONT* psf1_Font) {
targetFramebuffer = framebuffer;
PSF1_Font = psf1_Font;
Colour = 0xFFFFFFFF;
cursorPosition = {0,0};
}
void BasicRenderer::PutChar(unsigned int colour, char chr, unsigned int xOff, unsigned int yOff) {
void BasicRenderer::PutChar(char chr, unsigned int xOff, unsigned int yOff) {
unsigned int* pixPtr = (unsigned int*)targetFramebuffer->BaseAddress;
char* fontPtr = (char*)PSF1_Font->glyphBuffer + (chr * PSF1_Font->psf1_Header->charsize);
for (unsigned long y = yOff; y < yOff + 18; y++) {
for (unsigned long x = xOff; x < xOff+8; x++) {
if ((*fontPtr & (0b10000000 >> (x - xOff))) > 0) {
*(unsigned int*)(pixPtr + x + (y * targetFramebuffer->PixelsPerScanline)) = colour;
*(unsigned int*)(pixPtr + x + (y * targetFramebuffer->PixelsPerScanline)) = Colour;
}
}
@@ -22,12 +23,12 @@ void BasicRenderer::PutChar(unsigned int colour, char chr, unsigned int xOff, un
}
}
void BasicRenderer::Print(unsigned int colour, const char* str) {
void BasicRenderer::Print(const char* str) {
unsigned int x = 0;
char* chr = (char*)str;
while (*chr != 0) {
PutChar(colour, *chr, cursorPosition.x, cursorPosition.y);
PutChar(*chr, cursorPosition.x, cursorPosition.y);
cursorPosition.x+=8;
if (cursorPosition.x + 8 > targetFramebuffer->Width) {