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 /* Call the real mode function */
108 mov bx, FNID_PnpBiosGetDeviceNodeCount
112 mov ax, [BSS_PnpNodeSize]
114 mov ax, [BSS_PnpNodeCount]
117 mov eax, dword ptr [BSS_PnpResult]
124 * U32 PnpBiosGetDeviceNode(U8 *NodeId<rcx>, U8 *NodeBuffer<rdx>);
128 PUBLIC PnpBiosGetDeviceNode
129 PnpBiosGetDeviceNode:
131 /* get current node number */
133 mov byte ptr [BSS_PnpNodeNumber], al
135 /* convert pointer to node buffer to segment/offset */
138 mov word ptr [BSS_PnpBiosBufferSegment], ax
141 mov word ptr [BSS_PnpBiosBufferOffset], ax
143 /* Call the real mode function */
144 mov bx, FNID_PnpBiosGetDeviceNode
147 /* update node number */
148 mov al, byte ptr [BSS_PnpNodeNumber]
151 mov eax, [BSS_PnpResult]