source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm@ 589

Last change on this file since 589 was 567, checked in by krille_n_@…, 11 years ago

Changes:

  • Renamed MODULE_FEATURE_SETS to MODULE_POWER_MANAGEMENT.
  • Renamed MODULE_VERY_LATE_INITIALIZATION to MODULE_VERY_LATE_INIT and removed it from the official builds.
  • Removed the code that skips detection of slave drives on XT-CF controllers since slave drives can be used with Lo-tech ISA CompactFlash boards.
  • Added autodetection of the SVC ADP50L controller to XTIDECFG.
  • The autodetection of XT-CF controllers now requires MODULE_8BIT_IDE_ADVANCED in the loaded BIOS.
  • Fixed a bug in XTIDECFG from r502 where the "Base (cmd block) address" menu option would be displayed when a serial device was selected as the IDE controller.
  • XTIDECFG would display the "Enable interrupt" menu option for the XTIDE r1 but not for the XTIDE r2. It's now displayed for both controller types.
  • Disabled the "Internal Write Cache" menu option in the Master/Slave Drive menus for serial device type drives.
  • Optimizations and other fixes.
File size: 3.1 KB
Line 
1; Project name : XTIDE Universal BIOS
2; Description : Int 13h function AH=41h, Check if Extensions Present.
3
4;
5; XTIDE Universal BIOS and Associated Tools
6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
7;
8; This program is free software; you can redistribute it and/or modify
9; it under the terms of the GNU General Public License as published by
10; the Free Software Foundation; either version 2 of the License, or
11; (at your option) any later version.
12;
13; This program is distributed in the hope that it will be useful,
14; but WITHOUT ANY WARRANTY; without even the implied warranty of
15; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16; GNU General Public License for more details.
17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18;
19
20; Section containing code
21SECTION .text
22
23;--------------------------------------------------------------------
24; Int 13h function AH=41h, Check if Extensions Present.
25;
26; AH41h_HandlerForCheckIfExtensionsPresent
27; Parameters:
28; DL: Translated Drive number
29; DS:DI: Ptr to DPT (in RAMVARS segment)
30; SS:BP: Ptr to IDEPACK
31; Parameters on INTPACK:
32; BX: 55AAh
33; Returns with INTPACK:
34; AH: Major version of EBIOS extensions
35; BX: AA55h
36; CX: Support bits
37; CF: 0 if successful, 1 if error
38;--------------------------------------------------------------------
39AH41h_HandlerForCheckIfExtensionsPresent:
40 cmp WORD [bp+IDEPACK.intpack+INTPACK.bx], 55AAh
41%ifdef USE_386
42 jne Int13h_DirectCallToAnotherBios
43%else
44 jne SHORT .EbiosNotSupported
45%endif
46
47 mov BYTE [bp+IDEPACK.intpack+INTPACK.ah], EBIOS_VERSION
48 mov WORD [bp+IDEPACK.intpack+INTPACK.bx], 0AA55h
49
50%ifdef MODULE_COMPATIBLE_TABLES
51 call AH41h_GetSupportBitsToCX
52 mov [bp+IDEPACK.intpack+INTPACK.cx], cx
53%else
54 mov WORD [bp+IDEPACK.intpack+INTPACK.cx], ENHANCED_DRIVE_ACCESS_SUPPORT
55%endif ; MODULE_COMPATIBLE_TABLES
56
57 and BYTE [bp+IDEPACK.intpack+INTPACK.flags], ~FLG_FLAGS_CF ; Return with CF cleared
58 jmp Int13h_ReturnFromHandlerWithoutStoringErrorCode
59
60%ifndef USE_386
61.EbiosNotSupported:
62 jmp Int13h_DirectCallToAnotherBios
63%endif
64
65
66%ifdef MODULE_COMPATIBLE_TABLES
67;--------------------------------------------------------------------
68; AH41h_GetSupportBitsToCX
69; Parameters:
70; DS:DI: Ptr to DPT (in RAMVARS segment)
71; Returns:
72; CX: Support bits returned by AH=41h
73; Corrupts registers:
74; Nothing
75;--------------------------------------------------------------------
76AH41h_GetSupportBitsToCX:
77 mov cx, ENHANCED_DRIVE_ACCESS_SUPPORT
78
79 ; DPTE needs buffer from RAM so do not return it in lite mode
80%ifndef USE_AT
81 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
82 jz SHORT .DoNotSetEDDflag
83%endif
84
85%ifdef MODULE_8BIT_IDE OR MODULE_SERIAL
86 ; DPTE contains information for device drivers. We should not return
87 ; DPTE for 8-bit devices since software would think they are 16-bit devices.
88 cmp BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_ATA
89 jae SHORT .DoNotSetEDDflag
90%endif
91
92 or cl, ENHANCED_DISK_DRIVE_SUPPORT ; AH=48h returns DPTE
93.DoNotSetEDDflag:
94 ret
95
96%endif ; MODULE_COMPATIBLE_TABLES
Note: See TracBrowser for help on using the repository browser.