3 * Copyright (C) 2003 Eric Kohl
4 * Copyright (C) 2011 Timo Kreuzer
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include <arch/pc/x86common.h>
24 EXTERN CallRealMode:PROC
29 * U32 PnpBiosSupported(VOID);
33 PUBLIC PnpBiosSupported
48 cmp eax, HEX(506E5024) /* "$PnP" */
59 /* first calculate the checksum */
77 /* Calculate the bios entry point (far pointer) */
79 mov ax, [rsi + HEX(0F)]
81 mov ax, [rsi + HEX(0D)]
82 mov dword ptr [BSS_PnpBiosEntryPoint], eax
84 /* Store bios data segment */
85 mov ax, [rsi + HEX(1B)]
86 mov word ptr [BSS_PnpBiosDataSegment], ax
100 * U32 PnpBiosGetDeviceNodeCount(U32 *NodeSize<rcx>, U32 *NodeCount<rdx>);
104 PUBLIC PnpBiosGetDeviceNodeCount
105 PnpBiosGetDeviceNodeCount:
107 /* Save param-regs */
111 /* Call the real mode function */
112 mov bx, FNID_PnpBiosGetDeviceNodeCount
115 /* Restore param-regs */
120 mov ax, [BSS_PnpNodeSize]
122 mov ax, [BSS_PnpNodeCount]
125 mov eax, dword ptr [BSS_PnpResult]
132 * U32 PnpBiosGetDeviceNode(U8 *NodeId<rcx>, U8 *NodeBuffer<rdx>);
136 PUBLIC PnpBiosGetDeviceNode
137 PnpBiosGetDeviceNode:
139 /* get current node number */
141 mov byte ptr [BSS_PnpNodeNumber], al
143 /* convert pointer to node buffer to segment/offset */
146 mov word ptr [BSS_PnpBiosBufferSegment], ax
149 mov word ptr [BSS_PnpBiosBufferOffset], ax
154 /* Call the real mode function */
155 mov bx, FNID_PnpBiosGetDeviceNode
161 /* update node number */
162 mov al, byte ptr [BSS_PnpNodeNumber]
165 mov eax, [BSS_PnpResult]