OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:41 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Grub2 file loading help
PostPosted: Sat Oct 26, 2019 1:15 pm 
Offline

Joined: Sat Oct 26, 2019 1:04 pm
Posts: 4
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!


Top
 Profile  
 
 Post subject: Re: Grub2 file loading help
PostPosted: Sun Oct 27, 2019 8:52 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
Which filesystem on your computer has the UUID 5a59c03c-d0a7-4677-b166-a7caebc87b0a? Is it the one where your kernel is located?


Top
 Profile  
 
 Post subject: Re: Grub2 file loading help
PostPosted: Sun Oct 27, 2019 1:17 pm 
Offline

Joined: Sat Oct 26, 2019 1:04 pm
Posts: 4
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).


Top
 Profile  
 
 Post subject: Re: Grub2 file loading help
PostPosted: Tue Oct 29, 2019 3:57 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
Have you verified (with "ls -l" or similar) that it actually is a regular file on sda9?


Top
 Profile  
 
 Post subject: Re: Grub2 file loading help
PostPosted: Wed Oct 30, 2019 2:54 am 
Offline

Joined: Sat Oct 26, 2019 1:04 pm
Posts: 4
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 2180 times ]

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


Top
 Profile  
 
 Post subject: Re: Grub2 file loading help
PostPosted: Wed Oct 30, 2019 3:45 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
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.


Top
 Profile  
 
 Post subject: Re: Grub2 file loading help
PostPosted: Wed Oct 30, 2019 4:24 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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?


Top
 Profile  
 
 Post subject: Re: Grub2 file loading help
PostPosted: Tue Nov 05, 2019 1:06 pm 
Offline

Joined: Sat Oct 26, 2019 1:04 pm
Posts: 4
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.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 80 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