OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:50 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Bare Bones boot.s compiling
PostPosted: Fri Dec 09, 2016 6:25 pm 
Offline

Joined: Fri Dec 09, 2016 6:19 pm
Posts: 2
I've been trying to get a start in os development and I was testing out the Bare Bones tutorial but there was an issue.


Boot.s wouldn't compile.


Line 56:

Code:
mov $stack_top, %esp


ERROR:
Code:
$ i686-elf-as boot.s -o boot.o
boot.s: Assembler messages:
boot.s:56: Error: no instruction mnemonic suffix given and no register operands; can't size instruction



What would I do to get this working?


Top
 Profile  
 
 Post subject: Re: Bare Bones boot.s compiling
PostPosted: Sat Dec 10, 2016 3:16 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Clearly the error message is wrong as there is a register operand in that line (%esp).

That leads me to believe that there must be an error in your source code. Check it carefully to make sure there are no spaces or hidden characters where there shouldn't be.

I have just cut-and-pasted the source from the wiki and it assembles just fine on my system. (It actually consists of just 5 instructions.)


Top
 Profile  
 
 Post subject: Re: Bare Bones boot.s compiling
PostPosted: Sat Dec 10, 2016 4:51 am 
Offline
Member
Member

Joined: Sun Oct 09, 2016 4:38 am
Posts: 273
iansjack wrote:
Clearly the error message is wrong as there is a register operand in that line (%esp).

That leads me to believe that there must be an error in your source code. Check it carefully to make sure there are no spaces or hidden characters where there shouldn't be.

I have just cut-and-pasted the source from the wiki and it assembles just fine on my system. (It actually consists of just 5 instructions.)


It does work on my system, too.
My idea was that the GCC was not made correctly.
If you're running Windows, you can use ghost-i686-elf-tools.

_________________
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS


Top
 Profile  
 
 Post subject: Re: Bare Bones boot.s compiling
PostPosted: Sat Dec 10, 2016 9:19 am 
Offline

Joined: Fri Dec 09, 2016 6:19 pm
Posts: 2
iansjack wrote:
Clearly the error message is wrong as there is a register operand in that line (%esp).

That leads me to believe that there must be an error in your source code. Check it carefully to make sure there are no spaces or hidden characters where there shouldn't be.

I have just cut-and-pasted the source from the wiki and it assembles just fine on my system. (It actually consists of just 5 instructions.)


I retyped the code without the comments, it was probably just some commenting whitespace error. Thanks mate!


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: thewrongchristian and 34 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group