I am trying to make a function that would write strings to video memory with a specific color. However, I am unable to make it work. To write single characters, i would do this:
*(char *)0xb8000 = 'O'; //Prints the letter O at the first position in video memory
*(char *)0xb8001 = 'O'; //Adds it some colors (Haven't figured how to write a byte here)
But I need to write with a variable, so I tried this but it just prints nothing.
int currentAddressVRAM = 0xb8000;
*(char *)currentAddressVRAM = 'O';
currentAddressVRAM++;
*(char *)currentAddressVRAM = 'O';
currentAddressVRAM++;
How would I do this? What am I doing wrong?
Edit: I tried this too and it just printed nothing:
char *currentAddressVRAM = (char *)0xb8000;
*currentAddressVRAM = 'O';
currentAddressVRAM++;
*currentAddressVRAM = 'O';
currentAddressVRAM++;