sboot(2.00) Misc. Reference Manual Pages sboot(2.00) NAME sboot - bootstrap program SYNOPSIS (From armsd, rdp, or exported styxmon connection) load sboot go DESCRIPTION Sboot is a standalone executable, currently available only for the StrongARM architectures (SA110 and SA1100), which loads and starts a program in Inferno boot format (for the ARM, this either an AIF or Plan9-style executable). Sboot loads the bootfile at the entry address specified by the header, usually 0x8000 on the SA1100. After loading, con- trol is passed to the entry location. LOADING SBOOT FROM ARMSD If a board with the old Demon-based monitor is being used, there are at least four ways that sboot can be loaded from the ARM debugger (armsd). If the sboot binary file resides on the host in the current directory, it can be loaded with: load sboot go If sboot has already been loaded into the flash memory or ROM at its default offset (0x8000 on the SWoRD board), then this shortcut can be used: pc=0x40 go If sboot has been loaded into the flash memory or ROM at a different address, then the following sequence can be used: r0= pc=0x48 go Finally, if the system has been set up to autoboot, by set- ting the autoboot vector (described with the 'P' command, below), then sboot will be automatically run upon booting and will attempt to automatically load the kernel. After sboot is started, unless it is in autoboot mode, a command prompt, `>>>', will appear on the debugger console. LOADING SBOOT FROM RDP With the rdp utility (a small armsd replacment which runs under Inferno), sboot will automatically get started unless the '-c' option is given. If the '-c' option is used to go to command mode, the 'sb' command can be used to start sboot. Alternatively, the commands used with armsd should still work as expected. LOADING SBOOT FROM STYXMON From StyxMon, there are many ways that sboot can be loaded. SunOS 5.5.1 Last change: 8 1 sboot(2.00) Misc. Reference Manual Pages sboot(2.00) All of the following examples will assume that StyxMon has been mounted on /n/rdbg. If the sboot binary file resides on the host, it can be sim- ply be copied to /n/rdbg/boot. This will copy it to the board and execute it. If sboot has already been loaded into the flash memory or ROM at its default offset (0x8000 on the SWoRD board), then it can be executed with: echo E > /n/rdbg/ctl If sboot has been loaded into the flash memory or ROM at a different address, then the following sequence can be used: (do not type the angle brackets echo E0xoffset >/n/rdbg/ctl Finally, if the system has been set up to autoboot, by set- ting the autoboot vector (described in the 'P' command, below), then sboot will be automatically run upon booting and will attempt to automatically load the kernel. After loading sboot via StyxMon, it will export the flash partitions into the namespace, with names such as /n/rdbg/flash0sboot. These files can be copied to and from like ordinary files. It will also export a temporary dev- ice, called /n/rdbg/tmp, which is mirrored by the T! device that will be discussed later in this document. FILE AND DEVICE NAMES From the sboot shell prompt, most commands will take filenames as arguments. Filenames can represent devices, or files in the more traditional sense, but in either case a device is always specified. Most filenames are in the form device!unit!file. Some devices have the simpler form device!file, or device!argument. This format is used to be consistent with the plan9.ini format used by Inferno boot loaders (such as b.com) on other platforms. Supported devices are m Memory. The single argument tells the base address to start, and defaults to 0 if omitted. Z Zero device. The single optional argument tells the number of zeros to supply, otherwise an infinite source is available. This is useful for clearing areas of memory, disk blocks, partition tables, etc. D The host debugger file system. The unit is omitted, and the file represents a file on the host machine. These host files are accessed internally via the Boot- Param(8) interface. The D! device can only be used on Demon-based systems, and will not work on StyxMon-based SunOS 5.5.1 Last change: 8 2 sboot(2.00) Misc. Reference Manual Pages sboot(2.00) systems. On systems with StyxMon, use the T! device instead, or directly access the exported flash parti- tions. F Flash memory. The unit can be either the number or name of a partition, where `all' is the entire flash, and `partition' is the partition table. T Temporary file. This only exists for styxmon-based boards. This file will grow as needed, and can be copied to or from as the T! device (from sboot com- mands), or as /n/rdbg/tmp. When accessed from sboot shell commands, filenames may be optionally followed by an offset and/or a length, in the following format: filename@offset[,length] The length is relative to the starting offset. If an offset and/or length is given and no device/filename is specified, then the `m' memory device is used by default. Examples can be found at the end of this document. COMMANDS ? List commands. This listing shows the letter of the command, the minimum and maximum number of arguments, and a short description of the command. > [v|d] Redirect output to video (v), or debugger (d). < [k|d] Redirect input from keyboard (k), or debugger (d). = List all environment variables. Those with asterisks to the left of them are pseudo-variables that have spe- cial meaning, and aren't passed on to programs as part of the environment. variable=value Set a variable to the specified value, which can be either a string or number depending upon the meaning of the variable. Variables can be substituted into the command line using $variablename, similar to many shell programs. P List partition table. This shows, for each partition, the partition device number, the start- ing offset, the total size, permissions, flags, and name. It also shows the autoboot offset. Note that as long as the flash exists, F!all will exist, and represents the entire flash memory. Also, if an area has been set aside for a partition table, then SunOS 5.5.1 Last change: 8 3 sboot(2.00) Misc. Reference Manual Pages sboot(2.00) F!partition will represent that area. All other parti- tions are reconfigurable. P/a number Enable/disable autoboot. Given a partition device number, this will set autoboot to occur from the speci- fied partition. This will also set the internal vector used for finding sboot in debug mode. Setting this to 0 will disable autoboot, but will not change the inter- nal sboot vector. Generally, the partition holding 'sboot' should be used for autobooting. WARNING: set- ting this to anything other than 0 or the sboot parti- tion may make the flash unusable, and might require using an EEPROM burner to reprogram the flash. Even setting the autoboot to load sboot could be dangerous. The autoboot sequence should first be tested with the 'A' command to make sure it behaves as expected, and also to make sure that some means of disabling it is accessible. P/d number Delete the specified partition. P number start size perm flags name Create a partition. The permissions are specified in octal as standard Unix-style permissions. Generally, the flags should be set to 0. P/m Show a map of the entire flash, with sectors offsets and sizes, and whether or not the sector is protected. Sector protection information is not available on all flash devices. P/u number Unprotect the sectors for the specified partition. Changing sector protection is not available on all flash devices. P/p number Protect the sectors for the specified partition. Changing sector protection is not available on all flash devices. T [repeat] Show title. This will cycle through the standard title startup sequence. Given a non-zero parameter, it will cycle indefinately. B Show BootParam information. b [file] [args]... Boot from the specified file/device. Boot arguments SunOS 5.5.1 Last change: 8 4 sboot(2.00) Misc. Reference Manual Pages sboot(2.00) are optional. The file to boot from is optional, and if it is not specified, the command `b $bootfile $boo- targs' will be substituted, using the bootfile and boo- targs environment variables. If the boot file is not specified, and the variable bootfile is not set, an error will be reported. The boot file can be compressed, using gzip format, and will be automati- cally uncompressed prior to execution. e file Examine the specified file, using both hex (in 32-bit words) and ascii formats. d file val [val]... Deposit one or more values into the given file or dev- ice, using 32-bit words. E addr Examine the 32-bit word at the specified address. D addr value Deposit the given 32-bit value at the specified address. S file Stat a file. Get information about the requested file or device. c src dest Copy a file from the source to the destination. A dash (-) can be specified to mean either standard input for the source, or standard output for the destination. c/u src dest Copy a compressed file from the source to the destina- tion, uncompressing it before writing it. This takes a file that was compressed using the gzip format. AUTOBOOT When the autoboot vector is set in the flash to automati- cally run sboot (using the P command), sboot will first cycle through the title sequence, and then try to automati- cally boot from the file specified by the bootfile environ- ment variable, as if the following commands had been typed: T 0 b $bootfile $bootargs The sequence to disable autoboot varies, depending upon the customized autoboot code, but with the standard autoboot sequence it is as follows: SunOS 5.5.1 Last change: 8 5 sboot(2.00) Misc. Reference Manual Pages sboot(2.00) When the title screen starts to fade in, press and hold the Escape key. This should cause the standard kernel boot to be aborted, and the system should instead display a screen asking whether to go into maintenance mode. From this screen, press Ctrl-D to disable autoboot. Ctrl-E may be pressed to re-enable autoboot. In this manner, it is possi- ble to test autoboot first with the 'A' command, then press Escape and Ctrl-E to enable autoboot, ensuring that it will be possible to reach the screen to turn it off again later. Autoboot can also be cleared by using an EEPROM programmer to rewrite the boot monitor to the flash. From the sboot prompt, autoboot can be turned off with the command: P 0 It should be noted, however, that the sboot prompt cannot be easily reached once the machine is restarted with autoboot enabled. In particular, the serial debugger connection is no longer active. EXAMPLES Note: all of these example commands are run from sboot. To see the current partition table: P To create a default partition table, assuming some non-zero information already exists as a partition table, the old information first needs to be cleared. This can be done by copying from the zero device to the partition table: c Z!200 F!partition Now, to create the standard partition table (assuming a 4MB flash), the following commands can be used: P 0 0 8000 644 0 demon P 1 8000 18000 644 0 sboot P 2 20000 80000 666 0 kern P 3 a0000 80000 666 0 kern2 P 4 120000 280000 666 0 fs To boot a kernel that resides in the host filesystem (where armsd is running): b D!infernosword Or for a compressed kernel: b D!infernosword.gz To download a new kernel into flash, after first compressing the kernel with gzip: c D!infernosword.gz F!kern SunOS 5.5.1 Last change: 8 6 sboot(2.00) Misc. Reference Manual Pages sboot(2.00) To download a compressed file system to the board, uncompress it, and save it to a flash partition called fs: c/u D!swordfs.gz F!fs To boot the kernel out of flash: b F!kern To boot a kernel that needs to use serial line for some other purpose (such as a PPP link), and to be able to switch the line while the kernel is uncompressing, it is necessary to redirect the output to the screen first, instead of the default debugger console. This can be accomplished with: > v b F!kern To examine memory, for instance 200 bytes at offset 4000: e @4000,200 Alternatively, this format could be used to quickly examine a single 32-bit word: E 4000 To deposit three values in memory, for instance the values 1, 2, and 3 at offset 0xa94 (in 32-bit words): d @a94 1 2 3 Alternatively, to change a single value, this format could be used: D a94 1 To enter new lines directly into the plan9.ini partition, first zero it out to be safe: c Z!1000 F!plan9.ini Then tell sboot to copy from standard input to the parti- tion: c - F!plan9.ini After entering the new lines, end it with Ctrl-D. When typ- ing on the device, this only has to be typed once. From ARMSD, Ctrl-D needs to be typed twice, and when using ARMSD from DOS/Windows, Ctrl-D needs to be entered twice, then followed by a carriage return. To change the bootfile variable to F!kern2: bootfile=F!kern2 To change the default radix to 10 (it defaults to 16): r=10 FILES swordmon sboot SEE ALSO plan9.ini(8) b.com(8) SunOS 5.5.1 Last change: 8 7