source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm@ 499

Last change on this file since 499 was 493, checked in by gregli@…, 12 years ago

Separated MODULE_8BIT_IDE into the basic part used by XTIDE rev 1 and rev 2 which is PIO based, and MODULE_8BIT_IDE_ADVANCED for JRIDE and XTCF support which requires memory mapping and/or DMA. This allows for creating an 8KB image with boot menu support (but no hotkeys) for the XTIDE rev 1. Cleaned up how we reset the drive translation information, ensuring it is properly set between boot attempt on a primary and secondary drive - as a result we clean it when needed, rather than trying to always keep it clean. Also fixed translation bugs in int13h.asm where I had previously missed converting some MODULE_HOTKEYS into MODULE_DRIVEXLATE.

File size: 2.3 KB
RevLine 
[392]1; Project name : XTIDE Universal BIOS
2; Description : Functions for accessings BOOTVARS.
3
4;
[491]5; XTIDE Universal BIOS and Associated Tools
[392]6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 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.
[491]12;
[392]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
[491]16; GNU General Public License for more details.
[392]17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
[491]18;
[392]19
20; Section containing code
21SECTION .text
22
23;--------------------------------------------------------------------
24; BootVars_Initialize
25; Parameters:
26; DS: RAMVARS Segment
27; ES: BDA Segment
28; Returns:
29; Nothing
30; Corrupts registers:
31; AX, CX, DX, DI
32;--------------------------------------------------------------------
33BootVars_Initialize:
[493]34%ifdef MODULE_8BIT_IDE_ADVANCED
[491]35 mov WORD [es:BOOTVARS.wNextXTCFportToScan], XTCF_BASE_PORT_DETECTION_SEED
[473]36%endif
37
[392]38 ; Clear to zero
[397]39 mov al, DRVDETECTINFO_size
[392]40 mul BYTE [cs:ROMVARS.bIdeCnt]
[397]41 mov di, BOOTVARS.clearToZeroFromThisPoint ; We must not initialize anything before this!
[392]42 add ax, BOOTVARS_size
43 sub ax, di
44 xchg cx, ax
[395]45
46%ifdef MODULE_HOTKEYS
[392]47 call Memory_ZeroESDIwithSizeInCX
48
49 ; Store default drives to boot from
[395]50 mov dl, [cs:ROMVARS.bBootDrv]
[392]51
[489]52 ; fall through to BootVars_StoreHotkeyForDriveNumberInDL
53
[395]54;--------------------------------------------------------------------
55; BootVars_StoreHotkeyForDriveNumberInDL
56; Parameters:
57; DL: Floppy or Hard Drive number
58; DS: RAMVARS Segment
59; ES: BDA Segment
60; Returns:
61; Nothing
62; Corrupts registers:
63; AX, CX, DI
64;--------------------------------------------------------------------
65BootVars_StoreHotkeyForDriveNumberInDL:
[492]66 mov WORD [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters], DEFAULT_FLOPPY_DRIVE_LETTER | (DEFAULT_HARD_DRIVE_LETTER<<8)
67 call DriveXlate_ConvertDriveNumberFromDLtoDriveLetter
[395]68 jmp HotkeyBar_StoreHotkeyToBootvarsForDriveLetterInDL
[392]69
[395]70%else
71 jmp Memory_ZeroESDIwithSizeInCX
72
73%endif ; MODULE_HOTKEYS
Note: See TracBrowser for help on using the repository browser.