On 08/08/2017 10:22, sanjeev wrote:
Hi

I come from the windows world and my experience with all things linux is
pretty limited. Trying to improve upon the same and understand and learn a
few low level concepts about platform bringup, boot steps etc along with
ARMv8 using Qemu.

I have a few questions regarding the same:

Question 1)

I was told that I shouldn't use the -kernel option if I am running a bare
metal code. I just created a file with a reset handler located at address
Zero using a linker file and ran it with *qemu-system-aarch64 -s -S
-machine virt -cpu cortex-a53 -kernel test.elf* and I could get my reset
handler break point hit. Does qemu place my code at address zero in the
system memory map and starts executing it but address 0x0 is reserved for
boot flash as you mentioned earlier. Also is there a different option other
than -kernel for bare metal.
I believe something passed to -kernel and -initrd will be loaded
according to the (emulated) platform specific way in which a Linux
kernel would be loaded.  Documentation for that may be found in the
"arch" subdirectory of the cross-platform Linux kernel sources from
kernel.org and/or in the "doc" subdirectory of said sources.Once the
(emulated) machine hands over execution to that "Linux kernel", the
code is no longer required to act as if it was Linux.

Question 2)

What exactly is virtio in Qemu virt board emulation. In qemu source virt.c,
there's a system memory map with memory mapped range for PCIe. How is this
to be used. Does qemu have any option to plug a PCIe device into the
configuration and use the PCI address map range. I have limited knowledge
of these lower level details. Trying to learn theconcepts of how a board is
brought up in general along with some ARMv8 concepts.
virtio is a set of completely fictional "hardware" devices that only exist
in qemu-emulated virtual machines, and which are optimized for that
implementation scenario rather than for being implemented with real hardware.

This means that if an OS or bare metal program has an equally well written
virtio device driver, this will typically outperform any emulation of similar
real world hardware such as an AHCI-compliant SATA controller or a 16450-
compatible serial port controller. Some virtio devices even perform functions that make no sense on real hardware, such as handing some of the assigned RAM
back to the host machine.

Most virtio devices will appear in the list of devices found via platform-
standard enumeration mechanisms such as the PCI bus hardware detection
mechanism.


Thanks and Regards
Sanjeev


Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded


Reply via email to