Page 1 of 1

[Solved] GRUB - VM Crashes After 'boot'

Posted: Thu Jul 08, 2021 1:56 pm
by Ovid
Hello,
The bootloader I use is grub.
When grub is booting the OS, the VM crashes, with a message about virtual CPU shutdown.

Here is the 'grub.cfg' file:

Code: Select all

# Nobody knows what these lines do:
set timeout=3
set default=0

# Set the name of the OS in the boot menu:
menuentry "LearnOS" {
    multiboot2 /boot/kernel.bin  # Set the binary in this location.
    boot
}
What could cause this problem?

Re: GRUB - VM Crashes After 'boot'

Posted: Thu Jul 08, 2021 2:16 pm
by Ovid
Ovid wrote: Hello,
The bootloader I use is grub.
When grub is booting the OS, the VM crashes, with a message about virtual CPU shutdown.

Here is the 'grub.cfg' file:

Code: Select all

# Nobody knows what these lines do:
set timeout=3
set default=0

# Set the name of the OS in the boot menu:
menuentry "LearnOS" {
    multiboot2 /boot/kernel.bin  # Set the binary in this location.
    boot
}
What could cause this problem?
OK, I found out from this https://stackoverflow.com/questions/433 ... oot-medium stackoverflow page that if the .bss section is too big, grub crashes.

So in the kernel script I changed the allignment of the .bss section:

Code: Select all

.bss : ALIGN(4096)
{
     *(.bss)
}
And it fixed the problem!