/*! @file preboot.h Copyright 2007 VMware Inc. Author: David Elliott */ #ifndef _PREBOOT_H__ #define _PREBOOT_H__ #define PREBOOT_SIGNATURE "PREBOOT" /*! @struct preboot_header If prebooter is used, this will be found in memory by the second-stage booter. */ struct preboot_header { uint8_t signature[8]; // "PREBOOT" (with \0 term) uint16_t length; // Size of complete structure uint8_t checksum; // checksum8 uint8_t pad1; // Padding - ZERO uint32_t p_initrd; // pointer to initrd in memory uint32_t initrd_sectors; // Number of 512 byte sectors } __attribute__((packed)); /*! @function scanPrebootVolumes Searches for the preboot header to find the ramdisk. If found it hooks the disk.c code to make the ramdisk device available and returns a bvchain representing all volumes on the disk. */ extern BVRef scanPrebootVolumes(); /*! @function selectPrebootVolume Given a ramdiskChain (which must currently be a chain of ramdisk volumes this function searches for one with the extra extensions directory and initializes the gPrebootExtraDir with that path so that the preboot code in driver.c knows to search it for additional extensions */ extern BVRef selectPrebootVolume(BVRef ramdiskChain); // String pointer to be filled in if ramdisk contains preboot kexts extern char *gPrebootExtraDir; #endif //ndef _PREBOOT_H__