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

Re: Booting the FreeBSD kernel as an zImage file needs a patch upgrade ?.



Thanks to your valuable help,I've been able to produce the kernel.bin file,applying the patch of Julien Grall to the Elliott Mitchell code and enabling the parameter "WITH_KERNEL_BIN=1" to the FreeBSD kernel config file. At this point I created a freebsd.cfg file like this one :

name="freebsd"
kernel="/mnt/zroot2/zroot2/OS/Chromebook/freebsd-xen/domU-freebsd/bootloaders/kernel.bin"
extra = "console=hvc0"
memory=512
vcpus=1
disk = [ 'FreeBSD-13.2-RELEASE-armv7.img,raw,xvda' ]

and with this start-freebsd script :

xl create freebsd.cfg
xl console freebsd

and ran it :

# ./start-freebsd

Parsing config from freebsd.cfg
xc: error: panic: xg_dom_core.c:689: xc_dom_find_loader: no loader found: Invalid kernel
libxl: error: libxl_dom.c:571:libxl__build_dom: xc_dom_parse_image failed
libxl: error: libxl_create.c:1640:domcreate_rebuild_done: Domain 3:cannot (re-)build domain: -3
libxl: error: libxl_domain.c:1183:libxl__destroy_domid: Domain 3:Non-existent domain
libxl: error: libxl_domain.c:1137:domain_destroy_callback: Domain 3:Unable to destroy guest
libxl: error: libxl_domain.c:1064:domain_destroy_cb: Domain 3:Destruction of domain failed
freebsd is an invalid domain identifier (rc=-6)

It seems the same error that I always get. Should I make some modification inside the FreeBSD-13.2-RELEASE-armv7.img image file ? Because I haven't touched it ; it still has the default booting system files.

On Fri, Jan 5, 2024 at 10:20 PM Mario Marietto <marietto2008@xxxxxxxxx> wrote:
Sorry I forgot to change the name of the kernel :

# cd /usr/freebsd-src/sys/arm/conf
# cp GENERIC MYKERNEL

# nano MYKERNEL
makeoptions WITH_KERNEL_BIN=1

# make KERNCONF=MYKERNEL TARGET=arm TARGET_ARCH=armv7 buildkernel
# make KERNCONF=MYKERNEL TARGET=arm TARGET_ARCH=armv7 DESTDIR=/build-xen installkernel

same error as before : kldxref: /build-xen/boot/kernel/kernel: no ELF relocation table found.

On Fri, Jan 5, 2024 at 7:48 PM Mario Marietto <marietto2008@xxxxxxxxx> wrote:
Ok. I've found the solution reading here :

https://cgit.freebsd.org/src/diff/share/man/man5/src.conf.5?id=ce37de8e05b233bc50de2c7678ee841573e6a7e2

So on FreeBSD 15.0-CURRENT I did :

nano /etc/src.conf
WITH_KERNEL_BIN=1
(WITH_KERNEL_BIN is wrong)

$ cd /usr
$ git clone https://gitlab.com/ehem/freebsd-src.git
$ cd freebsd-src
$ make KERNCONF=GENERIC TARGET=arm TARGET_ARCH=armv7 buildkernel
$ make KERNCONF=GENERIC TARGET=arm TARGET_ARCH=armv7 DESTDIR=/build-xen installkernel

Unfortunately I get this error :

kldxref: /build-xen/boot/kernel/kernel: no ELF relocation table found

and the kernel.bin file is not generated.

experiment n. 2 : I have removed the parameter WITH_KERNEL_BIN=1 from /etc/src.conf ;

I've added the parameter :

makeoptions WITH_KERNEL_BIN=1

to the kernel file called GENERIC on "/usr/freebsd-src/sys/amd64/conf"

and then I've launched again the compilation :

$ make KERNCONF=GENERIC TARGET=arm TARGET_ARCH=armv7 buildkernel
$ make KERNCONF=GENERIC TARGET=arm TARGET_ARCH=armv7 DESTDIR=/build-xen installkernel

Unfortunately I've got the same error as before and the kernel.bin file hasn't been produced as well.


On Wed, Jan 3, 2024 at 6:33 PM Mario Marietto <marietto2008@xxxxxxxxx> wrote:
@Warner Losh :

Can you explain where I should add the parameter "WITH_KERNEL_BIN" ? I
tried in several ways,but it is not accepted :

$ make KERNCONF=GENERIC TARGET=arm TARGET_ARCH=armv7 buildkernel
WITH_KERNEL_BIN = wrong

$ make KERNCONF=GENERIC TARGET=arm TARGET_ARCH=armv7 WITH_KERNEL_BIN
buildkernel = wrong

$ make KERNCONF=GENERIC TARGET=arm TARGET_ARCH=armv7
DESTDIR=/build-xen WITH_KERNEL_BIN installkernel = wrong

$ make KERNCONF=GENERIC TARGET=arm TARGET_ARCH=armv7
DESTDIR=/build-xen installkernel WITH_KERNEL_BIN = wrong

How is it ?



On Tue, Jan 2, 2024 at 3:27 PM Julien Grall <julien@xxxxxxx> wrote:
>
> Hi,
>
> On 01/01/2024 23:03, Mario Marietto wrote:
> > I still see too many variables in the equation. I need to eliminate
> > some of them. So :
> >
> > 1) Do I need to patch the file locore-v6.S with the Julien's patch ?
> > ---> https://xenbits.xen.org/gitweb/?p=people/julieng/freebsd.git;a=commit;h=12a7cb346b88c6d3f52a20b98f361dc62797fbcd
>
> I believe so otherwise XL will not know how to load the binary file (see
> below).
>
> >
> > 2) What kind of u-boot are you talking about ? Where should I get it ?
> You don't need U-boot if you have a zImage. Instead, you can ask 'xl' to
> load it from the dom0 filesystem. The option in the xl configuration is
>
> kernel='<path-to-binary>'
>
> Cheers,
>
> --
> Julien Grall



--
Mario.


--
Mario.


--
Mario.


--
Mario.

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.