xref: /freebsd/share/man/man9/bios.9 (revision f16b3c0de48d0b845357e7cca843f645bc3117e3)
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
59a1dadd10SMike Smithuppercase ASCII sequence surrounded by underscores.  The search begins
60a1dadd10SMike Smithat
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
70a1dadd10SMike Smithbytes offset from the current location.  If no match is found, the
71a1dadd10SMike Smithcurrent location is incremented by
72a1dadd10SMike Smith.Fa paralen
73a1dadd10SMike Smithbytes and the search repeated.  If the signature is found, its effective
74a1dadd10SMike Smithphysical address is returned.  If no signature is found, zero is returned.
75a1dadd10SMike Smith.It Fn BIOS_VADDRTOPADDR
76a1dadd10SMike SmithReturns the effective physical address which corresponds to the kernel
77a1dadd10SMike Smithvirtual address
78a1dadd10SMike Smith.Fa addr .
79a1dadd10SMike Smith.It Fn BIOS_VADDRTOPADDR
80a1dadd10SMike SmithReturns the kernel virtual address which corresponds to the effective
81a1dadd10SMike Smithphysical address
82a1dadd10SMike Smith.Fa addr .
83a1dadd10SMike Smith.It SMBIOStable
84a1dadd10SMike SmithIf not NULL, points to a
85a1dadd10SMike Smith.Ft struct SMBIOS_table
86a1dadd10SMike Smithstructure containing information read from the System Management BIOS table
87a1dadd10SMike Smithduring system startup.
88a1dadd10SMike Smith.It DMItable
89a1dadd10SMike SmithIf not NULL, points to a
90a1dadd10SMike Smith.Ft struct DMI_table
91a1dadd10SMike Smithstructure containing information read from the Desktop Management Interface
92a1dadd10SMike Smithparameter table during system startup.
93a1dadd10SMike Smith.El
94a1dadd10SMike Smith.Sh BIOS32
95a1dadd10SMike SmithAt system startup, the BIOS is scanned for the BIOS32 Service Directory
96a1dadd10SMike Smith(part of the PCI specification), and the existence of the directory is
97a1dadd10SMike Smithrecorded.  This can then be used to locate other services.
98a1dadd10SMike Smith.Bl -tag -width 20n
99a1dadd10SMike Smith.It Fn bios32_SDlookup
100a1dadd10SMike SmithAttempts to locate the BIOS32 service matching the 4-byte identifier
101a1dadd10SMike Smithpassed in the
102a1dadd10SMike Smith.Fa ident
103a1dadd10SMike Smithfield of the
104a1dadd10SMike Smith.Fa ent
105a1dadd10SMike Smithargument.
106a1dadd10SMike Smith.It Fn bios32
107a1dadd10SMike SmithCalls a bios32 function.  This presumes that the function is capable of
108a1dadd10SMike Smithworking within the kernel segment (normally the case).  The virtual address
109a1dadd10SMike Smithof the entrypoint is supplied in
110a1dadd10SMike Smith.Fa entry
111a1dadd10SMike Smithand the register arguments to the function are supplied in
112a1dadd10SMike Smith.Fa args .
113a1dadd10SMike Smith.It PCIbios
114a1dadd10SMike SmithIf not NULL, points to a
115a1dadd10SMike Smith.Ft struct bios32_SDentry
116a1dadd10SMike Smithstructure describing the PCI BIOS entrypoint which was found during system
117a1dadd10SMike Smithstartup.
118a1dadd10SMike Smith.El
119