grub2 does not load my kernel?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

grub2 does not load my kernel?

Post by mrjbom »

Hello!
I compile kernel in elf format called kernel-0, and move it to the iso/boot folder, where I create the grub folder and the grub.cfg with such content:

grub.cfg

Code: Select all

menuentry 'kernel 0' {
	set root='hd0,msdos1'
	multiboot /boot/kernel-0 ro
}
When I try to boot from it I see a grub window where I can select kernel-0, if I select it I see the error "unknown filesystem".

Previously, my iso image would immediately run kernel.h and everything worked
(due to the fact that I have no brains, I deleted the files that were responsible for normal operation .ISO image)
Attachments
Скриншот 16-10-2019 232545.png
Скриншот 16-10-2019 232545.png (5.71 KiB) Viewed 2297 times
User avatar
iansjack
Member
Member
Posts: 4705
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: grub2 does not load my kernel?

Post by iansjack »

Delete the "set root" line and the "ro" from the end of the next line. You are not using a hard disk.
User avatar
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

Re: grub2 does not load my kernel?

Post by mrjbom »

iansjack wrote:Delete the "set root" line and the "ro" from the end of the next line. You are not using a hard disk.
Thanks you.
User avatar
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

Re: grub2 does not load my kernel?

Post by mrjbom »

iansjack wrote:Delete the "set root" line and the "ro" from the end of the next line. You are not using a hard disk.
Hey, please tell me how to load the kernel by default, and not choose it manually?
User avatar
iansjack
Member
Member
Posts: 4705
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: grub2 does not load my kernel?

Post by iansjack »

add the lines

Code: Select all

set default=0
set timeout=0
at the head of the file (before "menuentry").

You should consult the grub documentation for more details.
User avatar
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

Re: grub2 does not load my kernel?

Post by mrjbom »

iansjack wrote:add the lines

Code: Select all

set default=0
set timeout=0
at the head of the file (before "menuentry").

You should consult the grub documentation for more details.
Thanks.
Post Reply