Difference between revisions of "Niagra 804: Initial Bootup"

From Define Wiki
Jump to navigation Jump to search
Line 34: Line 34:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Booting Debian from SDK created image ==
+
== Booting Debian from SDK created USB/CF image ==
  
 
=== Start the USB service ===
 
=== Start the USB service ===
Line 53: Line 53:
 
* usb = device type to be access is a USB storage device
 
* usb = device type to be access is a USB storage device
 
* 0:1 = device '''0''', partition '''1''' - ''devices start at 0, partitions start at 1''
 
* 0:1 = device '''0''', partition '''1''' - ''devices start at 0, partitions start at 1''
 +
* 0x20000000 = memory address into which the file should be loaded
 +
* vmlinux.64 = file to load
  
 
=== Boot the kernel image ===
 
=== Boot the kernel image ===
 
<syntaxhighlight>
 
<syntaxhighlight>
 
Octeon cust_n804# bootoctlinux 0x20000000 numcores=10 root=/dev/sda2
 
Octeon cust_n804# bootoctlinux 0x20000000 numcores=10 root=/dev/sda2
</syntaxhighlight>
 
 
 
  mkdir /mnt/sda1
 
  mkdir /mnt/sda2
 
  mount /dev/sda1 /mnt/sda1
 
  mount /dev/sda2 /mnt/sda2
 
  mount --bind /proc /mnt/sda2/proc
 
  chroot /mnt/sda2
 
  ifconfig mgmt0 172.28.1.95 up
 
  route add default gw 172.28.0.1 mgmt0
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 78: Line 69:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Setup the <tt>resolv.conf</tt> file
+
Setup the <code>resolv.conf</code> file
 
<syntaxhighlight>
 
<syntaxhighlight>
 
   # create the following file
 
   # create the following file
Line 86: Line 77:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
After this you can use <tt>wget</tt> to pull files down from the tftp server or the web
+
After this you can use <code>wget</code> to pull files down from the tftp server or the web
 +
 
 +
== Get the Debian root file system up and running ==
 +
Once the kernel has booted, you'll be in a Busy Box environment. We need to mount and <code>chroot</code> to the Debian roots.
 +
 
 +
=== Mount the Debian root fs partition ===
 +
The root fs is located on the second partition of the storage device. Mount it:
 +
<syntaxhighlight>
 +
~ # mount /dev/sdb2 /mnt
 +
kjournald starting.  Commit interval 5 seconds
 +
EXT3-fs (sdb2): warning: checktime reached, running e2fsck is recommended
 +
EXT3-fs (sdb2): using internal journal
 +
EXT3-fs (sdb2): recovery complete
 +
EXT3-fs (sdb2): mounted filesystem with writeback data mode
 +
</syntaxhighlight>
 +
 
 +
=== Bind the Busy Box /proc directory ===
 +
Bind the Busy Box /proc directory to the /proc directory of the Debian root fs:
 +
<syntaxhighlight>
 +
~ # mount --bind /proc /mnt/proc/
 +
</syntaxhighlight>
 +
 
 +
=== chroot to the Debian root fs and start bash ===
 +
Chroot:
 +
<syntaxhighlight>
 +
~ # chroot /mnt
 +
Algorithmics/MIPS FPU Emulator v1.5
 +
sh-4.1#
 +
</syntaxhighlight>
 +
And start bash:
 +
<syntaxhighlight>
 +
sh-4.1# bash
 +
root@(none):/#
 +
</syntaxhighlight>
 +
 
 +
=== Set up the networking ===
 +
<syntaxhighlight>
 +
root@(none):/# ifconfig mgmt0 172.28.1.95 up
 +
IPv6: ADDRCONF(NETDEV_UP): mgmt0: link is not ready
 +
root@(none):/# mgmt0: Link is up - 1000/Full
 +
IPv6: ADDRCONF(NETDEV_CHANGE): mgmt0: link becomes ready
 +
root@(none):/#
 +
</syntaxhighlight>
 +
 
 +
=== Set up a default gateway ===
 +
<syntaxhighlight>
 +
root@(none):/# route add default gw 172.28.0.1 mgmt0
 +
</syntaxhighlight>
 +
And confirm with <code>route -n</code>:
 +
<syntaxhighlight>
 +
root@(none):/# route -n
 +
Kernel IP routing table
 +
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
 +
0.0.0.0        172.28.0.1      0.0.0.0        UG    0      0        0 mgmt0
 +
172.28.0.0      0.0.0.0        255.255.0.0    U    0      0        0 mgmt0
 +
root@(none):/#
 +
</syntaxhighlight>

Revision as of 15:53, 31 March 2014

Basic boot up via PXE

Get an IP address by DHCP

Request an IP address by typing dhcp:

Octeon cust_n804# dhcp
BOOTP broadcast 1
DHCP client bound to address 172.28.1.84
Octeon cust_n804#

Specify a TFTP server

Specify the TFTP server by setting the serverip environment variable:

Octeon cust_n804# setenv server ip 172.28.0.2

Identify the boot image to pull down

TFTP down the boot image file:

Octeon cust_n804# tftp 0 /images/im_niagra804/vmlinux_n804.bin
Using octmgmt0 device
TFTP from server 172.28.0.2; our IP address is 172.28.1.84
Filename '/images/im_niagra804/vmlinux_n804.bin'.
Load address: 0x20000000
Loading: #################################################
done
Bytes transferred = 33838432 (2045560 hex)

Boot the system

bootoctlinux 0 coremask=f #f = cores 0-3, 3ff = cores 0-9

Booting Debian from SDK created USB/CF image

Start the USB service

Octeon cust_n804#  usb start

You should be able to see the USB storage devices using usb storage at the uBoot prompt:

Octeon cust_n804# usb storage

Load the kernel image to memory

Octeon cust_n804# fatload usb 0:1 0x20000000 vmlinux.64

The syntax here is:

  • fatload = load a file from FAT filesystem
  • usb = device type to be access is a USB storage device
  • 0:1 = device 0, partition 1 - devices start at 0, partitions start at 1
  • 0x20000000 = memory address into which the file should be loaded
  • vmlinux.64 = file to load

Boot the kernel image

Octeon cust_n804# bootoctlinux 0x20000000 numcores=10 root=/dev/sda2

Setup Networking in BusyBox

Setup the IP networking

  # grab the IP address from the output of dhcp above
  ifconfig mgmt0 172.28.1.84
  route add default gw 172.28.0.1 mgmt0

Setup the resolv.conf file

  # create the following file
  /mnt/sda1 # cat /etc/resolv.conf 
  nameserver 172.28.0.2
  search pxe.boston.co.uk

After this you can use wget to pull files down from the tftp server or the web

Get the Debian root file system up and running

Once the kernel has booted, you'll be in a Busy Box environment. We need to mount and chroot to the Debian roots.

Mount the Debian root fs partition

The root fs is located on the second partition of the storage device. Mount it:

~ # mount /dev/sdb2 /mnt
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sdb2): warning: checktime reached, running e2fsck is recommended
EXT3-fs (sdb2): using internal journal
EXT3-fs (sdb2): recovery complete
EXT3-fs (sdb2): mounted filesystem with writeback data mode

Bind the Busy Box /proc directory

Bind the Busy Box /proc directory to the /proc directory of the Debian root fs:

~ # mount --bind /proc /mnt/proc/

chroot to the Debian root fs and start bash

Chroot:

~ # chroot /mnt
Algorithmics/MIPS FPU Emulator v1.5
sh-4.1#

And start bash:

sh-4.1# bash
root@(none):/#

Set up the networking

root@(none):/# ifconfig mgmt0 172.28.1.95 up
IPv6: ADDRCONF(NETDEV_UP): mgmt0: link is not ready
root@(none):/# mgmt0: Link is up - 1000/Full
IPv6: ADDRCONF(NETDEV_CHANGE): mgmt0: link becomes ready
root@(none):/#

Set up a default gateway

root@(none):/# route add default gw 172.28.0.1 mgmt0

And confirm with route -n:

root@(none):/# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.28.0.1      0.0.0.0         UG    0      0        0 mgmt0
172.28.0.0      0.0.0.0         255.255.0.0     U     0      0        0 mgmt0
root@(none):/#