add versatilepb support to tim's script

Takeshi Taguchi taguchi at ff.iij4u.or.jp
Mon Feb 11 13:07:01 UTC 2013


Hi, Tim

Thanks for your suggestion.
Here is a update patch.
I'd test using qemu on windows.
it was seem work fine.

Thanks.
--
T.T

2013/02/11 10:00), Tim Kientzle wrote:
> 
> On Feb 10, 2013, at 4:22 AM, Takeshi Taguchi wrote:
> 
>> Hi, all
>> Attached patch  add support versatilepb to tim's script:
>>   https://github.com/kientzle/freebsd-beaglebone
>>
>> use:
>>   board_setup VersatilePB
>> in config.sh. and try to run:
>>   sh beaglebine/sh
>> then you will get following images:
>>   FreeBSD-VERSATILEPB.flash : kernel image
>>   FreeBSD-VERSATILEPB.img   : userland image
>>
>> and then try to exec:
>>   qemu-system-arm -M versatilepb -m 128M \
>>     -kernel FreeBSD-VERSATILEPB.flash \
>>     -cpu arm1176 \
>>     -hda FreeBSD-VERSATILEPB.img
>>
>> Thanks.
>> -
>> T.T
> 
> Thank you!  This is wonderful!
> I've merged this to the code on Github.
> 
> I only have one suggestion for improving it:
> 
> You use this code to get the kernel object file:
> 
>   KERNELBIN=${WORKDIR}/obj/arm.armv6`realpath ${FREEBSD_SRC}`/sys/${KERNCONF}/kernel.bin
> 
> then
> 
>     dd of=$FLASH …. if=$KERNELBIN
> 
> This approach is a little brittle.   Elsewhere,
> I've used something similar to the following:
> 
>     mkdir ${WORKDIR}/kernel
>     freebsd_kernel_install ${WORKDIR}/kernel
>     dd .... if=${WORKDIR}/kernel/.../kernel.bin
> 
> If this doesn't work, please consider adding a new
> function to lib/freebsd.sh to copy kernel.bin; that way,
> there will be only one place that knows about this
> kind of detail.  (Rather than having copies of your
> code for every board.)
> 
> Tim
> 
> 
> 

-------------- next part --------------
diff --git a/board/VersatilePB/setup.sh b/board/VersatilePB/setup.sh
index 77c1428..53c3bc9 100644
--- a/board/VersatilePB/setup.sh
+++ b/board/VersatilePB/setup.sh
@@ -2,7 +2,7 @@ FREEBSD_SRC=/usr/src
 KERNCONF=VERSATILEPB
 IMG=${WORKDIR}/FreeBSD-${KERNCONF}.img
 FLASH=${WORKDIR}/FreeBSD-${KERNCONF}.flash
-KERNELBIN=${WORKDIR}/obj/arm.armv6`realpath ${FREEBSD_SRC}`/sys/${KERNCONF}/kernel.bin
+FREEBSD_INSTALLKERNEL_BOARD_ARGS=KERNEL_EXTRA_INSTALL=kernel.bin
 
 board_construct_boot_partition ( ) {
     # dummy partition.
@@ -17,10 +17,13 @@ board_construct_boot_partition ( ) {
     /usr/bin/printf "\0\060\240\343" >> ${WORKDIR}/first_commands
     # jump to kernel entry point
     /usr/bin/printf "\001\366\240\343" >> ${WORKDIR}/first_commands
+    # install kernel
+    [ ! -d ${WORKDIR}/_.kernel.bin ] && mkdir ${WORKDIR}/_.kernel.bin
+    freebsd_installkernel ${WORKDIR}/_.kernel.bin
 
     dd of=$FLASH bs=1M count=4 if=/dev/zero
     dd of=$FLASH bs=1 conv=notrunc if=${WORKDIR}/first_commands
-    dd of=$FLASH bs=64k oseek=15 conv=notrunc if=$KERNELBIN
+    dd of=$FLASH bs=64k oseek=15 conv=notrunc if=${WORKDIR}/boot/kernel/kernel.bin
     
 }
 


More information about the freebsd-arm mailing list