Setting up hardware/firmware
Before you can boot with any of these methods there are a few things
you will need to take care of first. You will need to set the jumpers
to boot from the Flash that has the PPCbug image on it. It
seems that most boards come from PREP set up to boot VxWorks.
If you connect your serial cable to the board and see any mention of VxWorks,
you need to set the jumper to boot from the other Flash bank.
On the boards that I have recieved from PREP they were all set to boot
from bank A, which was VxWorks. When I switched them
to bank B, I was able to boot with PPCbug. There are two environment parameters
that must be set in NVRAM before you can try to boot Linux. First,
the option 'Network PReP-Boot Mode Enable' must be set to yes.
This sets up the memory model the way that Linux expects it.
Second, the option 'VME3PCI Master Master Enable' enable must be
set to no. I do not know why this needs to be done other than it
will not work if it is set to yes. These environment
parameters can all be set with the env command from the PPCbug prompt.
I have provided a couple of examples of what our environments look like
on boards that boot Linux.
This example is from an MVME2603 with a SCSI disk attached
with SCSI id 2. It boots automatically from partition
one on power-up or reset. The parameters that allow it to boot
automatically all begin with 'Auto Boot'
This example comes from an MVME2304 that boots over the network with
bootp and tftp. It can boot with NFS or ramdisk depending on what
kernel it gets via bootp/tftp. It also boots automatically
on power-up or reset. The parameters that allow it to boot
correctly all begin with 'Network Auto Boot'.
Booting from disk
I suggest that you start with a root file system already.
I would suggest using Don Holmgren's, located at ftp://linux-rep.fnal.gov/pub/vmestuff/nfsroot.djh.tgz
. You are welcome to use mine if you wish at ftp://www.neutrino.lanl.gov/pub/bsapp/nfsroot.tar.gz.
I suggest Don's rather than mine because in my root file system login does
not work. I have not bothered to track down the problem because
I only boot to single user mode. Thus I do not ever have to use login.
However, Don's file system is an older version of the linuxppc and
does not have posix counting semaphores. So, if you need posix counting
semaphores, as I do, you should use my root file system.
Once you decide on what file system you want to use you will need to partition
a disk. Attach the SCSI disk you plan on using to a working Linux
system. Below is a reply Don Holmgren sent Eric Church and
me when asked about this problem. This worked perfectly for me.
Then, to boot Linux, "just" use (for example)
pboot 0 40 1
where 40 is the LUN (my drive is at SCSI ID 40) and 1 is the partition
with a prepboot image.
The "just" is because you'll have to get a prepboot image written to
partition 1. Here's what to do:
1. Attach the disk to a Linux system. Use your favorite partitioning
tool
(fdisk or cfdisk) to write a partition table. One
small partition
should be set aside to be the prepboot partition.
Mark this partition
as type 41 - in cfdisk that's translated to "PowerPC".
Most fdisk's
don't understand type 41, but I think they'll let you
use that number.
Here's my partition table:
cfdisk 0.8i
Disk Drive: /dev/sda
Heads: 200 Sectors per Track: 62 Cylinders: 1020
Name
Flags
Part Type FS Type Size
(MB)
----------------------------------------------------------------------
/dev/sda1
Primary PowerPC
6.06
/dev/sda2
Primary Linux Swap
127.15
/dev/sda3
Primary Linux
4099.03
/dev/sda4
Primary Linux
1943.56
You'll need only a few megabytes for the prepboot partition.
On my
disk the geometry translates into 6.06 MB/cylinder.
You'll want a swap
partition, and one or more partitions for the OS.
I used the 4+ GB
partitition for the OS, and the ~ 2 GB partition to bootstrap
the
install (you don't want to know, trust me).
2. Run mke2fs on your OS partition. Mount it. Explode the
filesystem I
gave you onto that partition.
3. In /boot I think you'll find a bunch of kernels. I trust zImage-bpa
the most, I think. Use dd to write your kernel to
your prepboot
partition:
dd if=/mnt/ppcimage/boot/zImage-bpa
of=/dev/sdx1
(where /mnt/ppcimage is where you've mounted the OS partition,
and
/dev/sdx1 is the device name of the prepboot partition,
as in
/dev/sda1).
4. Dismount the OS partition and disconnect the drive. Connect
up to your
712 transition module.
5. Use 'pboot 0 40 1' (modify as necessary) to boot. Check the
'root='
setting on the boot parameter line and modify as necessary
to match
your partitioning.
That should do it. There's nothing nice like LILO around to choose
a
kernel (at least that I know of - let me know when you find something
better).
If you get stuck and pboot doesn't work, you can always use NBO to bring
in the kernel image from a server.
Good luck -
Don Holmgren
I have made some kernels available at ftp://www.neutrino.lanl.gov/pub/bsapp You can also use Don's at ftp://linux-rep.fnal.gov/pub/vmestuff/zImage-bpa There should be no problem with mixing and matching kernels and root file systems. The only problem that I can see coming up is if you used my file system with Don's kernel. Then when you see the 'Linux/PPC load: ' prompt you will have to be sure to type in 'single' in order to go straght into single user mode. Once you get pboot to work I would suggest setting up the environment paramters to boot automatically like we have your 2603 set up.
Booting from the network
Booting methods 1 and 2 are done with bootp and tftp. So, you
will need to set both of these up on a server. It is suggested
that the boot server and the MVME230X be on the same subnet.
Broadcasts related to bootp are not always forwarded by routers.
If the computers are not on the same subnet you will need to make sure
that all routers in the network between the two machines forward bootp
messages. We use an Origin 200 running IRIX as our bootp/tftp server.
We have tftp set up to allow unrestricted access to any thing in the /ppctools/kernel
directory. I copy the kernel that I want the MVME2300s to boot from
to /ppctools/kernel/boot/vmelinux. In inetd.conf the tftp and
bootp lines look like this:
In IRIX the /etc/bootptab file tells bootp which MAC addresses to respond
to and what the IP addresses should be. It also tells bootp
where the kernels can be found. Our bootptab file looks like this:
# Root of boot subtree. If tftpd(1M) is running in "secure" mode,
# this directory must be specified on tftpd's entry in /usr/etc/inetd.conf.
/ppctools/kernel/boot
# end of first section
%%
#
# The remainder of this file contains one line per client interface
# with the information shown by the table headings below.
# The 'host' name is also tried as a suffix for the 'bootfile'
# when searching the home directory. (e.g., bootfile.host)
#
# host htype
haddr
iaddr bootfile
#
IRIS
1 01:02:03:8a:8b:8c 192.0.2.1
unix
lsndvx20 1 08:00:3E:27:C0:A9
128.165.53.144 vmelinux
lsndvx8 1 00:01:AF:00:EB:5E
128.165.53.180 vmelinux
lsndvx7 1 00:01:AF:00:51:8C
128.165.53.181 vmelinux
lsndvx9 1 00:01:AF:00:EB:6B
128.165.53.178 vmelinux
The hardware address(the third thing in each line) can be obtained from
the ppcbug prompt with the command 'cnfg'. For example, from lsndvx7:
From this I took the 'Ethernet Address' and seperated every two
characters with colons and put that in /etc/bootptab as the hardware address.
You may or may not need to insert the colons like we did.
Once you think you have the board/environment and software set up correctly,
you can try and boot with the PPCbug command 'nbo'. This will
send a broadcast bootp message that says "What is the IP address for a
machine with my ethernet address". Hopefully, if all
is set up correctly you will see something like this:
Client IP Address = 128.165.53.181
Server IP Address = 128.165.53.41
Gateway IP Address = 128.165.53.41
Subnet IP Address Mask = 255.255.0.0
Boot File Name = /ppctools/kernel/boot/vmelinux
Argument File Name =
Network Boot File load in progress... To abort hit <BREAK>
Bytes Received =&1753744, Bytes Loaded =&1753744
Bytes/Second =&103161, Elapsed Time =17 Second(s)
If you do see this you can be confident that tftp and bootp are working
correctly on the server. Right after the above you will see:
Model: 000000000000000000000000000(e2)
Serial: MOT0423702
Processor/Bus frequencies (Hz): 333372128/66675148
Time Base Divisor: 4000
Original MSR: 3040
Original HID0: 82
Original R31: 0
PCI: Probing PCI hardware
Configurable PCI resources:
01dd6060:01dd61e0 000014 3c000000 00040000 0
01dd61e0:01dd6270 006810 2ffef000 00001000 0
01dd6270:01dd61f8 007014 2ffeef80 00000080 0
01dd61f8:01dd6258 006814 0fffe000 00001000 1
01dd6258:01dd6168 007010 0fffdf80 00000080 1
01dd6168:01dd6180 005920 0fffffc0 00000010 1
01dd6180:01dd6108 005924 0fffffb0 00000010 1
01dd6108:01dd6138 005910 0ffffff0 00000008 1
01dd6138:01dd6120 005918 0fffffe0 00000008 1
01dd6120:01dd6150 005914 0fffffec 00000004 1
01dd6150:01dd6048 00591c 0fffffdc 00000004 1
01dd6048:00000000 000010 00000000 00000000 1
alloc_area called:
PCI I/O areas:
01dd62d0:01dd6288 01f8221c 00010000 00011fff
01dd6288:00000000 00000000 00012000 007fffff
PCI memory areas:
01dd62a0:00000000 00000000 01000000 3cffffff
alloc_area called:
PCI I/O areas:
01dd62d0:01dd6288 01f8221c 00010000 00011fff
01dd6288:00000000 00000000 00012000 007fffff
PCI memory areas:
01dd6300:01dd62a0 01f8221c 01000000 010fffff
01dd62a0:00000000 00000000 01100000 3cffffff
Allocated PCI resources:
01dd6060:01dd61e0 000014 01000000 00040000 0
01dd61e0:01dd6270 006810 01040000 00001000 0
01dd6270:01dd61f8 007014 01041000 00000080 0
01dd61f8:01dd6258 006814 00010000 00001000 1
01dd6258:01dd6168 007010 00011000 00000080 1
01dd6168:01dd6180 005920 00011080 00000010 1
01dd6180:01dd6108 005924 00011090 00000010 1
01dd6108:01dd6138 005910 000110a0 00000008 1
01dd6138:01dd6120 005918 000110a8 00000008 1
01dd6120:01dd6150 005914 000110b0 00000004 1
01dd6150:01dd6048 00591c 000110b4 00000004 1
01dd6048:00000000 000010 00000000 00000000 1
Linux/PPC load: console=ttyS0 init=sh
Uncompressing the kernel...Kernel at 0x00000000, size=0x16ae0c
Initrd at 0x00243000, size=0x112039
Residual data at 0x0016b000
Command line at 0x00172000
done
Now booting...
This is the Linux PPC PReP bootloader. It is written by Gabriel Paubert. I'll touch on this more when I talk about building a kernel. It simply sets things up for the kernel. I have never had any problems with the bootloader. My problems have always been with tftp/bootp or the kernel. A common problem I have had is that after the bootloader finishes I see nothing from the kernel. There are a couple of causes for this. One is that there is no 'console=ttyS0' on the 'Linux/PPC load:' command line. The other is that I did not build console support into the kernel.
The output from a kernel with ramdisk is given below. You
should see something similar.
I want to mention one problem we had when trying to boot an NFS filesystem. Most of the computers on our network are Silicon Graphics workstations. We have plenty of disk space on the workstations and thought we would use it as the NFS server. It turns out that this can not be done. As a matter of fact I do not think you can do this on any other system except Linux. It has to do with device files not being made correctly. Device files are not portable.
Building Your Own Kernel
Once you get some kernels built by myself or Don Holmgren booted, you
will probably wish to make your own kernels. I have built all
my kernels for the MVME2300s with cross compilers. At first I built
my own cross-compilers using Matt Porter's Cross
Development for Linux/PPC web page. I no longer do
this because there is alot of compiling required.(It is a big waste of
time!!!) If all goes well it will take you two days of baby-sitting
the compilation process to get it working. If things don't go perfectly
it could easily take a week. As a better alternative,
you can download the Cross Development
Kit from Monta Vista Software and use that to build kernels.
You can also choose to build kernels natively.
Building Applications
The cross development kit works fine for kernels; however, I suggest
you do not use it to build applications. It may build the applications
without any problems but there seems to be library incompatibilities with
both my root file system and Don's. The program might even run ...
just incorrectly. It is a real pain to track down. I suggest
using either a board with a local or NFS file system with native compilers.