Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
maybe because you are using a char* pointer,
i.e. :
char* ptr = (char*)0xB8000;
*ptr = 72; // now ptr equals 0xB8000
*(ptr + 1) = 15; // but now is (0xB8000 + sizeof(char*)) equals 0xB8004
// try casting.
@OP - Are you running on bochs/qemu and putting a cli;hlt loop soon afterwards? Iirc one (or both) of these will stop updating the screen when the CPU is halted in this manner.
The code looks correct to me (pretty obviously compiled with optimisaton off), so it's probably either the code not running, or something else hiding its effect.
@YaYo - Please actually check what you're saying, and don't comment unless you have actually read and understood the post.
The generated assembly is correct (It's adding one to the address, not four). Which points to an error outside of the provided code, which is most likely bochs/qemu not updating the screen (this has caught almost everyone once, myself included)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]