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

Last change on this file since 563 was 547, checked in by aitotat@…, 12 years ago

Changes to XTIDE Universal BIOS:

  • Hotkeys were incorrectly initialized to use 'C' as first hard drive letter.
  • All CHS translate modes should again work (incorrectly decremented DX instead of DL, it might or might not have caused problems).
File size: 2.9 KB
Line 
1; Project name : XTIDE Universal BIOS
2; Description : Functions for accessings BOOTVARS.
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; 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:
34 ; Clear all DRVDETECTINFO structs to zero
35 mov al, DRVDETECTINFO_size
36 mul BYTE [cs:ROMVARS.bIdeCnt]
37 mov di, BOOTVARS.rgDrvDetectInfo ; We must not initialize anything before this!
38 xchg cx, ax
39%ifndef MODULE_HOTKEYS
40 jmp Memory_ZeroESDIwithSizeInCX
41
42%else ; if MODULE_HOTKEYS
43 call Memory_ZeroESDIwithSizeInCX
44
45 ; Initialize HOTKEYVARS by storing default drives to boot from
46 call BootVars_StoreDefaultDriveLettersToHotkeyVars
47 mov dl, [cs:ROMVARS.bBootDrv]
48 jmp HotkeyBar_StoreHotkeyToBootvarsForDriveNumberInDL
49
50
51;--------------------------------------------------------------------
52; BootVars_StoreDefaultDriveLettersToHotkeyVars
53; Parameters:
54; ES: BDA Segment
55; Returns:
56; Nothing
57; Corrupts registers:
58; Nothing
59;--------------------------------------------------------------------
60BootVars_StoreDefaultDriveLettersToHotkeyVars:
61 call BootVars_GetLetterForFirstHardDriveToAX
62 mov ah, DEFAULT_FLOPPY_DRIVE_LETTER
63 xchg al, ah
64 mov [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wFddAndHddLetters], ax
65 ret
66
67%endif ; MODULE_HOTKEYS
68
69
70;--------------------------------------------------------------------
71; Returns letter for first hard disk. Usually it will be 'C' but it
72; can be higher if more than two floppy drives are found.
73;
74; BootVars_GetLetterForFirstHardDriveToAX
75; Parameters:
76; DS: RAMVARS segment
77; Returns:
78; AX: Upper case letter for first hard disk
79; Corrupts registers:
80; Nothing
81;--------------------------------------------------------------------
82BootVars_GetLetterForFirstHardDriveToAX:
83 call FloppyDrive_GetCountToAX
84 add al, DEFAULT_FLOPPY_DRIVE_LETTER ; First Hard Drive letter comes after last floppy drive letter...
85 MAX_U al, DEFAULT_HARD_DRIVE_LETTER ; ...but it can never be 'A' or 'B'
86 ret
Note: See TracBrowser for help on using the repository browser.