First commit: add folder structure, make process, kernel main function, base for framebuffer driver
This commit is contained in:
23
stdio.c
Normal file
23
stdio.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user