3 * Copyright (C) 1998-2002 Brian Palmer <brianp@sginet.com>
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.
22 #include <arch/pc/x86common.h>
26 PUBLIC _DriveMapInt13HandlerStart
27 _DriveMapInt13HandlerStart:
38 /* Get callers flags from stack */
40 mov word ptr cs:[CallersFlags - Int13Handler], ax
42 /* Save the drive number they passed in */
43 mov cs:[PassedInDriveNumber - Int13Handler], dl
45 /* Now we need to perform the mapping */
47 mov si, offset Int13HandlerMapCount - Int13Handler
49 /* Get the count of drives in the map list */
53 /* If the map list is empty then just call the old int 13h handler */
55 jz CallOldInt13Handler
57 GetMappedDriveNumberLoop:
59 /* Get the next drive number in the list */
62 /* Check to see if it's the one they are calling int 13h for */
65 /* If not get the next one */
66 jne GetMappedDriveNumberLoopNext
68 /* If we get here then we have found a mapped drive */
69 /* Send new drive number on to the old int 13h handler */
72 /* Call BIOS Int 13 Handler */
73 jmp CallOldInt13Handler
75 GetMappedDriveNumberLoopNext:
76 loop GetMappedDriveNumberLoop
79 /* Restore the registers we changed off the stack */
84 /* Put flags onto stack */
85 push word ptr cs:[CallersFlags - Int13Handler]
88 /* Call old int 13h handler with new drive number */
89 .byte HEX(9a) /* lcall */
90 PUBLIC _DriveMapOldInt13HandlerAddress
91 _DriveMapOldInt13HandlerAddress:
95 /* Update the callers flags with the values the BIOS returned */
102 /* Restore the callers drive number */
103 mov dl, cs:[PassedInDriveNumber - Int13Handler]
115 PUBLIC _DriveMapInt13HandlerMapList
116 _DriveMapInt13HandlerMapList:
117 Int13HandlerMapCount:
122 Int13HandlerDriveNew1:
127 Int13HandlerDriveNew2:
132 Int13HandlerDriveNew3:
137 Int13HandlerDriveNew4:
140 PUBLIC _DriveMapInt13HandlerEnd
141 _DriveMapInt13HandlerEnd: