Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Xen & qemu as dev env 4 gentoo on ARM/Rpis
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1103

PostPosted: Thu Apr 16, 2015 11:36 pm    Post subject: Xen & qemu as dev env 4 gentoo on ARM/Rpis Reply with quote

I plan to get an ARM dev board soon.
I don't wan't to wait for it as I already have some x86 domU enough ready to migrate.

I'd rather have a emulated environment on my lappie.
I plan to have a partition that would be as close as possible to the ARM / partition.
At least a partition fs would be faster than a file.

But was is the smartest way to boot the emulator? Would it require a additional partition, and maybe a pvgrub2 chainload?
I'd love to boot domU with no more partition than for the final project on the ARM board.

I know XEN can be hard, & I'm more of a noob at qemu...
Maybe some (good) advices from you guys though :)

Thks for ur attention.


Last edited by CaptainBlood on Thu Apr 30, 2015 10:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1103

PostPosted: Fri Apr 17, 2015 12:10 am    Post subject: Reply with quote

Maybe i'm going the wrong way according to wiki
Code:
Xen-HVM

Xen, a virtual machine monitor, can run in HVM (hardware virtual machine) mode, using Intel VT-x or AMD-V hardware x86 virtualization extensions and ARM Cortex-A7 and Cortex-A15 virtualization extension.[17] This means that instead of paravirtualized devices, a real set of virtual hardware is exposed to the domU to use real device drivers to talk to.

QEMU includes several components: CPU emulators, emulated devices, generic devices, machine descriptions, user interface, and a debugger. The emulated devices and generic devices in QEMU make up its device models for I/O virtualization.[18] They comprise a PIIX3 IDE (with some rudimentary PIIX4 capabilities), Cirrus Logic or plain VGA emulated video, RTL8139 or E1000 network emulation, and ACPI support.[19] APIC support is provided by Xen.

Xen-HVM has device emulation based on the QEMU project to provide I/O virtualization to the VMs. Hardware is emulated via a QEMU "device model" daemon running as a backend in dom0. Unlike other QEMU running modes (dynamic translation or KVM), virtual CPUs are completely managed to the hypervisor, which takes care of stopping them while QEMU is emulating memory-mapped I/O accesses.
from.which I understand qemu ARM engine would be a daemon in domO providing emulation to requiring & so configured domU.

Thks 4 ur attention.
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1103

PostPosted: Thu Apr 30, 2015 10:20 pm    Post subject: Reply with quote

Hi again,
I decided to turn this thread to a list of milestoned how-to on my way to build a qemu environment for raspberrypis, including latest quad model.

xen + qemu + raspberry is too much a single piece of a cake for me to swallow at once.
So I will try my best reporting each & every step by step along the steep learning curse.

Now let's focus on the qemu + raspberry part.

It all started @ http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
So I ended with a 3.10.26 kernel.
I wanted to be able to build whatever version of the kernel I wished.
So I came to http://xecdesign.com/compiling-a-kernel/ & http://xecdesign.com/compiling-a-kernel/ or https://wiki.aalto.fi/download/attachments/84751497/Building%20Linux%20Kernel%20for%20Raspberry%20Pi.pdf?version=1&modificationDate=1386937627181&api=v2

The patch file provided at xec did'nt work.

So I made my owns, one for 3.10.78 ( stable) and one for 4.0.1 (unstable) as they diverging from each other in this respect.
Code:
kernel-patch # cat linux-arm.patch-3.10.76
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index 1dba368..82fa543 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -4,7 +4,6 @@ menu "Versatile platform type"
 config ARCH_VERSATILE_PB
    bool "Support Versatile Platform Baseboard for ARM926EJ-S"
    default y
-   select CPU_ARM926T
    select MIGHT_HAVE_PCI
    help
      Include support for the ARM(R) Versatile Platform Baseboard
@@ -12,7 +11,6 @@ config ARCH_VERSATILE_PB
 
 config MACH_VERSATILE_AB
    bool "Support Versatile Application Baseboard for ARM926EJ-S"
-   select CPU_ARM926T
    help
      Include support for the ARM(R) Versatile Application Baseboard
      for the ARM926EJ-S.
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 4118436..08861e5 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -71,7 +71,7 @@ config CPU_ARM9TDMI
 
 # ARM920T
 config CPU_ARM920T
-   bool "Support ARM920T processor" if ARCH_INTEGRATOR
+   bool "Support ARM920T processor" if ARCH_INTEGRATOR || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
    select CPU_32v4T
    select CPU_ABRT_EV4T
    select CPU_CACHE_V4WT
@@ -89,7 +89,7 @@ config CPU_ARM920T
 
 # ARM922T
 config CPU_ARM922T
-   bool "Support ARM922T processor" if ARCH_INTEGRATOR
+   bool "Support ARM922T processor" if ARCH_INTEGRATOR || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
    select CPU_32v4T
    select CPU_ABRT_EV4T
    select CPU_CACHE_V4WT
@@ -127,7 +127,7 @@ config CPU_ARM925T
 
 # ARM926T
 config CPU_ARM926T
-   bool "Support ARM926T processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB
+   bool "Support ARM926T processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
    select CPU_32v5
    select CPU_ABRT_EV5TJ
    select CPU_CACHE_VIVT
@@ -135,6 +135,7 @@ config CPU_ARM926T
    select CPU_CP15_MMU
    select CPU_PABRT_LEGACY
    select CPU_TLB_V4WBI if MMU
+   depends on !CPU_V6 && !CPU_V7
    help
      This is a variant of the ARM920.  It has slightly different
      instruction sequences for cache and TLB operations.  Curiously,
@@ -358,7 +359,7 @@ config CPU_PJ4B
 
 # ARMv6
 config CPU_V6
-   bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
+   bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
    select CPU_32v6
    select CPU_ABRT_EV6
    select CPU_CACHE_V6
Code:
kernel-patch # cat linux-arm.patch-4.0.1
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index 1dba368..82fa543 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -4,7 +4,6 @@ menu "Versatile platform type"
 config ARCH_VERSATILE_PB
    bool "Support Versatile Platform Baseboard for ARM926EJ-S"
    default y
-   select CPU_ARM926T
    select MIGHT_HAVE_PCI
    help
      Include support for the ARM(R) Versatile Platform Baseboard
@@ -12,7 +11,6 @@ config ARCH_VERSATILE_PB
 
 config MACH_VERSATILE_AB
    bool "Support Versatile Application Baseboard for ARM926EJ-S"
-   select CPU_ARM926T
    help
      Include support for the ARM(R) Versatile Application Baseboard
      for the ARM926EJ-S.
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 4118436..08861e5 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -71,7 +71,7 @@ config CPU_ARM9TDMI
 
 # ARM920T
 config CPU_ARM920T
-   bool "Support ARM920T processor" if (ARCH_MULTI_V4T && ARCH_INTEGRATOR)
+   bool "Support ARM920T processor" if (ARCH_MULTI_V4T && ARCH_INTEGRATOR) || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
    select CPU_32v4T
    select CPU_ABRT_EV4T
    select CPU_CACHE_V4WT
@@ -89,7 +89,7 @@ config CPU_ARM920T
 
 # ARM922T
 config CPU_ARM922T
-   bool "Support ARM922T processor" if (ARCH_MULTI_V4T && ARCH_INTEGRATOR)
+   bool "Support ARM922T processor" if (ARCH_MULTI_V4T && ARCH_INTEGRATOR) || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
    select CPU_32v4T
    select CPU_ABRT_EV4T
    select CPU_CACHE_V4WT
@@ -127,7 +127,7 @@ config CPU_ARM925T
 
 # ARM926T
 config CPU_ARM926T
-   bool "Support ARM926T processor" if (!ARCH_MULTIPLATFORM || ARCH_MULTI_V5) && (ARCH_INTEGRATOR || MACH_REALVIEW_EB)
+   bool "Support ARM926T processor" if ((!ARCH_MULTIPLATFORM || ARCH_MULTI_V5) && (ARCH_INTEGRATOR || MACH_REALVIEW_EB)) || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
    select CPU_32v5
    select CPU_ABRT_EV5TJ
    select CPU_CACHE_VIVT
@@ -135,6 +135,7 @@ config CPU_ARM926T
    select CPU_CP15_MMU
    select CPU_PABRT_LEGACY
    select CPU_TLB_V4WBI if MMU
+   depends on !CPU_V6 && !CPU_V7
    help
      This is a variant of the ARM920.  It has slightly different
      instruction sequences for cache and TLB operations.  Curiously,
@@ -358,7 +359,7 @@ config CPU_PJ4B
 
 # ARMv6
 config CPU_V6
-   bool "Support ARM V6 processor" if (!ARCH_MULTIPLATFORM || ARCH_MULTI_V6) && (ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX)
+   bool "Support ARM V6 processor" if ((!ARCH_MULTIPLATFORM || ARCH_MULTI_V6) && (ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX)) || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
    select CPU_32v6
    select CPU_ABRT_EV6
    select CPU_CACHE_V6
Both patches applied succesfully, though I only compiled 4.0.1 which the 2014-09-09-wheezy-raspbian.img booted on fine.
For Kernel options I just applied xec's check list with no optionnal settings.
I've had a bmc??? module not loading @ boot, but this more likely to belong to future part: Kernel Optimizing or Interfacing Quemu with host (sound - network).

At least we have a method to generate a qemu compatible arm kernel strictly generated in a x86/amd64 env.

Thks 4 ur attention
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum