This source file includes following definitions.
- bios_romheader_t
- bios32_header_t
- bios32_entry_info_t
- bios32_entry_t
- bios_memmap_t
- bios_diskinfo_t
- bios_apminfo_t
- bios_pciinfo_t
- bios_consdev_t
- bios_bootmac_t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #ifndef _I386_BIOSVAR_H_
30 #define _I386_BIOSVAR_H_
31 #pragma pack(1)
32
33
34 #define BOOTARG_OFF (NBPG*2)
35 #define BOOTARG_LEN (NBPG*1)
36 #define BOOTBIOS_ADDR (0x7c00)
37
38
39 #define BIOSF_BIOS32 0x0001
40 #define BIOSF_PCIBIOS 0x0002
41 #define BIOSF_PROMSCAN 0x0004
42 #define BIOSF_SMBIOS 0x0008
43
44
45 #define BIOSM_F320K 0xff
46 #define BIOSM_F160K 0xfe
47 #define BIOSM_F360K 0xfd
48 #define BIOSM_F180K 0xfc
49 #define BIOSM_ROMD 0xfa
50 #define BIOSM_F120M 0xf9
51 #define BIOSM_F720K 0xf9
52 #define BIOSM_HD 0xf8
53 #define BIOSM_F144K 0xf0
54 #define BIOSM_OTHER 0xf0
55
56
57
58
59 #define BIOS_MAP_END 0x00
60 #define BIOS_MAP_FREE 0x01
61 #define BIOS_MAP_RES 0x02
62 #define BIOS_MAP_ACPI 0x03
63 #define BIOS_MAP_NVS 0x04
64
65
66
67
68 typedef
69 struct bios_romheader {
70 u_int16_t signature;
71 u_int8_t len;
72 u_int32_t entry;
73 u_int8_t reserved[19];
74 u_int16_t pnpheader;
75 } *bios_romheader_t;
76
77
78
79
80 typedef
81 struct bios32_header {
82 u_int32_t signature;
83 u_int32_t entry;
84 u_int8_t rev;
85 u_int8_t length;
86 u_int8_t cksum;
87 u_int8_t reserved[5];
88 } *bios32_header_t;
89
90 typedef
91 struct bios32_entry_info {
92 u_int32_t bei_base;
93 u_int32_t bei_size;
94 u_int32_t bei_entry;
95 } *bios32_entry_info_t;
96
97 typedef
98 struct bios32_entry {
99 u_int32_t offset;
100 u_int16_t segment;
101 } *bios32_entry_t;
102
103 #define BIOS32_START 0xe0000
104 #define BIOS32_SIZE 0x20000
105 #define BIOS32_END (BIOS32_START + BIOS32_SIZE - 0x10)
106
107 #define BIOS32_MAKESIG(a, b, c, d) \
108 ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
109 #define BIOS32_SIGNATURE BIOS32_MAKESIG('_', '3', '2', '_')
110 #define PCIBIOS_SIGNATURE BIOS32_MAKESIG('$', 'P', 'C', 'I')
111 #define SMBIOS_SIGNATURE BIOS32_MAKESIG('_', 'S', 'M', '_')
112
113
114
115
116 #define BIOS_DEV 1
117 #define BIOS_DISKINFO 2
118 #define BIOS_CKSUMLEN 3
119 #define BIOS_MAXID 4
120
121 #define CTL_BIOS_NAMES { \
122 { 0, 0 }, \
123 { "biosdev", CTLTYPE_INT }, \
124 { "diskinfo", CTLTYPE_STRUCT }, \
125 { "cksumlen", CTLTYPE_INT }, \
126 }
127
128 #define BOOTARG_MEMMAP 0
129 typedef struct _bios_memmap {
130 u_int64_t addr;
131 u_int64_t size;
132 u_int32_t type;
133 } bios_memmap_t;
134
135
136
137
138
139
140
141
142
143 #define BOOTARG_DISKINFO 1
144 typedef struct _bios_diskinfo {
145
146 int bios_number;
147 u_int bios_cylinders;
148 u_int bios_heads;
149 u_int bios_sectors;
150 int bios_edd;
151
152
153 dev_t bsd_dev;
154
155
156 u_int32_t checksum;
157
158
159 u_int32_t flags;
160 #define BDI_INVALID 0x00000001
161 #define BDI_GOODLABEL 0x00000002
162 #define BDI_BADLABEL 0x00000004
163 #define BDI_EL_TORITO 0x00000008
164 #define BDI_PICKED 0x80000000
165
166 } bios_diskinfo_t;
167
168 #define BOOTARG_APMINFO 2
169 typedef struct _bios_apminfo {
170
171 u_int apm_detail;
172 u_int apm_code32_base;
173 u_int apm_code16_base;
174 u_int apm_code_len;
175 u_int apm_data_base;
176 u_int apm_data_len;
177 u_int apm_entry;
178 u_int apm_code16_len;
179 } bios_apminfo_t;
180
181 #define BOOTARG_CKSUMLEN 3
182
183 #define BOOTARG_PCIINFO 4
184 typedef struct _bios_pciinfo {
185
186 u_int32_t pci_chars;
187 u_int32_t pci_rev;
188 u_int32_t pci_entry32;
189 u_int32_t pci_lastbus;
190 } bios_pciinfo_t;
191
192 #define BOOTARG_CONSDEV 5
193 typedef struct _bios_consdev {
194 dev_t consdev;
195 int conspeed;
196 } bios_consdev_t;
197
198 #define BOOTARG_SMPINFO 6
199
200 #define BOOTARG_BOOTMAC 7
201 typedef struct _bios_bootmac {
202 char mac[6];
203 } bios_bootmac_t;
204
205 #if defined(_KERNEL) || defined (_STANDALONE)
206
207 #ifdef _LOCORE
208 #define DOINT(n) int $0x20+(n)
209 #else
210 #define DOINT(n) "int $0x20+(" #n ")"
211
212 extern volatile struct BIOS_regs {
213 u_int32_t biosr_ax;
214 u_int32_t biosr_cx;
215 u_int32_t biosr_dx;
216 u_int32_t biosr_bx;
217 u_int32_t biosr_bp;
218 u_int32_t biosr_si;
219 u_int32_t biosr_di;
220 u_int32_t biosr_ds;
221 u_int32_t biosr_es;
222 } BIOS_regs;
223
224 #ifdef _KERNEL
225 #include <machine/bus.h>
226
227 struct bios_attach_args {
228 char *bios_dev;
229 u_int bios_func;
230 bus_space_tag_t bios_iot;
231 bus_space_tag_t bios_memt;
232 union {
233 void *_p;
234 bios_apminfo_t *_bios_apmp;
235 } _;
236 };
237
238 #define bios_apmp _._bios_apmp
239
240 struct consdev;
241 struct proc;
242
243 int bios_sysctl(int *, u_int, void *, size_t *, void *, size_t, struct proc *);
244
245 void bioscnprobe(struct consdev *);
246 void bioscninit(struct consdev *);
247 void bioscnputc(dev_t, int);
248 int bioscngetc(dev_t);
249 void bioscnpollc(dev_t, int);
250 void bios_getopt(void);
251
252
253 int bios32_service(u_int32_t, bios32_entry_t, bios32_entry_info_t);
254
255 extern u_int bootapiver;
256 extern bios_memmap_t *bios_memmap;
257 extern void *bios_smpinfo;
258 extern bios_pciinfo_t *bios_pciinfo;
259
260 #endif
261 #endif
262 #endif
263
264 #pragma pack()
265 #endif