64? 32? Grub having special issues? HELP!
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
64? 32? Grub having special issues? HELP!
I was working on my OS for a while, but then I updated my system to 64 bit.
Now when I load grub and select my OS, it says Unrecognized File Format. WHAT IS GOING ON HERE!?!
Now when I load grub and select my OS, it says Unrecognized File Format. WHAT IS GOING ON HERE!?!
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: 64? 32? Grub having special issues? HELP!
I don't know how GRUB works on x86-64, but my guess is that it tries to find the ELF headers for 64-bits executables, since it detects the presence of a 64-bit CPU...piranha wrote:I was working on my OS for a while, but then I updated my system to 64 bit.
Now when I load grub and select my OS, it says Unrecognized File Format. WHAT IS GOING ON HERE!?!
But I have no idea of the operating environment after booting a multiboot kernel on a x86-64... does it start directly in long mode?
Doesn't look like a good idea because of the backwards compatibility...
JJ
GRUB (at least the current version of it) does not support elf64 multiboot images; in fact the current multiboot standard states that it is intended for 32-bit kernels.
With that being said, nothing prevents you from creating a 32-bit "loader" kernel that simply loads your 64-bit kernel into memory, sets up long mode, and jumps into your 64-bit code. For that matter, you could pass your 64-bit kernel as a module.
With that being said, nothing prevents you from creating a 32-bit "loader" kernel that simply loads your 64-bit kernel into memory, sets up long mode, and jumps into your 64-bit code. For that matter, you could pass your 64-bit kernel as a module.
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Can I have a look at your code to get an idea? You don't have to give it to me if you don't want, but since i am not that great at assembly I would have no idea where to beginMy boot loader does support 64-bit ELF images but doesn't even come close to GRUB for features. It's not that hard to add, but for the level of complexity of GRUB, it's not easy.
thx!!
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
i am sorry, but I have absolutely no idea what that means. Could you explain please?
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
http://atlantisos.svn.sourceforge.net/v ... oot/setup/piranha wrote:Can I have a look at your code to get an idea? You don't have to give it to me if you don't want, but since i am not that great at assembly I would have no idea where to beginMy boot loader does support 64-bit ELF images but doesn't even come close to GRUB for features. It's not that hard to add, but for the level of complexity of GRUB, it's not easy.
thx!!
The idea is, the boot loader (directory above this) loads all the files and such, then switches into the right mode (so the long mode switch is in that directory too), and then passes control to this code. This code loads an elf file of the type of which it itself is compiled.
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Thanks, it works
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io