Strange thing with cross compiler
-
- Member
- Posts: 102
- Joined: Wed Oct 20, 2021 6:00 pm
- Location: Paraguay
Strange thing with cross compiler
Hi,
Now I'm trying to develop 64-bit OS. But I got a strange thing when compiling: When I use x86_64-elf-gcc or x86_64-elf-ld, GRUB shown this error:
When I change to system compiler, it's back to normal. Can anyone explain this for me?
Now I'm trying to develop 64-bit OS. But I got a strange thing when compiling: When I use x86_64-elf-gcc or x86_64-elf-ld, GRUB shown this error:
When I change to system compiler, it's back to normal. Can anyone explain this for me?
Re: Strange thing with cross compiler
Your image is broken, so we can't see the error message.
But, are you perhaps using some libc function?
But, are you perhaps using some libc function?
Last edited by iansjack on Sat Dec 11, 2021 7:48 am, edited 1 time in total.
-
- Member
- Posts: 102
- Joined: Wed Oct 20, 2021 6:00 pm
- Location: Paraguay
Re: Strange thing with cross compiler
I used grub-file --is-x86-multiboot2 to check the binary and there is no multiboot in binary file. So i don't think the image i broken.iansjack wrote:Your image is broken.
Re: Strange thing with cross compiler
The image you tried to post of the error message.
-
- Member
- Posts: 102
- Joined: Wed Oct 20, 2021 6:00 pm
- Location: Paraguay
Re: Strange thing with cross compiler
Oh,iansjack wrote:The image you tried to post of the error message.
It said: "Multiboot header not found"
Re: Strange thing with cross compiler
It's impossible to say what the problem is without seeing your code, your linker file, and the exact commands you are using. Can you link to an on-line repository of your code. Something in this thread may help: viewtopic.php?f=1&t=33521
Re: Strange thing with cross compiler
Are you using multiboot or multiboot2?
-
- Member
- Posts: 102
- Joined: Wed Oct 20, 2021 6:00 pm
- Location: Paraguay
Re: Strange thing with cross compiler
I'm using multiboot2.deadmutex wrote:Are you using multiboot or multiboot2?
-
- Member
- Posts: 102
- Joined: Wed Oct 20, 2021 6:00 pm
- Location: Paraguay
Re: Strange thing with cross compiler
Here is my repo: https://github.com/NeonLightions/Amore-OS-x64. The header is at src/boot/grub/header.S, the _start function is at src/sys/_start.S and the linker is at scripts/linker.ldiansjack wrote:It's impossible to say what the problem is without seeing your code, your linker file, and the exact commands you are using. Can you link to an on-line repository of your code. Something in this thread may help: viewtopic.php?f=1&t=33521
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Strange thing with cross compiler
That's the wrong LD. Also, you might need to use "-z max-page-size=0x1000" to tell LD that it shouldn't add a bunch of padding to your kernel.
-
- Member
- Posts: 102
- Joined: Wed Oct 20, 2021 6:00 pm
- Location: Paraguay
Re: Strange thing with cross compiler
Thank you very much! Now I can use cross linker.Octocontrabass wrote:That's the wrong LD. Also, you might need to use "-z max-page-size=0x1000" to tell LD that it shouldn't add a bunch of padding to your kernel.