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