[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 ?.
# objcopy -O binary -S kernel.bin kernels.bin objcopy: file format not recognized
ok. So :
# objcopy -O binary -S kernel kernels # file kernels kernels: data
---> objcopy -O binary -S <your-elf> <output-binary>
What's "my elf" ? What's the output binary ? I don't understand which values should be used there. I have only one file,kernel.bin,but two slots to fill.
I think he means the 'kernel' file.
was the 'kernel' file deleted if you only have kernel.bin? It isn't normally.
Warner
Hi,
On 05/01/2024 21:20, Mario Marietto 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.*
Are all the sections in ELF contiguous in memory? If so, you could try
to use manually objcopy. Something like:
objcopy -O binary -S <your-elf> <output-binary>
Then use 'file' to check if the format is recognized as zImage. If so,
you could use it in your xl configuration.
Note that this *might* be what KERNEL_BIN is doing underhood. But I
haven't checked not nor I am familiar with the area. I am only proposing
something that may get you unstuck for now. You can come back to fix the
problem afterwards.
# Generate the .bin (no elf headers) kernel as an extra build output. # We must relink to generate the .bin kernel, because without headers the # location of everything changes. We also strip the ARM marker symbols. ${KERNEL_KO}.bin: ${SYSTEM_DEP} vers.o @echo "linking ${.TARGET}" @${SYSTEM_LD_BASECMD} \ --defsym='text_start=kernbase' \ -o ${.TARGET} ${SYSTEM_OBJS} vers.o ${SIZE} ${.TARGET} @${OBJCOPY} \ --wildcard \ --strip-symbol='$$[adt]*' \ --output-target=binary \ ${.TARGET} @chmod 755 ${.TARGET}
is what makes it...
Warner
Cheers,
--
Julien Grall
--
Mario.
--
Mario.
--
Mario.
|