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