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 293d45e180SRuslan Ermilov.Os 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 36f16b3c0dSChad David.In sys/param.h 37f16b3c0dSChad David.In vm/vm.h 38f16b3c0dSChad David.In vm/pmap.h 39f16b3c0dSChad David.In machine/param.h 40f16b3c0dSChad David.In machine/pmap.h 4132eef9aeSRuslan Ermilov.In machine/pc/bios.h 42a1dadd10SMike Smith.Ft u_int32_t 43a1dadd10SMike Smith.Fn bios_sigsearch "u_int32_t start" "u_char *sig" "int siglen" "int paralen" "int sigofs" 44a1dadd10SMike Smith.Ft int 45a1dadd10SMike Smith.Fn bios32_SDlookup "struct bios32_SDentry *ent" 46f16b3c0dSChad David.Ft int 47f16b3c0dSChad David.Fn bios32 "struct bios_regs *br" "u_int offset" "u_short segment" 48a1dadd10SMike Smith.Fn BIOS_PADDRTOVADDR "addr" 49a1dadd10SMike Smith.Fn BIOS_VADDRTOPADDR "addr" 50b77b3c00SRuslan Ermilov.Vt extern struct bios32_SDentry PCIbios ; 51b77b3c00SRuslan Ermilov.Vt extern struct SMBIOS_table SMBIOStable ; 52b77b3c00SRuslan Ermilov.Vt extern struct DMI_table DMItable ; 53a1dadd10SMike Smith.Sh DESCRIPTION 54a1dadd10SMike SmithThese functions provide a general-purpose interface for dealing with 55a1dadd10SMike Smiththe BIOS functions and data encountered on x86 PC-architecture systems. 56a1dadd10SMike Smith.Bl -tag -width 20n 57a1dadd10SMike Smith.It Fn bios_sigsearch 58a1dadd10SMike SmithSearches the BIOS address space for a service signature, usually an 59ce91e62bSHiten Pandyauppercase ASCII sequence surrounded by underscores. 60ce91e62bSHiten PandyaThe search begins at 61a1dadd10SMike Smith.Fa start , 62a1dadd10SMike Smithor at the beginning of the BIOS if 63a1dadd10SMike Smith.Fa start 64a1dadd10SMike Smithis zero. 65a1dadd10SMike Smith.Fa siglen 66a1dadd10SMike Smithbytes of the BIOS image and 67a1dadd10SMike Smith.Fa sig 68a1dadd10SMike Smithare compared at 69a1dadd10SMike Smith.Fa sigofs 70ce91e62bSHiten Pandyabytes offset from the current location. 71ce91e62bSHiten PandyaIf no match is found, the 72a1dadd10SMike Smithcurrent location is incremented by 73a1dadd10SMike Smith.Fa paralen 74ce91e62bSHiten Pandyabytes and the search repeated. 75ce91e62bSHiten PandyaIf the signature is found, its effective 76ce91e62bSHiten Pandyaphysical address is returned. 77ce91e62bSHiten PandyaIf no signature is found, zero is returned. 78a1dadd10SMike Smith.It Fn BIOS_VADDRTOPADDR 79a1dadd10SMike SmithReturns the effective physical address which corresponds to the kernel 80a1dadd10SMike Smithvirtual address 81a1dadd10SMike Smith.Fa addr . 82a1dadd10SMike Smith.It Fn BIOS_VADDRTOPADDR 83a1dadd10SMike SmithReturns the kernel virtual address which corresponds to the effective 84a1dadd10SMike Smithphysical address 85a1dadd10SMike Smith.Fa addr . 86a1dadd10SMike Smith.It SMBIOStable 87a1dadd10SMike SmithIf not NULL, points to a 88a1dadd10SMike Smith.Ft struct SMBIOS_table 89a1dadd10SMike Smithstructure containing information read from the System Management BIOS table 90a1dadd10SMike Smithduring system startup. 91a1dadd10SMike Smith.It DMItable 92a1dadd10SMike SmithIf not NULL, points to a 93a1dadd10SMike Smith.Ft struct DMI_table 94a1dadd10SMike Smithstructure containing information read from the Desktop Management Interface 95a1dadd10SMike Smithparameter table during system startup. 96a1dadd10SMike Smith.El 97a1dadd10SMike Smith.Sh BIOS32 98a1dadd10SMike SmithAt system startup, the BIOS is scanned for the BIOS32 Service Directory 99a1dadd10SMike Smith(part of the PCI specification), and the existence of the directory is 100ce91e62bSHiten Pandyarecorded. 101ce91e62bSHiten PandyaThis can then be used to locate other services. 102a1dadd10SMike Smith.Bl -tag -width 20n 103a1dadd10SMike Smith.It Fn bios32_SDlookup 104a1dadd10SMike SmithAttempts to locate the BIOS32 service matching the 4-byte identifier 105a1dadd10SMike Smithpassed in the 106a1dadd10SMike Smith.Fa ident 107a1dadd10SMike Smithfield of the 108a1dadd10SMike Smith.Fa ent 109a1dadd10SMike Smithargument. 110a1dadd10SMike Smith.It Fn bios32 111ce91e62bSHiten PandyaCalls a bios32 function. 112ce91e62bSHiten PandyaThis presumes that the function is capable of 113ce91e62bSHiten Pandyaworking within the kernel segment (normally the case). 114ce91e62bSHiten PandyaThe virtual address 115a1dadd10SMike Smithof the entrypoint is supplied in 116a1dadd10SMike Smith.Fa entry 117a1dadd10SMike Smithand the register arguments to the function are supplied in 118a1dadd10SMike Smith.Fa args . 119a1dadd10SMike Smith.It PCIbios 120a1dadd10SMike SmithIf not NULL, points to a 121a1dadd10SMike Smith.Ft struct bios32_SDentry 122a1dadd10SMike Smithstructure describing the PCI BIOS entrypoint which was found during system 123a1dadd10SMike Smithstartup. 124a1dadd10SMike Smith.El 125