Page 1 of 1

grub2 does not load my kernel?

Posted: Wed Oct 16, 2019 2:30 pm
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)

Re: grub2 does not load my kernel?

Posted: Wed Oct 16, 2019 2:38 pm
by iansjack
Delete the "set root" line and the "ro" from the end of the next line. You are not using a hard disk.

Re: grub2 does not load my kernel?

Posted: Wed Oct 16, 2019 2:42 pm
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.

Re: grub2 does not load my kernel?

Posted: Wed Oct 16, 2019 11:30 pm
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?

Re: grub2 does not load my kernel?

Posted: Thu Oct 17, 2019 1:04 am
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.

Re: grub2 does not load my kernel?

Posted: Thu Oct 17, 2019 1:32 am
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.