Debug refactor

pull/37/head
E. Almqvist 3 years ago
parent e39a5f5de8
commit ff08fdffab
  1. 5
      drivers/vga.c
  2. 3
      drivers/vga.h
  3. 9
      kernel/kernel.c

@ -12,7 +12,9 @@ void vga_init() {
port_outb(0x3d5, 0x20); port_outb(0x3d5, 0x20);
// Clear screen // Clear screen
clear_screen(); // clear_screen();
set_cursor_pos(0, 11);
} }
/* /*
@ -23,6 +25,7 @@ char* get_memory_charpos(unsigned int col, unsigned int row) {
} }
void writechar(char c, unsigned int col, unsigned int row, int attribute_byte) { void writechar(char c, unsigned int col, unsigned int row, int attribute_byte) {
if( !attribute_byte ) if( !attribute_byte )
attribute_byte = DEFAULT_COLOR; attribute_byte = DEFAULT_COLOR;

@ -1,7 +1,8 @@
#define VGA_ADDRESS (char*)0xb8000 #define VGA_ADDRESS (char*)0xb8000
#define VGA_ADDRESS_MAX (char*)0xb8fa0 #define VGA_ADDRESS_MAX (char*)0xb8fa0
#define DEFAULT_COLOR 0x07 // #define DEFAULT_COLOR 0x07
#define DEFAULT_COLOR 0x0f
#define MAX_ROWS 25 #define MAX_ROWS 25
#define MAX_COLS 80 #define MAX_COLS 80

@ -13,8 +13,13 @@ void main() {
char* subtitle = "A x86 operating system, licenced under GPL-2.0"; char* subtitle = "A x86 operating system, licenced under GPL-2.0";
println(subtitle, DEFAULT_COLOR); println(subtitle, DEFAULT_COLOR);
char* strbuf = "String concat: "; /*
char* str2 = "WORKS! :D"; print("Kernel offset: ", DEFAULT_COLOR);
println("0x1000", DEFAULT_COLOR);
*/
char* strbuf = "Concat test: ";
char* str2 = "Works!";
strbuf = strcat(strbuf, str2); strbuf = strcat(strbuf, str2);
set_cursor_pos(0, 4); set_cursor_pos(0, 4);
println(strbuf, DEFAULT_COLOR); println(strbuf, DEFAULT_COLOR);

Loading…
Cancel
Save