[Solved] GRUB - VM Crashes After 'boot'

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
Ovid
Posts: 22
Joined: Mon Jun 28, 2021 12:48 pm

[Solved] GRUB - VM Crashes After 'boot'

Post 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?
Last edited by Ovid on Thu Jul 08, 2021 5:29 pm, edited 1 time in total.
Ovid
Posts: 22
Joined: Mon Jun 28, 2021 12:48 pm

Re: GRUB - VM Crashes After 'boot'

Post 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!
Post Reply