OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 10:03 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Solved] GRUB - VM Crashes After 'boot'
PostPosted: Thu Jul 08, 2021 1:56 pm 
Offline

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

Top
 Profile  
 
 Post subject: Re: GRUB - VM Crashes After 'boot'
PostPosted: Thu Jul 08, 2021 2:16 pm 
Offline

Joined: Mon Jun 28, 2021 12:48 pm
Posts: 22
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:
# 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/43370326/unable-to-boot-a-custom-kernel-in-virtualbox-could-not-read-from-boot-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:
.bss : ALIGN(4096)
{
     *(.bss)
}


And it fixed the problem!


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 74 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