Merge pull request #24 from E-Almqvist/dev

v0.1
pull/25/head 0.1
Elias Almqvist 3 years ago committed by GitHub
commit 3300cffcfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/kernel/kernel.c
  2. 4
      src/kernel/lib/vga.c

@ -1,11 +1,7 @@
#include "lib/vga.c" #include "lib/vga.c"
void main() { void main() {
// Do kernel stuff
char* vidmem = (char*)0xb8000;
*vidmem = 'X';
clear_screen(); clear_screen();
set_cursor_pos(24, 0); set_cursor_pos(28, 2);
println("\t eOS Version 0.0 2021", 0xf0); print("eOS Version 0.1 2021", 0xf0);
} }

@ -18,7 +18,7 @@ char* get_vga_charpos_pointer(unsigned int col, unsigned int row) {
return (char*)(VIDEO_MEM + 2*((row*80) + col)); return (char*)(VIDEO_MEM + 2*((row*80) + col));
} }
void putc(char c, unsigned int col, unsigned int row, int colorcode) { void writechar(char c, unsigned int col, unsigned int row, int colorcode) {
char* mem = get_vga_charpos_pointer(col, row); char* mem = get_vga_charpos_pointer(col, row);
*mem = c; // Write the character *mem = c; // Write the character
*(mem+1) = colorcode; // Write the colorcode *(mem+1) = colorcode; // Write the colorcode
@ -45,7 +45,7 @@ void set_cursor_pos(unsigned int x, unsigned int y) {
void print(char* str, int colorcode) { void print(char* str, int colorcode) {
for( char* c = str; *c != '\0'; c++ ) for( char* c = str; *c != '\0'; c++ )
putc(*c, (unsigned int)(c - str) + cursor_col, cursor_row, colorcode); writechar(*c, (unsigned int)(c - str) + cursor_col, cursor_row, colorcode);
} }
void println(char* str, int colorcode) { void println(char* str, int colorcode) {

Loading…
Cancel
Save