My computer isn't with me, so I can't post source, but I will when I get home.
There is a true entry point that starts with the multiboot loader (same as any tutorial). There are other source files that ARE compiled, but they aren't referenced and just take up code space.
Visual Studio 2010 / C++ would be the compiler that I'm using, and the project SHOULD be set up properly. By failing, it doesn't clear the screen. Can't tell if it's actually died or not... it doesn't clear the GRUB screen, I continuously see 'Starting Kernel' or so.
The stack appears to be set up, as it is in one of the tutorials,
Code: Select all
__declspec(naked) void __multiboot_entry__(void)
{
__asm {
multiboot_header:
dd(0x1BADB002) ; magic
dd(1 << 16) ; flags
dd(-(0x1BADB002 + (1 << 16))) ; checksum
dd(0x00101000) ; header_addr
dd(0x00101000) ; load_addr
dd(0x0010200F) ; load_end_addr
dd(0x0010200F) ; bss_end_addr
dd(0x00101030) ; entry_addr
dd(0x00000000) ; mode_type
dd(0x00000000) ; width
dd(0x00000000) ; height
dd(0x00000000) ; depth
kernel_entry:
mov esp, KERNEL_STACK
xor ecx, ecx
push ecx
popf
push eax
push ebx
call kernel::boot::kloader
jmp $
}
}
is fairly equivalent to my header.
An odd thing to note is that other times, when I had fewer/different functions in my source files, it would work, even calling functions. Then I add one more function, and it fails. The file itself, compiled, is 12KiB.
I also made a mistake on the code above... second block should be
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();
}
I left out the cls() call. And if I put the clearing loop after cls(), it still fails.