Hello, i want to make OS, and i have Kernel,Bootloader, and i have problems with this code:
// Print single char
void printch(char c){
string memory = (string)0xb8000;
memory[((CursorX * sw + CursorY))*sd] = c;
CursorY++;
updateCursor();
}
That makes sense. The number of while loop iterations = sizeof(str_size) + 1. while(str_size <= sizeof(str_size))
If sizeof(int) = 4 on your system the 5 character output is explained.
You want to output all of the characters in the string.
consider instead: while(str_size < strlen(str))
though you need to #include <cstring> for the strlen function.
Another way is to loop until the null terminator is found at the end of the string: