diff --git a/kernel/kernel.c b/kernel/kernel.c index f7ea26c..0333a43 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -1,14 +1,15 @@ #include "../drivers/vga.h" +#include "../lib/str.h" #include "../lib/strf.h" void main() { vga_init(); // Initialize the screen first // i.e. clear the screen et cetera. - int test = 1234; - char* teststr; - teststr = int_to_str(test, teststr); - println(teststr, 0xf0); + char* strbuf = "HEJ"; + char* str2 = "xD"; + strbuf = strcat(strbuf, str2); + println(strbuf, 0xf0); set_cursor_pos(28, 2); print("eOS Version 0.1 2021", 0xf0); diff --git a/lib/str.c b/lib/str.c index a0a7ef7..0153b87 100644 --- a/lib/str.c +++ b/lib/str.c @@ -5,7 +5,6 @@ unsigned int strlen(char* str) { for( c = str; *c != '\0'; c++ ) // search for end-of-string return (unsigned int)(c - str); // get size by delta-address - } char* strcat(char* buf, char* str) { @@ -15,7 +14,11 @@ char* strcat(char* buf, char* str) { *(buf + bufferlen) = 0x3f; // placeholder // concat the str to buf + int cc = 0; for( char* c = str; *c != '\0'; c++ ) { - + *(buf + bufferlen + cc) = *c; + cc++; } + + return buf; }