The LOADER
The loader is basically a stripped-down kernel. The things that
distinguish it from the kernel are:
- uniprocessor only
- virtual addresses = physical addresses
- the only image it can load is the kernel
- no user mode
- special simple command-line interface
- it runs at 'softint' level, so it is non-preemptive, but you can
have multiple threads
The design goals of the loader are:
- It can support just about any load-media device
driver written for the kernel in an unaltered form
- It can copy files from distribution media
- It can set system boot parameters
- It can write boot blocks
- It can load the kernel
- It can run as a user-mode program under either OZONE or
another operating system (such as Linux) for preparing
distribution media
Using the loader
It is booted into memory by the bootblock. It will prompt for commands
at the keyboard. If it doesn't get any within 5 seconds, it just goes
ahead and boots the kernel using the parameters saved from before. You
can manually change any of the parameters by typing in commands before
it loads the kernel if you want. There is an HELP command you can type
to list out what commands it has. Here is the output of the HELP command
(today anyway):
BARF - force access violation
COPY <from> <to> - copy file
DELETE <file> - delete file
DEVICES [-FULL] - list out devices
DIR <directory> - list out directory
DISMOUNT <fsdevice> - dismount filesystem device
DUMP <file> <count> <startvbn> - dump a file
EXIT - continue boot process
EXTRA <name> <value> - set extra name's value
EXTRAS - list out all extras
HELP - print help message
INIT <disk> <template> <volname> - initialize <disk> using <template> to <volname>
LOGICALS - list out all logical names
MKDIR <directory> - create a directory
MOUNT [-NOCACHE] [-READONLY] <disk> <template> - mount <disk> device on <template> filesystem
SET <parameter> <value> - set a parameter to the given value
SHOW - display all the parameters
TYPE <file> - display a file's contents
WRITEBOOT <loaderimage> [<secpertrk> [<trkpercyl>]] - write bootblock for given loader image
There is also another version of the loader, oz_loader_linux. This will run as an user-mode
program under linux. It is the same exact loader program with different drivers. It is used
to create a boot disk.
One of the main purposes of the loader is so you can set system parameters before the kernel
is loaded into memory. The SET and SHOW commands are provided to access the parameters.
- load_device - specifies the name of the device the kernel is to be booted from (ide_pm.3)
- load_directory - specifies the name of the directory the kernel is located in (/ozone/binaries/)
- load_fstemplate - specifies the name of the filesystem template device (oz_dfs)
- load_script - specifies the name of a file containing loader commands to execute before the
kernel is read into memory, relative to load_directory (../startup/smpboot.ldr)
- kernel_image - specifies the name of the kernel image to load (oz_kernel_486.oz)
- startup_image - specifies the name of the image to execute on startup (oz_cli.oz)
- startup_input - specifies the input file for the startup_image (../startup/hardiskstartup.cli)
- startup_output - specifies the output file for the startup_image (console:)
- startup_error - specifies the error file for the startup_image (console:)
- startup_params - specifies the command line parameters for the startup_image
- kernel_stack_size - specifies the size of kernel stacks, in bytes (12288)
- def_user_stack_size - specifies the size of user stacks, in bytes (1048576)
- nonpaged_pool_size - specifies the size of non-paged pool, in bytes (8388608)
- cpu_disable - bitmask of alternate cpu's to disable (0)
- debug_init - set to 1 to have debugger called on initialization (0)
- knl_exception
- 0 : call kernel debugger on kernel exception
- 1 : write to active crash dump file on kernel exception
- 2 : reboot on kernel exception
- tz_offset_rtc - specifies the offset (in minutes) for the RTC (eg, -18000 if RTC is in EST)
- tz_offset_conv - specifies the offset (in minutes) for output conversions (eg, -18000 to display in EST)
- uniprocessor - set to 1 to inhibit starting alternate cpu's on boot (default is 0)
- memory_megabytes - force this physical memory size (0 to have it autosize)
- monochrome - force video output to be black-and-white
- signature - gets set by 'writeboot' command to uniquely identify this boot volume
The 'load_device' parameter may be left null. If this is the case, the loader will scan for disk drives (CDROM,
floppy and hard) that:
- are online
- have media in them
- have enough blocks on them to contain the same blocks that the loader image was read in from
- contain the exact same initial parameter block, including signature, as the currently booted loader
The first (if any) that is found is used as the boot device and its name fills in the load_device parameter.