OSDev.org
https://forum.osdev.org/

Grub2 file loading help
https://forum.osdev.org/viewtopic.php?f=1&t=35780
Page 1 of 1

Author:  moonsheep [ Sat Oct 26, 2019 1:15 pm ]
Post subject:  Grub2 file loading help

Hello everyone,
so I have been developing a 32-bit (it later will switch into 64-bit mode) kernel that is multiboot2 compilant.
Now everything works amazingly on a grub-rescue iso image that's booted in qemu, however, when I use grub
to boot the system from my actual computer it seems to fail to load the file for some reason.
Here is the grub command sequence:
Code:
set root='(hd0,9)'
search --no-floppy --fs-uuid --set=root 5a59c03c-d0a7-4677-b166-a7caebc87b0a
multiboot2 /jnix
boot

It seems as though it finds the file just fine, however on the "multiboot2" command it errors out saying:
error: not a regular file
Now I don't quite understand this, since my kernel is clearly not a symlink or a directory, and it boots
fine from the rescue ISO.
Am I misisng something here?
Thank you in advance!

Author:  Octocontrabass [ Sun Oct 27, 2019 8:52 am ]
Post subject:  Re: Grub2 file loading help

Which filesystem on your computer has the UUID 5a59c03c-d0a7-4677-b166-a7caebc87b0a? Is it the one where your kernel is located?

Author:  moonsheep [ Sun Oct 27, 2019 1:17 pm ]
Post subject:  Re: Grub2 file loading help

Yeah, I'm sorry I didn't clarify that.
It's on /dev/sda9 and as said, it seems to be nicely found by the search command.
Do you have any ideas why would grub not load my kernel?
The weirdest thing really is grub recognizing it as not a "regular file", because it IS indeed a regular file and works pretty well with a rescue disk (in the rescue disk there's only one partition with both GRUB and my kernel in it).

Author:  Octocontrabass [ Tue Oct 29, 2019 3:57 am ]
Post subject:  Re: Grub2 file loading help

Have you verified (with "ls -l" or similar) that it actually is a regular file on sda9?

Author:  moonsheep [ Wed Oct 30, 2019 2:54 am ]
Post subject:  Re: Grub2 file loading help

Yep, I did that
Attachment:
Screenshot from 2019-10-30 09-50-08.png
Screenshot from 2019-10-30 09-50-08.png [ 4.8 KiB | Viewed 2204 times ]

Attachment:
Screenshot from 2019-10-30 09-53-08.png
Screenshot from 2019-10-30 09-53-08.png [ 31.59 KiB | Viewed 2204 times ]

Author:  Octocontrabass [ Wed Oct 30, 2019 3:45 am ]
Post subject:  Re: Grub2 file loading help

Does your installation of GRUB support the filesystem you're using on sda9? It might not work if it's not the same filesystem as your /boot partition.

Is your disk bigger than 2TB? GRUB might not be too happy if sda9 is somewhere outside the first 2TB of the disk.

Author:  iansjack [ Wed Oct 30, 2019 4:24 am ]
Post subject:  Re: Grub2 file loading help

Have you tried running
Code:
grub-file --is-x86-multiboot2
on the fie?

Are you sure that the multiboot2 grub module exists on your disk and that it is a regular file?

Have you tried loading it explicitly in grub.cfg?

Author:  moonsheep [ Tue Nov 05, 2019 1:06 pm ]
Post subject:  Re: Grub2 file loading help

iansjack wrote:
Have you tried running
Code:
grub-file --is-x86-multiboot2
on the fie?

It outputs nothing. Is this normal?
iansjack wrote:
Are you sure that the multiboot2 grub module exists on your disk and that it is a regular file?

Yep, I'm pretty sure.
iansjack wrote:
Have you tried loading it explicitly in grub.cfg?

Yeah, I did that too, and got the same error message.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/