A simple multiboot TestSuit but GRUB said NO!?

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.
Post Reply
hendric
Member
Member
Posts: 38
Joined: Sat Oct 21, 2006 10:56 am
Location: China

A simple multiboot TestSuit but GRUB said NO!?

Post 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?
Just Lazy Writing Anything...
hendric
Member
Member
Posts: 38
Joined: Sat Oct 21, 2006 10:56 am
Location: China

Post 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 ....
Just Lazy Writing Anything...
Post Reply