|
|
Bootloadr
Introduction
The bootloader firmware (bootldr) is the program that first gets control of the machine when it is powered on. The bootloader initializes and manages the raw hardware. One of its main jobs is to copy the operating system from non-volatile memory (Flash) to DRAM and pass control to the operating system. The bootloader performs platform specific hardware configuration for the operating system, such as steering interrupts on the PCI devices (on Skiff only).
In addition, the bootloader provides a simple command-line interface that allows the user to download new versions of the operating system, user code, and parameters into Flash via the xmodem protocol.
The following is the list of bootloader commands.
Command List
help
The help command lists all the supported commands along with a very brief description of their syntax.
help
help <cmdname>
<cmdname> help
load
The load command downloads files into DRAM or Flash using the XModem protocol. The most common uses of load are to install new versions of the kernel, user code, or the bootloader itself. The syntax for these forms is shown below:
load kernel
This command will install a new version of the NetBSD or Linux kernel (uncompressed or compressed with gzip). The kernel file can be up to 30800192 bytes. (3MB - 64KB).
load bootldr
Installs a copy of the bootloader (which may be up to 48KB). Use with extreme caution. If a non-functional bootloader is installed, the bootloader will have to be reinstalled via the JTAG Test Access Port.
load ramdisk
Installs a copy of the linux initial ramdisk (which may be up to 3MB). Only for use with Linux.
load params
Installs up to 16KB of boot parameters. One parameter stored in this section is the serial port baudrate.
load flash <flashoffset> <size>
This is an advanced command. Downloads a file to Flash at the indicated offset from the start of Flash. Erases all the affected sectors. Use with caution, because it is possible to inadvertently overwrite the kernel or ramdisk using this command..
boot
Invokes the operating system. It automatically detects whether the kernel is gzipped and whether it is Linux or NetBSD. This command can be used in three ways, the first being the most common:
boot
Invoke the operating system installed in Flash.
boot flash
Invoke the operating system installed in Flash.
boot nfsroot
With Linux installed, this directs it to boot and mount an NFS root filesystem.
show
Shows the bootloader parameters and their values. Shorthand for params show
set
Sets bootloader parameters. Use show to see the parameters and their values.
params
params reset
Reset the bootldr parameters to their defaults
params show
Show all the parameters and their values.
params eval
Evaluate all the bootldr commands in the params sector (prefixed with bootldr:, e.g.,
bootldr: set nfsroot /tftpboot/root.skiff
params save
Saves bootldr parameters to flash (currently overwrites any non-bootldr parameters in the params section. See load params)
peek ram
Reads 4 bytes from the specified address (using the bootloader's virtual to physical address mapping) and displays in hexadecimal.
poke ram
Writes 4 bytes to the specified address (using the bootloader's virtual to physical address mapping). This command can crash the system, but it should cause no lasting damage.
eflash
This is an advanced command. Erases the specified sector of Flash. Use with extreme caution. If the bootldr is erased, then the machine will be unusable.
physaddr
Shows the physical address for the specified virtual address.
Bootldr Params
baudrate
This parameter controls the baudrate of the serial port used for communication with the unit. Once the value has been changed, the serial port must be adjusted accordingly on the host side.
boot_type
This specifies the root filesystem when booting Linux.
flash
ramdisk or cramfs in flash
nfsroot
Root filesystem mounted via NFS.
download_kernel
If set to a nonzero value, then the boot command will boot a kernel it downloads into DRAM via xmodem rather than booting the kernel in flash.
kernel_in_ram
If set to a nonzero value, then the boot command will jump to the location specified here rather than copying the kernel image from flash to DRAM and booting it.
force_unzip
No longer used.
noerase
Advanced command. Inhibits the erasing of flash before programming. Assumes flash was manually erased using the eflash command.
override
Advanced command. Use of this command may render the system unusable. Enables any location in flash to be programmed using the load flash command.
entry
Advanced command. The DRAM address into which the kernel is loaded.
copy_ramdisk
Advanced command. Set this to zero when using a cramfs if the bootldr attempts to treat the cramfs image as an initial ramdisk.
dcache_enabled
Set to 0 to disable the data cache and to 1 to enable the data cache. This variable does not affect the kernel's choice of whether or not to enable the data cache.
icache_enabled
Set to 0 to disable the data cache and to 1 to enable the instruction cache. This variable does not affect the kernel's choice of whether or not to enable the instruction cache.
maclsbyte
On Skiff, this reports the least significant byte of the ethernet address.
dram_size
Advanced command.This variables shows the autodetected DRAM size and is used to indicate to the kernel how much memory is available.
linuxargs
The command line arguments to pass to the Linux kernel when booting, in addition to any passed on the command line to the boot command.
hostname
When set, is passed on the command line to override Linux IP hostname autoconfiguration via the ip=... option.
ipaddr
When set, is passed on the command line to override Linux IP address autoconfiguration via the ip=... option.
gateway
When set, is passed on the command line to override Linux IP default gateway autoconfiguration via the ip=... option.
netmask
When set, is passed on the command line to override Linux IP netmask autoconfiguration via the ip=... option.
nfs_server_address
When set, is passed on the command line to override Linux IP autoconfiguration via the ip=... option.
nfsroot
When set, is passed on the command line to override Linux IP autoconfiguration via the ip=... option.
verbose
Currently has no effect.
Params
The Params region of flash contains customization variables used by the bootldr and kernel. Each line is prefixed by a keyword and colon, indicating the consumer of the data. Users may add their own prefixes and extract the data from flash at runtime using fu, grep, and cut.
The only defined keywords are bootldr and profile. Lines prefixed with "bootldr:" are read and evaluated as bootldr commands beforing booting a kernel. Lines prefixed with "profile:" are read and sourced by the NetBSD .profile.
It is easiest to manage the params section by using the params command described above, but this only works if the bootldr is the only software using the params section.
Modified July 17, 2000 Jamey Hicks
|
|
|