1 .\" $NetBSD: bioscall.9,v 1.7 2003/04/16 13:35:36 wiz Exp $
3 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd call system BIOS function from real mode
39 .Fn bioscall "int function" "struct bioscallregs *regs"
43 function switches the processor into real mode, calls the BIOS interrupt
46 and returns to protected mode.
48 This function is intended to be called during the initial system
49 bootstrap when necessary to probe devices or pseudo-devices.
51 The register values specified by
53 (with one exception) are installed before the BIOS interrupt is called.
54 The processor flags are handled specially. Only the following flags are
56 BIOS from the registers in
58 (the remainder come from the processor's flags register at the time
70 structure is defined to contain structures for each register, to allow
71 access to 32-, 16- or 8-bit wide sections of the registers.
72 Definitions are provided which simplify access to the union members.
77 with the processor registers as returned from the BIOS call.
79 The Advanced Power Management driver calls
81 by setting up a register structure with the APM installation check and
82 device types in registers
86 then calls the BIOS to fetch the details for calling the APM support
87 through a protected-mode interface. The BIOS returns these details in
91 #include \*[Lt]i386/bioscall.h\*[Gt]
92 #include \*[Lt]i386/apmvar.h\*[Gt]
93 struct bioscallregs regs;
95 regs.AX = APM_BIOS_FN(APM_INSTALLATION_CHECK);
96 regs.BX = APM_DEV_APM_BIOS;
97 regs.CX = regs.DX = 0;
98 regs.ESI = regs.EDI = regs.EFLAGS = 0;
99 bioscall(APM_SYSTEM_BIOS, \*[Am]regs);
102 .Pa sys/arch/i386/i386/bioscall.s ,
103 .Pa sys/arch/i386/bioscall/biostramp.S
111 Not all BIOS functions are safe to call through the trampoline, as they
112 may depend on system state which has been disturbed or used for other