BIOS(9) | Kernel Developer's Manual | BIOS(9) |
bios_sigsearch
,
bios32_SDlookup
, bios32
,
bios_oem_strings
— interact
with PC BIOS
#include
<sys/param.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include
<machine/pc/bios.h>
uint32_t
bios_sigsearch
(uint32_t
start, u_char *sig,
int siglen,
int paralen,
int sigofs);
int
bios32_SDlookup
(struct
bios32_SDentry *ent);
int
bios32
(struct
bios_regs *br, u_int
offset, u_short
segment);
BIOS_PADDRTOVADDR
(addr);
BIOS_VADDRTOPADDR
(addr);
extern struct bios32_SDentry PCIbios;
extern struct SMBIOS_table SMBIOStable;
extern struct DMI_table DMItable;
int
bios_oem_strings
(struct
bios_oem *oem, u_char
*buffer, size_t
maxlen);
struct bios_oem_signature { char * anchor; /* search anchor string in BIOS memory */ size_t offset; /* offset from anchor (may be negative) */ size_t totlen; /* total length of BIOS string to copy */ }; struct bios_oem_range { u_int from; /* shouldn't be below 0xe0000 */ u_int to; /* shouldn't be above 0xfffff */ }; struct bios_oem { struct bios_oem_range range; struct bios_oem_signature signature[]; };
These functions provide a general-purpose interface for dealing with the BIOS functions and data encountered on x86 PC-architecture systems.
bios_sigsearch
()bios_oem_strings
()0xe0000
- 0xfffff
), and a
{ NULL
, 0
,
0
} -terminated array of
bios_oem_signature structures which define the
anchor string, an offset from
the beginning of the match (which may be negative), and
totlen number of bytes to be collected from BIOS
memory starting at that offset. Unmatched anchors are ignored, whereas
matches are copied from BIOS memory starting at their corresponding
offset with unprintable characters being replaced
with space, and consecutive spaces being suppressed. This composed string
is stored in buffer up to the given
maxlen bytes (including trailing
‘\0
’, and any trailing space
suppressed). If an error is encountered, i.e. trying to read out of said
BIOS range, other invalid input, or buffer overflow,
a negative integer is returned, otherwise the length of the composed
string is returned. In particular, a return value of 0 means that none of
the given anchor strings were found in the specified BIOS memory
range.BIOS_VADDRTOPADDR
()BIOS_PADDRTOVADDR
()At system startup, the BIOS is scanned for the BIOS32 Service Directory (part of the PCI specification), and the existence of the directory is recorded. This can then be used to locate other services.
bios32_SDlookup
()bios32
()August 9, 2005 | Debian |