OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 10:11 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: bad or irreducible absolute expression
PostPosted: Sat Jun 02, 2007 11:52 am 
Offline
Member
Member
User avatar

Joined: Mon Dec 18, 2006 5:49 am
Posts: 94
Location: Netherlands
When compiling my Multiboot header stub, I get this error:

Code:
Error: bad or irreducible absolute expression


It complains about this line:

Code:
.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:
Code:
#define STACK_SIZE 0x4000


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 93 times
Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 02, 2007 5:21 pm 
Offline
Member
Member

Joined: Wed Oct 18, 2006 5:49 am
Posts: 200
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".


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 3:36 am 
Offline
Member
Member
User avatar

Joined: Mon Dec 18, 2006 5:49 am
Posts: 94
Location: Netherlands
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:
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 88 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group