Page 1 of 1

A simple multiboot TestSuit but GRUB said NO!?

Posted: Wed Jan 31, 2007 2:14 pm
by hendric
I wrote:

Code: Select all

BITS 32

ORG 0x100000

SECTION .text

jmp _RealStart

ALIGN 4

MultiBootHeader:
	;Header Field
	Magic		DD	0x1BADB002
	Flags		DD	0x00000001
	CheckSum	DD	-(0x1BADB002+0x00000001)
	
	;Address Field
	HeadAddr	DD	MultiBootHeader
	LoadAddr	DD	0x100000
	LoadEndAddr	DD	0x00000000
	BssEndAddr	DD	0x00000000
	Entry		DD	_RealStart

_RealStart:
	cli
	hlt
And compiled via nasm with : nasmw -fbin -o Helper Helper.ASM

while booting via GRUB 0.95 with : kernel --type=multiboot it just said :
Error 13: Invalid or Unsupported executable format

Why?

Posted: Wed Jan 31, 2007 2:21 pm
by hendric
Sigh I've solved. After reading Spec carefully I found :
12 u32 header_addr if flags[16] is set

16 u32 load_addr if flags[16] is set

20 u32 load_end_addr if flags[16] is set

24 u32 bss_end_addr if flags[16] is set

28 u32 entry_addr if flags[16] is set
That's to say , I MUST set bit 16 of FLAGS aimed in telling GRUB how to boot ..

Sigh , just fuking my stupid question :(

Hmm...multiboot PE kernel sounds possible implementing ....