16b8d502dSMike Smith.\" $Id: bios.9,v 1.1 1997/08/01 06:04:08 msmith Exp $ 2a1dadd10SMike Smith.\" 3a1dadd10SMike Smith.\" Copyright (c) 1997 Michael Smith 4a1dadd10SMike Smith.\" All rights reserved. 5a1dadd10SMike Smith.\" 6a1dadd10SMike Smith.\" Redistribution and use in source and binary forms, with or without 7a1dadd10SMike Smith.\" modification, are permitted provided that the following conditions 8a1dadd10SMike Smith.\" are met: 9a1dadd10SMike Smith.\" 1. Redistributions of source code must retain the above copyright 10a1dadd10SMike Smith.\" notice, this list of conditions and the following disclaimer. 11a1dadd10SMike Smith.\" 2. Redistributions in binary form must reproduce the above copyright 12a1dadd10SMike Smith.\" notice, this list of conditions and the following disclaimer in the 13a1dadd10SMike Smith.\" documentation and/or other materials provided with the distribution. 14a1dadd10SMike Smith.\" 15a1dadd10SMike Smith.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16a1dadd10SMike Smith.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17a1dadd10SMike Smith.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18a1dadd10SMike Smith.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19a1dadd10SMike Smith.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20a1dadd10SMike Smith.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21a1dadd10SMike Smith.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22a1dadd10SMike Smith.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23a1dadd10SMike Smith.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24a1dadd10SMike Smith.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25a1dadd10SMike Smith.\" SUCH DAMAGE. 26a1dadd10SMike Smith.\" 27a1dadd10SMike Smith.Dd Aug 1, 1997 286b8d502dSMike Smith.Dt BIOS 9 29a1dadd10SMike Smith.Os FreeBSD 30a1dadd10SMike Smith.Sh NAME 31a1dadd10SMike Smith.Nm bios_sigsearch , 32a1dadd10SMike Smith.Nm bios32_SDlookup , 33a1dadd10SMike Smith.Nm bios32 34a1dadd10SMike Smith.Nd Interact with PC BIOS. 35a1dadd10SMike Smith.Sh SYNOPSIS 36a1dadd10SMike Smith.Fd #include <machine/pc/bios.h> 37a1dadd10SMike Smith.Ft u_int32_t 38a1dadd10SMike Smith.Fn bios_sigsearch "u_int32_t start" "u_char *sig" "int siglen" "int paralen" "int sigofs" 39a1dadd10SMike Smith.Ft int 40a1dadd10SMike Smith.Fn bios32_SDlookup "struct bios32_SDentry *ent" 41a1dadd10SMike Smith.Ft void 42a1dadd10SMike Smith.Fn bios32 "caddr_t entry" "struct bios32_args *args" 43a1dadd10SMike Smith.Fn BIOS_PADDRTOVADDR "addr" 44a1dadd10SMike Smith.Fn BIOS_VADDRTOPADDR "addr" 45a1dadd10SMike Smith.Ft extern struct bios32_SDentry PCIbios; 46a1dadd10SMike Smith.Ft extern struct SMBIOS_table SMBIOStable; 47a1dadd10SMike Smith.Ft extern struct DMI_table DMItable; 48a1dadd10SMike Smith.Sh DESCRIPTION 49a1dadd10SMike SmithThese functions provide a general-purpose interface for dealing with 50a1dadd10SMike Smiththe BIOS functions and data encountered on x86 PC-architecture systems. 51a1dadd10SMike Smith.Bl -tag -width 20n 52a1dadd10SMike Smith.It Fn bios_sigsearch 53a1dadd10SMike SmithSearches the BIOS address space for a service signature, usually an 54a1dadd10SMike Smithuppercase ASCII sequence surrounded by underscores. The search begins 55a1dadd10SMike Smithat 56a1dadd10SMike Smith.Fa start , 57a1dadd10SMike Smithor at the beginning of the BIOS if 58a1dadd10SMike Smith.Fa start 59a1dadd10SMike Smithis zero. 60a1dadd10SMike Smith.Fa siglen 61a1dadd10SMike Smithbytes of the BIOS image and 62a1dadd10SMike Smith.Fa sig 63a1dadd10SMike Smithare compared at 64a1dadd10SMike Smith.Fa sigofs 65a1dadd10SMike Smithbytes offset from the current location. If no match is found, the 66a1dadd10SMike Smithcurrent location is incremented by 67a1dadd10SMike Smith.Fa paralen 68a1dadd10SMike Smithbytes and the search repeated. If the signature is found, its effective 69a1dadd10SMike Smithphysical address is returned. If no signature is found, zero is returned. 70a1dadd10SMike Smith.It Fn BIOS_VADDRTOPADDR 71a1dadd10SMike SmithReturns the effective physical address which corresponds to the kernel 72a1dadd10SMike Smithvirtual address 73a1dadd10SMike Smith.Fa addr . 74a1dadd10SMike Smith.It Fn BIOS_VADDRTOPADDR 75a1dadd10SMike SmithReturns the kernel virtual address which corresponds to the effective 76a1dadd10SMike Smithphysical address 77a1dadd10SMike Smith.Fa addr . 78a1dadd10SMike Smith.It SMBIOStable 79a1dadd10SMike SmithIf not NULL, points to a 80a1dadd10SMike Smith.Ft struct SMBIOS_table 81a1dadd10SMike Smithstructure containing information read from the System Management BIOS table 82a1dadd10SMike Smithduring system startup. 83a1dadd10SMike Smith.It DMItable 84a1dadd10SMike SmithIf not NULL, points to a 85a1dadd10SMike Smith.Ft struct DMI_table 86a1dadd10SMike Smithstructure containing information read from the Desktop Management Interface 87a1dadd10SMike Smithparameter table during system startup. 88a1dadd10SMike Smith.El 89a1dadd10SMike Smith.Sh BIOS32 90a1dadd10SMike SmithAt system startup, the BIOS is scanned for the BIOS32 Service Directory 91a1dadd10SMike Smith(part of the PCI specification), and the existence of the directory is 92a1dadd10SMike Smithrecorded. This can then be used to locate other services. 93a1dadd10SMike Smith.Bl -tag -width 20n 94a1dadd10SMike Smith.It Fn bios32_SDlookup 95a1dadd10SMike SmithAttempts to locate the BIOS32 service matching the 4-byte identifier 96a1dadd10SMike Smithpassed in the 97a1dadd10SMike Smith.Fa ident 98a1dadd10SMike Smithfield of the 99a1dadd10SMike Smith.Fa ent 100a1dadd10SMike Smithargument. 101a1dadd10SMike Smith.It Fn bios32 102a1dadd10SMike SmithCalls a bios32 function. This presumes that the function is capable of 103a1dadd10SMike Smithworking within the kernel segment (normally the case). The virtual address 104a1dadd10SMike Smithof the entrypoint is supplied in 105a1dadd10SMike Smith.Fa entry 106a1dadd10SMike Smithand the register arguments to the function are supplied in 107a1dadd10SMike Smith.Fa args . 108a1dadd10SMike Smith.It PCIbios 109a1dadd10SMike SmithIf not NULL, points to a 110a1dadd10SMike Smith.Ft struct bios32_SDentry 111a1dadd10SMike Smithstructure describing the PCI BIOS entrypoint which was found during system 112a1dadd10SMike Smithstartup. 113a1dadd10SMike Smith.El 114a1dadd10SMike Smith 115