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.
Bughunter
Member
Posts: 94 Joined: Mon Dec 18, 2006 5:49 am
Location: Netherlands
Contact:
Post
by Bughunter » Sat Jun 02, 2007 11:52 am
When compiling my Multiboot header stub, I get this error:
Code: Select all
Error: bad or irreducible absolute expression
It complains about this line:
Code: Select all
.comm stack, STACK_SIZE, 32 # reserve 16K stack on a quadword boundary
I defined STACK_SIZE (in an external header file, but it doesn't matter if I define it in the same file) with:
Can anyone tell me what could be wrong? I have included my Multiboot stub source codes if anyone wants to have a look.
Thanks
Attachments
multiboot_header.zip
(2.73 KiB) Downloaded 102 times
nick8325
Member
Posts: 200 Joined: Wed Oct 18, 2006 5:49 am
Post
by nick8325 » Sat Jun 02, 2007 5:21 pm
It works here...do you run multiboot_header.S through the preprocessor first? The assembler doesn't know about #defines. gcc will preprocess the file itself, if you run "gcc" instead of "as".
Bughunter
Member
Posts: 94 Joined: Mon Dec 18, 2006 5:49 am
Location: Netherlands
Contact:
Post
by Bughunter » Sun Jun 03, 2007 3:36 am
Hmm that could be it, so I should just call GCC instead of AS?
EDIT: Omg of course... It now works! Thank you!
Oh btw if anyone uses the code I posted above, make sure you correct the Multiboot header checksum (it's invalid) to:
Code: Select all
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)