NetBSD/distrib/notes/sparc/prep

349 lines
9.2 KiB
Plaintext
Raw Normal View History

.\" $NetBSD: prep,v 1.15 2000/11/05 21:30:22 pk Exp $
1999-01-13 10:30:01 +03:00
.
.Ss2 Configuring your PROM
.
Before you start, you should configure your PROM. There are three
categories of PROM:
.Dq sunmon
(sometimes called Restricted Prompt, sun monitor, or old command mode),
OpenBoot PROM 1, and OpenBoot PROM 2.
The sun4 machines only have sunmon. Some of the early sun4c models
default to sunmon but have OpenBoot PROM 1.
The later sun4c models and all sun4m models have OpenBoot PROM 2.
.Pp
First, you need to stop your system from automatically booting when
powered on. Pressing the
.Key STOP
key (sometimes called the
.Key L1
key, found on the left side of your keyboard) and the
.Key a
key will halt your system and give you a PROM prompt. If you are using a
Tadpole SPARCbook, you press the
.Key Pause
and
.Key a
keys. If you are using a serial console, send a
.Dq BREAK
signal from your terminal (the method of sending
.Dq BREAK
varies from terminal to terminal).
.Pp
Next, you should set your system to always use the OpenBoot PROM
(sometimes called
.Dq "new command mode" )
if it defaults to sunmon. The
.Nx
kernel relies on some of the functionality provided by the OpenBoot PROM.
If your machine gives you a `\*>' prompt instead of an `ok' prompt,
type:
.Pp
.Dl \*> Ic n
.Dl ok Ic setenv sunmon-compat? false
.Dl ok
.Pp
Next, if you are using any security features of OpenBoot PROM, you should
turn them off - NetBSD can't deal well with this.
.Pp
.Dl ok Ic setenv security-mode none
.Pp
The OpenBoot PROM 1 machines (SPARCstation/server 1, SPARCstation/server 1+,
IPC, and SLC) have an odd SCSI quirk you should be aware of.
There are three SCSI addressing schemes used by your
system: SCSI target ID (set by physical jumpers on the device), PROM
.Sq unit
number (set by OpenBoot PROM 1, based on its SCSI target ID), and the name
you reference within an operating system (set by the kernel, based on the PROM
.Sq unit
number).
.Pp
Sun shipped these systems with the internal drives set to SCSI target IDs
3 and 1. The default value of the OpenBoot PROM variable
.Sq Li sd-targets
is
.Sq Li 31204567.
This variable maps how the OpenBoot PROM 1 assigns
.Sq unit
numbers based on the SCSI target ID.
Thus the device at SCSI target ID 3 is considered
.Sq unit
0, and the SCSI device at target ID 0 is
.Sq unit
3. When you type
.Dq Ic boot scsi(0,0,0) ,
the OpenBoot PROM will boot from
.Sq unit
0 (which is SCSI target ID 3, the internal hard drive). The
.Tn SunOS
kernel is hard-wired to map
.Li sd0
to SCSI target 3, and
.Li sd3
to SCSI target 0.
.Bl -column -offset indent PROM\ Unit# SCSI\ Target SunOS\ name
.It Em PROM\ Unit# Ta Em SCSI\ Target Ta Em SunOS\ name
.It \~\~\~0 Ta \~\~\~3 Ta \~\~\~sd0
.It \~\~\~1 Ta \~\~\~1 Ta \~\~\~sd1
.It \~\~\~2 Ta \~\~\~2 Ta \~\~\~sd2
.It \~\~\~3 Ta \~\~\~0 Ta \~\~\~sd3
.It \~\~\~4 Ta \~\~\~4 Ta \~\~\~st0
.It \~\~\~5 Ta \~\~\~5 Ta \~\~\~st1
.It \~\~\~6 Ta \~\~\~6 Ta \~\~\~cdrom
1999-01-13 10:30:01 +03:00
.El
.Pp
The
.Nx*M
.Li GENERIC
kernel does not wire things down as does
.Tn SunOS .
It names the disks in the order
that the SCSI targets are probed (01234567). If you only have one disk,
it is always
.Li sd0
regardless of its SCSI target ID or its PROM
.Sq unit
number, and there are no problems. If you have two disks, one at
SCSI ID 2 (
.Sq unit
2) and SCSI ID 3 (
.Sq unit
0), then they are recognized as
.Li sd0
and
.Li sd1
respectively. This can be a problem if you are not
aware of it, particularly when creating an fstab.
1999-01-13 10:30:01 +03:00
.Pp
There are two approaches to fixing this problem: changing the
mapping that OpenBoot PROM 1 does, and changing the
.Nx
kernel configuration.
To get OpenBoot PROM 1 to number the SCSI
.Sq unit
numbers the same as the SCSI target IDs, you need to run this command:
.Pp
.Dl ok Ic "setenv sd-targets 01234567"
.Pp
This may, however, cause problems if you were to later attempt to use
.Tn SunOS
on this machine or if you reset the OpenBoot PROM variables.
1999-01-13 10:30:01 +03:00
.Pp
The other approach is to use a
.Nx
kernel that matches the PROM's odd target mapping by treating
.Sq unit
0 (i.e. SCSI target ID 3) as
.Li sd0
and
.Sq unit
3 (i.e. SCSI target ID 0) as
.Li sd3 .
The
.Li GENERIC_SCSI3
kernel performs this target mapping, but the
.Li GENERIC
and
.Li INSTALL
kernels do not.
1999-01-13 10:30:01 +03:00
.Pp
.(Note
This is also a concern when you start building your own customised kernels.
.Note)
.Pp
The machines with OpenBoot PROM 2 (SPARCstation/server 2,
ELC, IPX, and all sun4m models) have s similar SCSI target mapping in the
form of a
.Ic devalias
entry. That is, the device alias
.Ic disk
is shorthand for the disk at SCSI ID 3 on the internal SCSI controller.
Normally, the
.Ic disk
device alias is what the PROM uses as the default boot device, i.e. in the
absence of a
.Ar device
argument to the
.Ic boot
command.
Note that there are also pre-configured device alias entries for
.Ic disk0,
.Ic disk1,
.Ic disk2
and
.Ic disk3 ,
which are in fact a one-to-one mapping to the SCSI targets
.Ic 0
to
.Ic 3
.Pq all on the internal SCSI controller .
.Pp
Again, it may be advantageous to use a fixed
.Dq SCSI target
to
.Do
.Nx
disk unit
.Dc
mapping in your kernel configuration file (such as is done in the
.Li GENERIC_SCSI3
kernel) to ensure that your disks remain showing up at the same
.Nx
device unit numbers even if you add disks to your system at a later time.
.
.Ss2 Determining how to access your SCSI disk from the PROM
.
sunmon and OpenBoot PROM 1 use an archaic
.Li sd( Ns Ar c,u,p Ns Ic \&)
syntax to address SCSI devices. OpenBoot PROM 2 uses a more intuitive
syntax using device aliases.
1999-01-13 10:30:01 +03:00
.Pp
To calculate the parameters for sunmon and OpenBoot PROM 1:
.(tag xcc -offset indent
.It Ar c
specifies the SCSI controller number (first is 0, second is 1, ...)
.It Ar u
the hexadecimal number obtained from evaluating
the expression
.Em (8 * TARGET) + LUN
.It Ar p
the partition number from which to boot
.Po
.Sq Li 0
=
.Sq Li a ,
.Sq Li 1
=
.Sq Li b ,
etc.
.Pc
.tag)
.Pp
Therefore, to boot from the swap partition on the internal hard drive
(first SCSI bus, target 0, lun 0, partition 1), one would use:
.Pp
.Dl ok Ic "boot sd(0,0,1)"
.Pp
To boot from a CD-ROM (first SCSI bus, target 6,
lun 0, partition dynamically determined), one would use:
.Pp
.Dl ok Ic "boot sd(0,30,)"
.Pp
And, to boot from a kernel named
.Li netbsd-GENERIC
on the fourth partition (
.Sq Li d ,
often the
.Pa /usr
partition) on an external hard drive (first SCSI bus, target 2, lun 0,
partition 3), one would use:
.Pp
.Dl ok Ic "boot sd(0,10,3)netbsd-GENERIC"
.Pp
Now, for OpenBoot PROM 2, SCSI devices are specified by an OpenBOOT
.Ic devalias
which provides simple mnemonics for the full path to the device. Type
.Ic devalias
in OpenBoot PROM 2 to get a list of all of the available aliases.
Just the alias and partition are necessary when booting.
.Pp
Therefore, to boot from the swap partition on the internal hard drive
(OpenBoot PROM 2 assumes the internal hard drive is at target 3), one would
use:
.Pp
.Dl ok Ic "boot disk:b"
.Pp
To boot from a CD-ROM (OpenBoot PROM 2 assumes the CD-ROM is at target 6),
one would use:
.Pp
.Dl ok Ic "boot cdrom"
.Pp
And, to boot from a kernel named
.Li netbsd-GENERIC
on the fourth partition (
.Sq Li d ,
often the
.Pa /usr
partition) on an external hard drive (target 2, partition 3), one would use:
.Pp
.Dl ok Ic "boot disk2:d netbsd-GENERIC"
1999-01-13 10:30:01 +03:00
.Pp
The full device path specifier for OpenBoot PROM 2 depends on how OpenBoot
PROM 2 recognizes
your SCSI controller. Typically, one would use something like:
.Pa /sbus/esp/sd@ Ns Ar t,p
where t is the SCSI target and p is the partition number.
.
.Ss2 Deciding on partition sizes
.
If you're installing
.Nx*M
for the first time it's a good idea
1996-10-09 04:13:36 +04:00
to look at the partition sizes of disk you intend installing NetBSD on.
1999-01-13 10:30:01 +03:00
.Pp
Asumming a classic partition scheme with
.Pa /
(root) and
.Pa /usr
filesystems, a comfortable size for the NetBSD root filesystem partition is
about 20 MB; a good initial size for the swap partition is twice the amount
of physical memory in your machine (though, unlike
.Tn SunOS 4.x ,
there are no restrictions on the size of the swap partition that would render
part of your memory unusable). A full binary installation takes about 60 MB
in
.Pa /usr .
2000-11-03 05:18:50 +03:00
.Pp
Most sparc systems have trouble booting if the root partition extends
beyond the first 2 GB of your disk.
.
.Ss2 Configuration of network interfaces
.
Some network devices (i.e. the built-in
.Em le
interface on sun4m machines)
allow a choice between operating on a UTP or a AUI port. The
.Em le
driver supports automatic detection of the port which is actually connected to
the wire. Additionally, some of the Fast ethernet devices (such as
.Em be ,
.Em hme ,
.Em qec ,
and
.Em qfe )
support selection of various speeds and options.
The default is to attempt to automatically detect the speed.
1999-01-13 10:30:01 +03:00
.Pp
If automatic detection is not available or not working properly in your
environment, you may have to specify the type connection using the
.Ic media
parameter of
.Xr ifconfig 8 .
During installation, you'll get the opportunity to specify the appropriate
medium. Use
.Li 10base5
or
.Li AUI
to select the AUI connector, or
.Li 10baseT
or
.Li UTP
to select the UTP connector.
Fast ethernet interfaces default to
.Li auto ,
which usually does not detect properly and runs at
.Sq 10BaseT
speed.
The options are
.Li 10baseT ,
.Li 10baseTX ,
and
.Li auto .
The
.Em hme
and
.Em qfe
interfaces also allow
.Li 10baseT-FDX
and
.Li 100baseT-FDX .