Beginner Problem with executing functions
Posted: Fri Jul 16, 2010 7:52 am
Having an odd problem - haven't done a disassembly yet because I'm simply not good at it, but if I must then I will.
Basically, if I do this, it works fine:
If I do this, it fails (no rendering done):
Any thoughts as to why? This is a PE binary with a multiboot header.
Basically, if I do this, it works fine:
Code: Select all
static char * sVideoAddress = 0x000b8000;
__declspec(noreturn)
void kernel::boot::kloader (multiboot::multiboot_info *multibootheader, unsigned long signature)
{
char *addr = (char*)sVideoAddress;
for (int i = 0; i < 80 * 25 * 2; ++i)
*addr++ = 0;
__asm { hlt }
}
Code: Select all
static char * sVideoAddress = 0x000b8000;
void * memset (void *dst, int val, int len)
{
char *dest = (char*)dst;
for (int i = 0; i < len; ++i)
*dest++ = val;
return dst;
}
void cls ()
{
memset(sVideoAddress, 0, 80 * 25 * 2);
}
__declspec(noreturn)
void kernel::boot::kloader (multiboot::multiboot_info *multibootheader, unsigned long signature)
{
cls();
}