3 * Copyright (C) 2003 Eric Kohl
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <arch/pc/x86common.h>
23 EXTERN i386CallRealMode:PROC
28 * U32 PnpBiosSupported(VOID);
32 PUBLIC _PnpBiosSupported
47 cmp eax, HEX(506E5024) /* "$PnP" */
58 /* first calculate the checksum */
76 /* Calculate the bios entry point (far pointer) */
78 mov ax, [esi + HEX(0F)]
80 mov ax, [esi + HEX(0D)]
81 mov dword ptr ds:[BSS_PnpBiosEntryPoint], eax
83 /* Store bios data segment */
84 mov ax, [esi + HEX(1B)]
85 mov word ptr ds:[BSS_PnpBiosDataSegment], ax
99 * U32 PnpBiosGetDeviceNodeCount(U32 *NodeSize, U32 *NodeCount);
103 PUBLIC _PnpBiosGetDeviceNodeCount
104 _PnpBiosGetDeviceNodeCount:
112 mov bx, FNID_PnpBiosGetDeviceNodeCount
113 call i386CallRealMode
116 mov ax, [BSS_PnpNodeSize]
121 mov ax, [BSS_PnpNodeCount]
131 mov eax, dword ptr [BSS_PnpResult]
137 * U32 PnpBiosGetDeviceNode(U8 *NodeId, U8 *NodeBuffer);
141 PUBLIC _PnpBiosGetDeviceNode
142 _PnpBiosGetDeviceNode:
150 /* get current node number */
153 mov byte ptr ds:[BSS_PnpNodeNumber], al
155 /* convert pointer to node buffer to segment/offset */
159 mov word ptr ds:[BSS_PnpBiosBufferSegment], ax
162 mov word ptr ds:[BSS_PnpBiosBufferOffset], ax
164 mov bx, FNID_PnpBiosGetDeviceNode
165 call i386CallRealMode
167 /* update node number */
169 mov al, byte ptr ds:[BSS_PnpNodeNumber]
178 mov eax, [BSS_PnpResult]