1 /* ----------------------------------------------------------------------- *
3 * Copyright 2001-2009 H. Peter Anvin - All Rights Reserved
4 * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
5 * Portions copyright 2009-2010 Shao Miller
6 * [El Torito code, mBFT, "safe hook"]
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
11 * Boston MA 02111-1307, USA; either version 2 of the License, or
12 * (at your option) any later version; incorporated herein by reference.
14 * ----------------------------------------------------------------------- */
16 /* These structures are common to MEMDISK and MDISKCHK.COM */
27 struct seg_off seg_off;
31 /* Forward declaration */
36 uint8_t jump[3]; /* Max. three bytes for jump */
37 uint8_t signature[8]; /* "$INT13SF" */
38 uint8_t vendor[8]; /* "MEMDISK " */
39 real_addr_t old_hook; /* SEG:OFF for previous INT 13h hook */
40 uint32_t flags; /* "Safe hook" flags */
41 /* The next field is a MEMDISK extension to the "safe hook" structure */
43 } MEMDISK_PACKED_POSTFIX;
45 struct memdisk_header {
51 struct safe_hook safe_hook;
55 /* EDD disk parameter table */
57 uint16_t len; /* Length of table */
58 uint16_t flags; /* Information flags */
59 uint32_t c; /* Physical cylinders (count!) */
60 uint32_t h; /* Physical heads (count!) */
61 uint32_t s; /* Physical sectors/track (count!) */
62 uint64_t sectors; /* Total sectors */
63 uint16_t bytespersec; /* Bytes/sector */
64 real_addr_t dpte; /* DPTE pointer */
65 uint16_t dpikey; /* Device Path Info magic */
66 uint8_t dpilen; /* Device Path Info length */
67 uint8_t res1; /* Reserved */
68 uint16_t res2; /* Reserved */
69 uint8_t bustype[4]; /* Host bus type */
70 uint8_t inttype[8]; /* Interface type */
71 uint64_t intpath; /* Interface path */
72 uint64_t devpath[2]; /* Device path (double QuadWord!) */
73 uint8_t res3; /* Reserved */
74 uint8_t chksum; /* DPI checksum */
75 } MEMDISK_PACKED_POSTFIX;
77 /* Requirement for struct edd4_cd_pkt */
78 #include "../memdisk/eltorito.h"
80 /* Official MEMDISK Info structure ("MDI") */
84 const uint8_t version_minor;
85 const uint8_t version_major;
99 } MEMDISK_PACKED_POSTFIX;
101 /* Requirement for struct acpi_description_header */
102 #include "../memdisk/acpi.h"
104 MEMDISK_PACKED_PREFIX
106 struct acpi_description_header acpi;
107 uint32_t safe_hook; /* "Safe hook" physical address */
109 } MEMDISK_PACKED_POSTFIX;
111 /* The Disk Parameter Table may be required */
114 uint16_t max_cyl; /* Max cylinder */
115 uint8_t max_head; /* Max head */
116 uint8_t junk1[5]; /* Obsolete junk, leave at zero */
117 uint8_t ctrl; /* Control byte */
118 uint8_t junk2[7]; /* More obsolete junk */
121 uint8_t specify1; /* "First specify byte" */
122 uint8_t specify2; /* "Second specify byte" */
123 uint8_t delay; /* Delay until motor turn off */
124 uint8_t sectors; /* Sectors/track */
126 uint8_t bps; /* Bytes/sector (02h = 512) */
127 uint8_t isgap; /* Length of intersector gap */
128 uint8_t dlen; /* Data length (0FFh) */
129 uint8_t fgap; /* Formatting gap */
131 uint8_t ffill; /* Format fill byte */
132 uint8_t settle; /* Head settle time (ms) */
133 uint8_t mstart; /* Motor start time */
134 uint8_t maxtrack; /* Maximum track number */
136 uint8_t rate; /* Data transfer rate */
137 uint8_t cmos; /* CMOS type */
140 uint32_t old_fd_dpt; /* Extension: pointer to old INT 1Eh */
144 MEMDISK_PACKED_PREFIX
148 uint8_t driveshiftlimit; /* Do not shift drives above this region */
149 uint8_t _pad2; /* Pad to DWORD */
150 uint16_t _pad3; /* Pad to QWORD */
166 #define CONFIG_READONLY 0x01
167 #define CONFIG_RAW 0x02
168 #define CONFIG_SAFEINT 0x04
169 #define CONFIG_BIGRAW 0x08 /* MUST be 8! */
170 #define CONFIG_MODEMASK 0x0e
176 struct edd_dpt edd_dpt;
177 struct edd4_cd_pkt cd_pkt; /* Only really in a memdisk_iso_* hook */
178 } MEMDISK_PACKED_POSTFIX;