|C H A P T E R 5|
Loading and Executing Programs
The User Interface provides several methods for loading and executing a program. These methods load a file into memory from Ethernet, a hard disk, a floppy disk, and serial port A, and support the execution of Forth, FCode and binary executable programs.
In the example above, filename must be relative to the server's root. Use 4000 (hex) as the address for dload input. dload uses the trivial file transfer protocol (TFTP), so the server may need to have its permissions adjusted for this to work.
byte-load is used by OpenBoot to interpret FCode programs on expansion boards such as SBus. The 1 in the example is a specific value of a parameter that specifies the separation between FCode bytes in the general case. Since dload loads into system memory, 1 is the correct spacing.
dload does not use intermediate booters (unlike the boot command). Thus, any symbol information included in the a.out file is available to the User Interface's symbolic debugging capability. (See Chapter 6 '' for more information on symbolic debugging.)
device-specifier is either a full device path name or a device alias. (See Chapter 1 for information on device path names and aliases.)
For a hard disk or floppy partition, filename is relative to the resident file system. (See Appendix B ", for information on creating a bootable floppy disk.) For Ethernet, filename is relative to the system's root partition on its root server. In both cases, the leading / must be omitted from the file path.
boot uses intermediate booters to accomplish its task. When loading from a hard disk or floppy disk, OpenBoot first loads the disk's boot block, which in turn loads a second-level booter. When loading over Ethernet, the firmware uses TFTP to load the second-level booter. filename and -h are passed to these intermediate booters.
Forth programs are ASCII source files that must be converted to the file format required by the secondary boot program. A utility called fakeboot is available from the SBus Support Group at Sun to perform this conversion. After the file is loaded into memory, it can be executed using the command eval .
FCode programs produced by a Tokenizer (which creates FCode programs) may need to be converted to the file format of the secondary boot program. fakeboot may be useful in this process. Once the file is in memory, execute it using the byte-load command.
To load the file over the serial line, connect the system-under-test's serial port to a machine that is able to transfer a file on request, and start a terminal emulator on that system. The terminal emulator is then used to download the file using dl .
The following example assumes the use of the Unix terminal emulator tip . (See Appendix A ", for information on this procedure.)
FCode and binary programs loaded with dlbin must be a.out files. dlbin loads the files at the entry point indicated in the a.out header. Link binary files for 4000 (hex). Recent versions of the FCode Tokenizer create an a.out file with entry point 4000.
To load the file over the serial line, connect the system's serial port A to a machine that is able to transfer a file on request. The following example assumes a tip window setup. (See Appendix A ", for information on this procedure.)