OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:49 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: GRUB2 fails to load kernel in bochs and VirtualBox
PostPosted: Mon Dec 23, 2013 10:41 am 
Offline
User avatar

Joined: Sun Dec 30, 2012 12:52 pm
Posts: 13
Hello,

I am using GRUB2 to boot my kernel, and this always works in qemu. But when I use bochs or VirtualBox, it only works if its built for x86. If I build it for x86_64, it doesn't successfully load the kernel.

Using `debug=all` this is what GRUB2 stalls at:
Code:
kern/dl.c:619: module name: relocator
kern/dl.c:620: init function: 0x0
kern/disk.c:196: Opening `hd96'...
kern/fs.c:56: Detecting iso9660...
kern/disk.c:295: Closing `hd96'.
kern/dl.c:572: module at 0x1f6db30, size 0x8e8
kern/dl.c:596: relocating to 0x1f6ebc0
kern/dl.c:560: flushing 0x6fe bytes at 0x1f6e490
kern/dl.c:619: module name: lsapm
kern/dl.c:620: init function: 0x1f6e664
kern/disk.c:196: Opening `hd96'...
kern/fs.c:56: Detecting iso9660...
kern/disk.c:295: Closing `hd96'.
kern/dl.c:572: module at 0x1f6b0f0, size 0x26d0
kern/dl.c:596: relocating to 0x1f6e3f0
kern/dl.c:560: flushing 0x24bb bytes at 0x1f52890
kern/dl.c:619: module name: acpi
kern/dl.c:620: init function: 0x1f53862
kern/dl.c:560: flushing 0x31cf bytes at 0x1f6a5f0
kern/dl.c:619: module name: multiboot2
kern/dl.c:620: init function: 0x1f6b184
kern/disk.c:196: Opening `hd96'...
kern/fs.c:56: Detecting iso9660...
lib/relocator.c:115: relocators_size=7


And the last lines of output from bochs:
Code:
00017896941i[BIOS ] Booting from 07c0:0000
00017905792i[MEM0 ] allocate_block: block=0x1 used 0x3 of 0x20
00048688780i[MEM0 ] allocate_block: block=0x1e used 0x4 of 0x20


Does anyone know what is happening/if I did anything wrong? I will provide boot code if needed, but it SEEMS as if it doesn't even make it to that point at all.

Any help on this problem would be greatly appreciated.

_________________
Lambda OS:
GitHub: https://github.com/farlepet


Top
 Profile  
 
 Post subject: Re: GRUB2 fails to load kernel in bochs and VirtualBox
PostPosted: Sat Jan 04, 2014 9:29 pm 
Offline

Joined: Thu May 09, 2013 5:51 pm
Posts: 14
Try using a 32bit bootstrap for your 64bit code.


Top
 Profile  
 
 Post subject: Re: GRUB2 fails to load kernel in bochs and VirtualBox
PostPosted: Sat Jan 04, 2014 11:40 pm 
Offline
User avatar

Joined: Sun Dec 30, 2012 12:52 pm
Posts: 13
You do mean start in 32-bit mode and then jump into 64-bit mode, correct? If so, I already do that. GRUB will always hand control to the kernel in 32-bit mode regardless of the bittiness of the ELF, correct?

_________________
Lambda OS:
GitHub: https://github.com/farlepet


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

All times are UTC - 6 hours


Who is online

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