qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Boot Process of AArch64 Virtual Machine


From: Peter Maydell
Subject: Re: [Qemu-discuss] Boot Process of AArch64 Virtual Machine
Date: Tue, 7 Nov 2017 15:55:54 +0000

On 7 November 2017 at 15:05, Taylor Holberton
<address@hidden> wrote:
> Yesterday I wrote a simple boot sector that goes into an infinite loop. I
> produced a flat binary, with the text section starting at 0x00.
>
> The binary appeared to work when running this:
>
> qemu-system-aarch64 -machine connex -drive
> if=flash,format=raw,file=flash.img

This command line is actually running a 32 bit CPU -- the 'connex'
machine defaults to a 32 bit CPU (and won't work with a 64-bit one).

> But when switching to -machine virt, qemu starts and enters the menu prompt.

What menu prompt? What command line are you using?
Note that if you want a 64-bit CPU you will need to
use the "-cpu cortex-a57" option to request one.

> Why is it going straight into the menu prompt? What do I have to do to get
> a minimal boot sector running on the virt machine?

For 'virt' you have two options, neither of which starts by
executing a boot sector:

(1) use -kernel and provide a (usually) Linux kernel binary,
which expects to be invoked in the usual way for a 64-bit
Linux kernel image, including being passed a device tree
blob which tells it where the devices are

(2) use -bios or -flash and provide an image that expects
to reside in the flash at address 0 (and to be passed a
device tree blob in the RAM starting at 0x40000000 to tell
it where the devices are). The usual bios people use is UEFI.

If you really want to write a boot sector in particular
then you'd need to use a UEFI image, which should try
to boot from a disk image in the usual way for UEFI.

In general "virt" isn't designed to be easy to use as a
bare metal target: it's aimed at being a good board for
KVM virtual machines, so we expect guest code to be capable
of reading a device tree, and using PCI devices for disk
and networking.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]