The startup_header structure's info member is an
array of startup_info* structures that provide a communications area between
the IPL and the startup code.
When the IPL code detects system features (e.g., amount of memory installed, current
time, information about the bus used on the system, etc.), it stores this information in
the info array so that the startup code can retrieve it later.
This design saves the startup code from repeating the same detection logic as the IPL.
The startup_info* structures and enumerated types include:
startup_info_hdr,
startup_info_types,
startup_info_skip,
startup_info_mem and
startup_info_mem_extended,
startup_info_disk,
startup_info_time,
startup_info_box,
bootargs_entry,
startup_trailer
startup_info_hdr
The
info member is declared as an array of
_Uint32t
fields. This declaration allocates a storage area that contains a set of structures,
each beginning with a
startup_info_hdr header:
struct startup_info_hdr {
_Uint16t type;
_Uint16t size;
};
Member |
Type |
Description |
type |
_Uint16t |
One of the startup_info_types enumerated values
(see startup_info_types
below) |
size |
_Uint16t |
Size of the current startup_info_* structure, in bytes |
startup_info_types
enum startup_info_types {
STARTUP_INFO_SKIP = 0, /* If size 0 then end of list */
STARTUP_INFO_MEM,
STARTUP_INFO_DISK,
STARTUP_INFO_TIME,
STARTUP_INFO_BOX,
STARTUP_INFO_USER = 0x8000 /* User reserved numbers start here */
};
The
startup_info_hdr enumerated types include:
- STARTUP_INFO_SKIP
- Ignore this field. If the corresponding size member is 0,
this is the end of the info list.
- STARTUP_INFO_MEM
- A startup_info_mem or startup_info_mem_extended
structure is present.
- STARTUP_INFO_DISK
- A startup_info_disk structure is present.
- STARTUP_INFO_TIME
- A startup_info_time structure is present.
- STARTUP_INFO_BOX
- A startup_info_box structure is present.
startup_info_skip
This structure is used to indicate the end of the
info list;
it stores no extra information:
struct startup_info_skip {
struct startup_info_hdr hdr;
};
startup_info_mem and
startup_info_mem_extended
These structures each contain an address and size pair defining a chunk of memory that
should be added to procnto's free memory pool.
The
startup_info_mem structure is defined as follows:
struct startup_info_mem {
struct startup_info_hdr hdr;
_Uint32t addr;
_Uint32t size;
};
Member |
Type |
Description |
startup_info_hdr |
struct |
Standard info array header structure |
addr |
_Uint32t |
Memory block start address |
size |
_Uint32t |
Memory block size, in bytes |
The
addr and
size fields are 32 bits long,
so memory is limited to 4 GB. For larger memory blocks,
the
startup_info_mem_extended structure is used:
struct startup_info_mem_extended {
struct startup_info_mem mem;
_Uint32t addr_hi;
_Uint32t size_hi;
};
Member |
Type |
Description |
startup_info_mem |
struct |
The structure for memory blocks that are less than 4 GB |
addr_hi |
_Uint32t |
High portion of the memory address (see below) |
size_hi |
_Uint32t |
High portion of the memory size (see below) |
For the extended structure, you can determine the address and size from
the
addr_hi and
size_hi members and the
encapsulated
startup_info_mem structure as follows:
((paddr64_t) addr_hi << 32) | mem.addr
((paddr64_t) size_hi << 32) | mem.size
Note:
More than one startup_info_mem or
startup_info_mem_extended structure
may be present to accommodate systems that have free memory located in various blocks
throughout the address space.
Both structures are identified by a type member of
STARTUP_INFO_MEM in the startup_info_hdr structure;
use the size field in the header to tell them apart.
startup_info_disk
The
startup_info_disk structure contains information about any hard disks
detected. It is defined as follows:
struct startup_info_disk {
struct startup_info_hdr hdr;
_Uint8t drive;
_Uint8t zero;
_Uint16t heads;
_Uint16t cylinders;
_Uint16t sectors;
_Uint32t blocks;
};
Member |
Type |
Description |
startup_info_hdr |
struct |
Standard info array header structure |
drive |
_Uint8t |
Drive number |
zero |
_Uint8t |
Reserved; must be zero |
heads |
_Uint16t |
Number of heads present |
cylinders |
_Uint16t |
Number of cylinders present |
sectors |
_Uint16t |
Number of sectors present |
blocks |
_Uint32t |
Total block size of device. Assuming 512 bytes per block, the total size
is calculated as heads ×
cylinders × sectors. |
startup_info_time
The
startup_info_time structure contains a record of the system's most
recent startup time. It is defined as follows:
struct startup_info_time {
struct startup_info_hdr hdr;
_Uint32t time;
};
Member |
Type |
Description |
startup_info_hdr |
struct |
Standard info array header structure |
time |
_Uint32t |
Current time as the number of seconds since 1970 01 01 00:00:00 GMT. |
startup_info_box
struct startup_info_box {
struct startup_info_hdr hdr;
_Uint8t boxtype;
_Uint8t bustype;
_Uint8t spare[2];
};
Member |
Type |
Description |
startup_info_hdr |
struct |
Standard info array header structure |
boxtype |
_Uint8t |
|
bustype |
_Uint8t |
|
spare[2] |
_Uint8t |
Reserved, must be zero |
bootargs_entry
struct bootargs_entry {
_Uint8t size_lo; /* Includes entire structure */
_Uint8t size_hi;
_Int8t argc;
_Int8t envc;
_Uint32t shdr_addr;
char args[1]; /* variable length */
};
Member |
Type |
Description |
size_lo |
_Uint8t |
|
size_hi |
_Uint8t |
|
argc |
_Int8t |
|
envc |
_Int8t |
|
shdr_addr |
_Uint32t |
|
args[1] |
char |
|
startup_trailer
The
startup_trailer structure contains a checksum for the
startup_header structure, calculated from the start of the header to the
start of the trailer (this structure). It is defined as follows:
struct startup_trailer {
unsigned long cksum;
};
Member |
Type |
Description |
cksum |
_Uint32t |
Checksum from start of header to start of trailer |