Explanation:
So I have this function here.
Code: Select all
void ConsoleWrite(char* string,unsigned char color)
{
unsigned char* videoMemory = (unsigned char*)0xB8000;
int x = 0;
int y = 0;
int i;
for(i=0;i<strlen(string);i++)
{
if(string[i] == '\n')
{
//y++;
//x=0;
}
videoMemory[y*80 + x++] = string[i];
videoMemory[y*80 + x++] = color;
if(x >= 80)
{
x=0;
y++;
}
MoveCursor(x/2,y);
}
return;
}
A similar problem, if I declare a function ( not even call it ), this functions execution gets messed up in the same way.
I'm going to assume it's my linker script that doesn't tell the linker how to divide the sections accordingly but I don't really know, I'm still a newbie at this.
Posting a RAR with my source, shell script for assembling/compiling & my linker script, hopefully you guys can take a look and maybe provide a bit of help.
PS: Ignore the useless stuff in boot.asm, I know it's useless, I'm just trying to get this odd problem out of the way before I do anything else.
Thanks.