SS4000-E/FreeBSD Install

From TomJudge.com
Revision as of 19:39, 13 October 2009 by Tom (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page should give you enough information to load FreeBSD onto the SS4000-E.

Before you start you will need to have made the serial cable (SS4000-E/Serial Cable) and have it connected to your FreeBSD build host.


Build Environment

Here is the bash file that I source into my shell when I want to work on the ARM code for this board.

You will probably want to adjust the following MAKEOBJDIRPREFIX, ROOT and the setupboot function:

export TARGET=arm
export TARGET_ARCH=arm
export MAKEOBJDIRPREFIX=/data/arm_build
export ROOT=/data/arm_root
function buildworld {
	(
	cd /usr/src
	make -j2 TARGET=arm TARGET_CPUTYPE=xscale buildworld 
	)
}
function buildkernel-nc {
	(
	cd /usr/src
	make -j2 -DNOCLEAN buildkernel KERNCONF=EM-7210
	)
}
function buildkernel {
	(
	cd /usr/src
	make -j2 buildkernel KERNCONF=EM-7210
	)
}
 
function setupboot {
	ifconfig bge0 up
	ifconfig bge0 10.0.0.251/24
	/etc/rc.d/inetd onestart
}
function installworld {
	(
	cd /usr/src
	make TARGET=arm TARGET_CPUTYPE=xscale DESTDIR=$ROOT installworld
	mergemaster -m /usr/src/etc -D $ROOT -i -A arm 
	)
}
 
function installworldextra {
	(
	cd /usr/src
	make TARGET=arm TARGET_CPUTYPE=xscale DESTDIR=$ROOT distrib-dirs
	make TARGET=arm TARGET_CPUTYPE=xscale DESTDIR=$ROOT distribution
	)
}

Building The Code

Here is the process for building the code for the unit:

## Source in the build environment functions
. /root/arm-build
 
## Make the directories for the build
mkdir -p $ROOT
mkdir -p $MAKEOBJDIRPREFIX
 
## Build world and kernel
buildworld
buildkernel
 
## Install the arm world
installworld
installworldextra

Setting up the boot host

In order to boot the system you will need to configure your build box to host the kernel image via TFTP and the root file system via NFS. You will also need a working DHCP server, preferably the ISC one.

You will need to uncomment the following line in /etc/inetd.conf

tftp	dgram	udp	wait	root	/usr/libexec/tftpd	tftpd -l -s /tftpboot

You will also need to create /etc/exports as follows:

/data -alldirs -network 10.0.0.0 -mask 255.255.255.0 -maproot=0:0

Here is my DHCP server configuration file for my development network (/usr/local/etc/dhcpd.conf):

option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
authoritative;
ddns-update-style ad-hoc;
log-facility local7;

subnet 10.0.0.0 netmask 255.255.255.0 {
  range 10.0.0.10 10.0.0.20;
  option broadcast-address 10.0.0.255;
  default-lease-time 600;
  max-lease-time 7200;
  filename "/pxeboot.0";
  next-server 10.0.0.251;
  option root-path "/data/iso";
}
option root-opts code 130 = string; # NFS / mount options
host ss4000e {
        hardware ethernet 00:0e:0c:b6:bf:1a; ## Change this to the MAC of the primary NIC in the unit
        fixed-address 10.0.0.1;
        next-server 10.0.0.251;
	option root-path "10.0.0.251:/data/arm_root";
	option root-opts "nolockd";
} 


If this host is going to have the configuration permanently add the following to /etc/rc.conf

inetd_enable="YES"
rpcinfo_enable="YES"
rpcbind_enable="YES"
nfs_server_enable="YES"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
mountd_enable="YES"
nfsd_enable="YES"
dhcpd_enable="YES"
dhcpd_ifaces="bge0"

Now you need to start the required services (change start to onestart if you don't want the services to start next time you boot):

/etc/rc.d/rpcbind start
/etc/rc.d/lockd start
/etc/rc.d/statd start
/etc/rc.d/mountd start
/etc/rc.d/nfsd start
/usr/local/etc/rc.d/isc-dhcpd start



EM-7210 ver.T04 2005-12-12 (For ver.AA)
== Executing boot script in 1.000 seconds - enter ^C to abort
^C
RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xF0000000  0xF0000000  0x00040000  0x00000000
RedBoot config    0xF1FC0000  0xF1FC0000  0x00001000  0x00000000
FIS directory     0xF1FE0000  0xF1FE0000  0x00020000  0x00000000
rammode           0xF0060000  0x00200000  0x00040000  0x00200000
log               0xF0040000  0xF0040000  0x00020000  0x00000000
naskey            0xF00A0000  0xF00A0000  0x00020000  0x01008000
zImage            0xF00C0000  0x01008000  0x00200000  0x01008000
ramdisk.gz        0xF02C0000  0x01800000  0x00400000  0x01800000
vendor            0xF06C0000  0xF06C0000  0x01880000  0x01800000
wmdata            0xF1F40000  0xF1F40000  0x00080000  0x01800000
RedBoot> fis load rammode
RedBoot> g   
+Ethernet eth0: MAC address 00:0e:0c:b6:bf:1a
IP: 10.9.9.1/255.255.255.0, Gateway: 10.9.9.1
Default server: 10.9.9.10, DNS server IP: 0.0.0.0

EM-7210 (RAM mode) 2005-12-22
== Executing boot script in 1.000 seconds - enter ^C to abort
^C
RedBoot>
RedBoot> ip_address -l 10.0.0.1 -h 10.0.0.251
IP: 10.0.0.1/255.255.255.0, Gateway: 10.9.9.1
Default server: 10.0.0.251, DNS server IP: 0.0.0.0
RedBoot> load -b 0x01008000 kernel
Using default protocol (TFTP)
Address offset = 0x40000000
Entry point: 0x01008100, address range: 0x01008000-0x01376068

Personal tools