Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jun 2015 01:47:25 +0300
From:      Mihai Carabas <mihai.carabas@gmail.com>
To:        soc-status@freebsd.org
Subject:   Re: [GSOC] bhyve port on ARM - weekly status report
Message-ID:  <CANg1yUvgvtp5asPXLmtjwkROZ4Kf=mrOxXFcwvwdseYoQkcivA@mail.gmail.com>
In-Reply-To: <CANg1yUspT8uHtX4bu0kO5dWLssvv-5457kSBovdyNKpi-OQ1kw@mail.gmail.com>
References:  <CANg1yUspT8uHtX4bu0kO5dWLssvv-5457kSBovdyNKpi-OQ1kw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi everyone,

On Mon, Jun 1, 2015 at 9:48 PM, Mihai Carabas <mihai.carabas@gmail.com>
wrote:

> Hi,
>
> My name is Mihai Carabas and this year's edition of GSoC I will work on
> porting bhyve on ARM-based platforms (last year I've worked on bhyve
> instruction caching [1]).
>
> I've created a wiki page where I've describe the project and the
> milestones [2].
>
> This week I've started preparing the development infrastructure. We've
> switched from Exynos5 development board initially proposed with FastModels
> emulator, the Versatile Express board (CortexA15 model:
> FVP_VE_Cortex-A15x1) because we need advanced debug features which was not
> possible on the Exynos5 board without having acces to a JTAG-like device.
>
> Next I've started creating a new config for the VersatileExpress platform
> with minimal config options. I've also copied the DTS files for
> VersatileExpress from linux-arm.org [3] and compiled them directly into
> the kernel image. All these are pushed in my SVN repo [4].
>
> The ARM guys have a boot-wrapper to use it with the FastModels emulator
> (instead of u-boot). I've pulled this wrapper from [5] and cross-compiled
> it to obtain the image of the boot-wrapper which instead will load the
> FreeBSD kernel. I will come with a detailed feedback after I will manage to
> boot up FreeBSD on Versatile Express emulated platform.
>
> I've loaded the boot-wrapper image into the FastModel emulator. I've also
given some custom parameters to load the kernel binary (kernel.bin
generated by the build system) at physical address 0XC0004000 (the same as
the virtual address). I've modified the original physical address in order
to make the VA==PA and have a match between the dissambled code shown by
Model Debugger and the C code even if I had no MMU (to make debugging
easier until the MMU gets activated). In order to be able to debug in Model
Debugger, I've loaded the kernel.debug ELF file just for debug purposes (I
have this option). Even if I did this trick, the ASM instructions didn't
match the C code loaded by the Model Debugger. After manually dumping the
kernel.debug ELF file I've seen that the text area is shifted with 0x180 at
0xC0004000, being different than the start of the kernel text area. Peter
noticed that ldscript.arm has an offset added before the .text section ( .
= KERNVIRTADDR + SIZEOF_HEADERS;). I've removed the SIZEOF_HEADERS and now
the C code matched with the ASM one.

Further I've been executing step by step until the MMU gets activated for
the first time (init_mmu) in the locore-v6 with the primitive page table (a
64MB zone mapped from the begining of the kernel). The simulation was
failing when activating the second time the MMU (after building the kernel
page table using the pmap). This was caused by the chosen physical address
C0008000. The locore-v6 code was alligning this address at 1MB boundary
thus the kernel start became C0000000, instead of C0004000. The C0000000
was passed to the arm_physmem_kernaddr variable with in turn was used
for  KERNEL_P2V
macro, thus creating invalid mappings. After modifying in the boot-wrapper
the address where the kernel text is loaded at C0200000 the problem was
solved (I've used the 4000 offset initially because this was configured by
the boot-wrapper).

Now I've managed to boot-up the FreeBSD kernel until the console init
function in initarm (cninit function). Further I'm trying to build an
early_putc function using the semihosting feature exposed by the emulator
until I get the console up.

Thank you,
Mihai



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANg1yUvgvtp5asPXLmtjwkROZ4Kf=mrOxXFcwvwdseYoQkcivA>