First commit: add folder structure, make process, kernel main function, base for framebuffer driver

This commit is contained in:
xamidev
2024-05-18 22:06:31 +02:00
commit 25405a7c11
21 changed files with 444 additions and 0 deletions

23
stdio.c Normal file
View File

@@ -0,0 +1,23 @@
#include "io.h"
#include "stdio.h"
char* fb = (char *) 0x000B8000;
void move_cursor(unsigned short pos)
{
outb(FB_CMD_PORT, FB_HIGH_BYTE_CMD);
outb(FB_DATA_PORT, ((pos >> 8) & 0x00FF));
outb(FB_CMD_PORT, FB_LOW_BYTE_CMD);
outb(FB_DATA_PORT, pos & 0x00FF);
}
void putchar(unsigned int i, char c, unsigned char fg, unsigned char bg)
{
fb[i] = c;
fb [i+1] = ((fg & 0x0F) << 4 | (bg & 0x0F));
}
int write(char *buf, unsigned int len)
{
return 42;
}