Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] Kernel panic while trying to boot qemu_x86_64_defconfig on notebook with dual boot.
Date: Fri, 16 Oct 2015 08:05:59 +0200	[thread overview]
Message-ID: <562093C7.9000501@mind.be> (raw)
In-Reply-To: <CAAmaERMLtspQ2X-rSM_jaFGyqp_Gw1z6zOiPv=S9pZML=YjH-A@mail.gmail.com>

 Hi Alexandre,

 I think you fail to understand what QEMU does. It emulates a complete PC. In
other words...

On 16-10-15 04:41, Alexandre Oliveira wrote:
> Hello everyone.
> 
> I am having a problem while trying to boot qemu_x86_64_defconfig on my notebook.
> My configuration is really simple. The .config file is attached.
> 
> Following the manual, I first tried to boot and run my configuration with QEMU,
> using the command: 
> 
> ============
> $ qemu-system-x86_64 -M pc -kernel images/bzImage -drive
> file=images/rootfs.ext2,if=ide -append root=/dev/sda -net nic,model=rtl8139 -net
> user

 ... it will take images/rootfs.ext2 and present it to the guest (= the
buildroot Linux) as if it's a complete hard disk. All the rest of your host
system (= your Ubuntu) is completely invisible to the guest. Similarly, the
guest will see an RTL8139 network interface even though you probably have a
completely different network card in your PC. The guest can only access things
that you explicitly pass to qemu.

> ============
> 
> This command works properly and Linux boots normally. After that, I created a
> ext4 partition on /dev/sda7, which I mapped on /mnt/btlinux/
> 
> ==================
> $ sudo tar -C /mnt/btlinux/ -xf images/rootfs.tar
> ==================

 To pass this to qemu, you could unmount /mnt/btlinux and then start qemu with:

qemu-system-x86_64 -M pc -kernel images/bzImage -drive file=/dev/sda7,if=ide
-append root=/dev/sda -net nic,model=rtl8139 -net user

i.e., replace images/rootfs.ext2 with /dev/sda7. This gives the guest direct
access to a single partition of your hard drive. Note that it is a very bad idea
to give the guest access to a mounted partition, since you'll have two OSes that
try to read and write it simultaneously and they'll have a different idea of
what is on there.

> 
> 
> All files were correctly extracted to the partition. Then, I added one more boot
> option on GRUB.cfg file.

 In fact, with the -kernel command line option, grub isn't even used. That's why
you don't see a menu and it starts Linux immediately.

[snip]

> 1 - Why QEMU boot work properly and when I extract the same image to /dev/sda7,
> the boot fails? 
> 2 - What is QEMU doing that the 'normal boot' process are not doing? 
> 3 - Why the file at /boot/bzImage can be found but the device /dev/sda7 can not?
> 4 - Am I missing something?

 Does this explain all your questions?

 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

  reply	other threads:[~2015-10-16  6:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16  2:41 [Buildroot] Kernel panic while trying to boot qemu_x86_64_defconfig on notebook with dual boot Alexandre Oliveira
2015-10-16  6:05 ` Arnout Vandecappelle [this message]
2015-10-16  9:33   ` Alexandre Oliveira
2015-10-16  9:55     ` Arnout Vandecappelle
2015-10-17  1:51       ` Alexandre Oliveira
2015-10-20  0:33         ` Alexandre Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562093C7.9000501@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox