HPUXBOOT: The Secondary Loader

   

The secondary boot loader is called HPUXBOOT, but is also sometimes called Mongoose, the name it used while under development. More information on HPUXBOOT can be found in the hpux(1m) man page. Its job is to locate the kernel image and copy it into memory, then branch to it.

The first thing it does is relocate itself from its fixed starting point of 0xd00000 to near the end of the IMM. The 0xd00000 address was picked to guarantee that it will fit into a 16-MB memory module. But when the kernel gets loaded into memory, it gets loaded before HPUXBOOT, so HPUXBOOT needs to move itself out of the way. It calculates its new address so that it will end at the end of IMM minus 2 MB.

HPUXBOOT must now locate the HP-UX kernel and load it into memory. The command-line arguments to HPUXBOOT either from the AUTO file or from a manual boot can specify the location of the kernel. In most cases, the AUTO file does not specify arguments to HPUXBOOT, in which case HPUXBOOT looks for the kernel on the device from which it was booted.

HPUXBOOT is able to read the standard HFS file system. It looks for the kernel in two different locations: /stand/vmunix and /vmunix. These names are relative to the mount point of the file system, so the /vmunix case is for configurations, where /stand is a separate file system from /. If the system does not have a separate /stand file system, then the kernel is found in /stand/vmunix in the root file system. If /stand is a separate file system, then the kernel is found in /vmunix under that file system.

Once HPUXBOOT has located the kernel file, it reads the headers of that file to find the load point in memory and the entry point. The load point for the kernel is always address 0x20000. HPUXBOOT then branches to the entry point for the kernel.

We've now made it to the point where we're actually running in the kernel code, but we have a long way to go. Here is our state when we start the kernel:

  • Only the monarch processor is running. All the other processors are waiting for an interrupt.

  • The processor is in narrow mode, and virtual address translation is turned off.

  • The space registers and most of the control registers are zero or uninitialized.

  • General registers arg0, arg1, and arg2 were set by HPUXBOOT. Other than that, all general registers are uninitialized.

  • The cache is either clean or invalid.

  • All TLB entries are invalid.

  • The only memory that is usable is the IMM.

We do have information in memory from PDC that we can use for example, the location of the IODC routines and the size of memory. Also, HPUXBOOT is still in memory and we have pointers to its I/O routines to help out with doing disk I/O.



HP-UX 11i Internals
HP-UX 11i Internals
ISBN: 0130328618
EAN: 2147483647
Year: 2006
Pages: 167

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net