> Right on.  Is the build process for the xM unofficially documented
> anywhere? I know the cross-tools stuff isn't officially supported.  Is
> there out-of-tree support for ethernet or usb?
> 
> Cheers,
> Aaron

Hi Aaron,

Since the Beaglebone uses a different CPU I'm not sure how useful these notes 
will be to you. I don't know of anyone working on ethernet or usb. Let us know 
if you get the Beaglebone to run OpenBSD. 

Here are my notes. This is mostly just based on what Jasper Lievisse Adriaanse 
(its his website at http://humppa.nl/) and Dale Rahn told me to do. 

I have not tried to do this since the kernel was switched to rthreads, 
hopefully that will not have caused anything to break.

Good luck!

Brett.
http://humppa.nl/xM/u-boot.bin

Note: when upgrading to newer kernel, these 2 files do not need to be changed.
============================================================================

If you are using a BeagleBoard xM you can use the beagle_fmt_sd script (below) 
to
create a bootable SD card:

Insert the card into your computer and call the script like:

        # sh beagle_fmt_sd sd2 ./MLO ./u-boot.bin

============================================================================
#!/bin/sh
#
# Written by Dale Rahn <dr...@openbsd.org>, 2011.
#
# Create a bootable partition on ${DRIVE} for use with BeagleBoard xM.

echo $#
if (( $# < 3 ))
then
        echo fail
        exit 4
fi

DRIVE=$1
MLO=$2
UBOOT=$3

echo DRIVE ${DRIVE}
echo MLO ${MLO}
echo UBOOT ${UBOOT}

SIZE=$(fdisk ${DRIVE} | grep Disk | awk '{ print $5 }' | sed -e 's/\[//')

echo size ${SIZE}

CYL=$(echo ${SIZE}/255/63|bc)
echo cyl ${CYL}

MAXCYL=$(echo  ${CYL} - 1 | bc)

echo MAXCYL ${MAXCYL}

CHS="-c ${CYL} -h 255 -s 63"

echo CHS ${CHS}

dd if=/dev/zero of=/dev/r${DRIVE}c bs=1m count=1 2>/dev/null

fdisk ${CHS} -yi ${DRIVE} >/dev/null

fdisk ${CHS} -e ${DRIVE} >/dev/null << DONE
e 0
C
y
0
1
1
4
254
63
f 0
e 3
A6
y
5
0
1
${MAXCYL}
254
63
w
q
DONE

disklabel -c ${DRIVE}

# if msdos partition is > 32MB make this FAT32, not FAT16
newfs_msdos -F 16 -L boot /dev/r${DRIVE}i >/dev/null

mount /dev/${DRIVE}i /mnt
cp ${MLO} /mnt/MLO
cp ${UBOOT} /mnt/u-boot.bin
umount /mnt
sync

============================================================================
Use file sets from the armish architecture snapshots.

Extract the armish base,comp, and etc onto the SD card on an i386/amd64 box.


Run command:          # cd <mount point>/dev && sudo ksh MAKEDEV all

And, create /etc/fstab:

/dev/sd0b none swap sw
/dev/sd0a / ffs rw 1 1

============================================================================

Build bsd.umg:

First build and install mkuboot:

# cd /sys/stand/mkuboot && make && cp mkuboot /bin

============================================================================

Set up an arm cross compiler on an i386 or amd64 host.

$ cd /usr/src && sudo make -f Makefile.cross TARGET=armish
OR if no sudo setup:
# cd /usr/src && make -f Makefile.cross TARGET=armish

then configure the beagle kernel and build it
with this (cross compile) script:

-- armmake
#! /bin/ksh
HOST=$(uname -m)
MACHINE=armish
MACHINE_ARCH=arm
MACHINE_CPU=arm
VERSION=$(uname -r)

export MAKEOBJDIR=obj.${HOST}.${MACHINE}

CROSSDIR=/usr/cross/${MACHINE}
CROSS=${MACHINE_ARCH}-unknown-openbsd${VERSION}
PATH=$PATH:${CROSSDIR}/usr/${CROSS}/bin

MACHINE=${MACHINE} \
MACHINE_ARCH=${MACHINE_ARCH} \
MACHINE_CPU=${MACHINE_CPU} \
CROSSDIR=${CROSSDIR} \
CC=${CROSS}-cc \
CPP=${CROSS}-cpp \
AS=${CROSS}-as \
LD=${CROSS}-ld \
SIZE=size \
STRIP=${CROSS}-strip \
OBJDUMP=${CROSS}-objdump \
OBJCOPY=${CROSS}-objcopy \
make \
MACHINE=${MACHINE} \
MACHINE_ARCH=${MACHINE_ARCH} \
OBJMACHINE=${MACHINE_ARCH} \
MAKEOBJDIR=obj.${HOST}.${MACHINE} \
"$@"

---------

add above script to your path and chmod +x it
---------

then

$ cd /sys/arch/beagle/conf && config GENERIC
$ cd /sys/arch/beagle/compile/GENERIC && armmake bsd.umg 


This builds file in >> /sys/arch/beagle/compile/GENERIC/bsd.umg, copy this to 
msdos partition on SD card.
============================================================================


BOOTING:

Autoboot does not work yet, you can manually boot OpenBSD when you hit any key
during the time-out.

1.:

        OMAP3 beagleboard.org # mmc init
        mmc1 is available

2. At the moment, OpenBSD won't boot unless some boot arguments are supplied:

        OMAP3 beagleboard.org # setenv bootargs 'root=/dev/rsd0a'

3. Load the U-Boot image into memory:

        OMAP3 beagleboard.org # fatload mmc 0 0x80800000 bsd.umg

4. To load that image from memory and thus boot OpenBSD type:

        OMAP3 beagleboard.org # bootm 0x80800000

============================================================================

Reply via email to