17f3dea24SPeter Wemm.\" $FreeBSD$ 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.\" 27d7b336c0SRuslan Ermilov.Dd August 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 34eb083802SRuslan Ermilov.Nd interact with PC BIOS 35a1dadd10SMike Smith.Sh SYNOPSIS 36b1d3fc49SBruce Evans.Fd #include <sys/types.h> 37a1dadd10SMike Smith.Fd #include <machine/pc/bios.h> 38a1dadd10SMike Smith.Ft u_int32_t 39a1dadd10SMike Smith.Fn bios_sigsearch "u_int32_t start" "u_char *sig" "int siglen" "int paralen" "int sigofs" 40a1dadd10SMike Smith.Ft int 41a1dadd10SMike Smith.Fn bios32_SDlookup "struct bios32_SDentry *ent" 42a1dadd10SMike Smith.Ft void 43a1dadd10SMike Smith.Fn bios32 "caddr_t entry" "struct bios32_args *args" 44a1dadd10SMike Smith.Fn BIOS_PADDRTOVADDR "addr" 45a1dadd10SMike Smith.Fn BIOS_VADDRTOPADDR "addr" 46b77b3c00SRuslan Ermilov.Vt extern struct bios32_SDentry PCIbios ; 47b77b3c00SRuslan Ermilov.Vt extern struct SMBIOS_table SMBIOStable ; 48b77b3c00SRuslan Ermilov.Vt extern struct DMI_table DMItable ; 49a1dadd10SMike Smith.Sh DESCRIPTION 50a1dadd10SMike SmithThese functions provide a general-purpose interface for dealing with 51a1dadd10SMike Smiththe BIOS functions and data encountered on x86 PC-architecture systems. 52a1dadd10SMike Smith.Bl -tag -width 20n 53a1dadd10SMike Smith.It Fn bios_sigsearch 54a1dadd10SMike SmithSearches the BIOS address space for a service signature, usually an 55a1dadd10SMike Smithuppercase ASCII sequence surrounded by underscores. The search begins 56a1dadd10SMike Smithat 57a1dadd10SMike Smith.Fa start , 58a1dadd10SMike Smithor at the beginning of the BIOS if 59a1dadd10SMike Smith.Fa start 60a1dadd10SMike Smithis zero. 61a1dadd10SMike Smith.Fa siglen 62a1dadd10SMike Smithbytes of the BIOS image and 63a1dadd10SMike Smith.Fa sig 64a1dadd10SMike Smithare compared at 65a1dadd10SMike Smith.Fa sigofs 66a1dadd10SMike Smithbytes offset from the current location. If no match is found, the 67a1dadd10SMike Smithcurrent location is incremented by 68a1dadd10SMike Smith.Fa paralen 69a1dadd10SMike Smithbytes and the search repeated. If the signature is found, its effective 70a1dadd10SMike Smithphysical address is returned. If no signature is found, zero is returned. 71a1dadd10SMike Smith.It Fn BIOS_VADDRTOPADDR 72a1dadd10SMike SmithReturns the effective physical address which corresponds to the kernel 73a1dadd10SMike Smithvirtual address 74a1dadd10SMike Smith.Fa addr . 75a1dadd10SMike Smith.It Fn BIOS_VADDRTOPADDR 76a1dadd10SMike SmithReturns the kernel virtual address which corresponds to the effective 77a1dadd10SMike Smithphysical address 78a1dadd10SMike Smith.Fa addr . 79a1dadd10SMike Smith.It SMBIOStable 80a1dadd10SMike SmithIf not NULL, points to a 81a1dadd10SMike Smith.Ft struct SMBIOS_table 82a1dadd10SMike Smithstructure containing information read from the System Management BIOS table 83a1dadd10SMike Smithduring system startup. 84a1dadd10SMike Smith.It DMItable 85a1dadd10SMike SmithIf not NULL, points to a 86a1dadd10SMike Smith.Ft struct DMI_table 87a1dadd10SMike Smithstructure containing information read from the Desktop Management Interface 88a1dadd10SMike Smithparameter table during system startup. 89a1dadd10SMike Smith.El 90a1dadd10SMike Smith.Sh BIOS32 91a1dadd10SMike SmithAt system startup, the BIOS is scanned for the BIOS32 Service Directory 92a1dadd10SMike Smith(part of the PCI specification), and the existence of the directory is 93a1dadd10SMike Smithrecorded. This can then be used to locate other services. 94a1dadd10SMike Smith.Bl -tag -width 20n 95a1dadd10SMike Smith.It Fn bios32_SDlookup 96a1dadd10SMike SmithAttempts to locate the BIOS32 service matching the 4-byte identifier 97a1dadd10SMike Smithpassed in the 98a1dadd10SMike Smith.Fa ident 99a1dadd10SMike Smithfield of the 100a1dadd10SMike Smith.Fa ent 101a1dadd10SMike Smithargument. 102a1dadd10SMike Smith.It Fn bios32 103a1dadd10SMike SmithCalls a bios32 function. This presumes that the function is capable of 104a1dadd10SMike Smithworking within the kernel segment (normally the case). The virtual address 105a1dadd10SMike Smithof the entrypoint is supplied in 106a1dadd10SMike Smith.Fa entry 107a1dadd10SMike Smithand the register arguments to the function are supplied in 108a1dadd10SMike Smith.Fa args . 109a1dadd10SMike Smith.It PCIbios 110a1dadd10SMike SmithIf not NULL, points to a 111a1dadd10SMike Smith.Ft struct bios32_SDentry 112a1dadd10SMike Smithstructure describing the PCI BIOS entrypoint which was found during system 113a1dadd10SMike Smithstartup. 114a1dadd10SMike Smith.El 115