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-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.
|
---|
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
|
---|
21 | SECTION .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 | ;--------------------------------------------------------------------
|
---|
33 | BootVars_Initialize:
|
---|
34 | %ifdef MODULE_8BIT_IDE_ADVANCED
|
---|
35 | mov WORD [es:BOOTVARS.wNextXTCFportToScan], XTCF_BASE_PORT_DETECTION_SEED
|
---|
36 | %endif
|
---|
37 |
|
---|
38 | ; Clear to zero
|
---|
39 | mov al, DRVDETECTINFO_size
|
---|
40 | mul BYTE [cs:ROMVARS.bIdeCnt]
|
---|
41 | %ifdef MODULE_HOTKEYS ; We must not initialize anything before this!
|
---|
42 | mov di, BOOTVARS.hotkeyVars + HOTKEYVARS.clearToZeroFromThisPoint
|
---|
43 | %else
|
---|
44 | mov di, BOOTVARS.clearToZeroFromThisPoint
|
---|
45 | %endif
|
---|
46 | add ax, BOOTVARS_size
|
---|
47 | sub ax, di
|
---|
48 | xchg cx, ax
|
---|
49 |
|
---|
50 | %ifdef MODULE_HOTKEYS
|
---|
51 | call Memory_ZeroESDIwithSizeInCX
|
---|
52 |
|
---|
53 | ; Store default drives to boot from
|
---|
54 | mov dl, [cs:ROMVARS.bBootDrv]
|
---|
55 |
|
---|
56 | ; fall through to BootVars_StoreHotkeyForDriveNumberInDL
|
---|
57 |
|
---|
58 | ;--------------------------------------------------------------------
|
---|
59 | ; BootVars_StoreHotkeyForDriveNumberInDL
|
---|
60 | ; Parameters:
|
---|
61 | ; DL: Floppy or Hard Drive number
|
---|
62 | ; DS: RAMVARS Segment
|
---|
63 | ; ES: BDA Segment
|
---|
64 | ; Returns:
|
---|
65 | ; Nothing
|
---|
66 | ; Corrupts registers:
|
---|
67 | ; AX, CX, DI
|
---|
68 | ;--------------------------------------------------------------------
|
---|
69 | BootVars_StoreHotkeyForDriveNumberInDL:
|
---|
70 | mov WORD [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wFddAndHddLetters], DEFAULT_FLOPPY_DRIVE_LETTER | (DEFAULT_HARD_DRIVE_LETTER<<8)
|
---|
71 | call DriveXlate_ConvertDriveNumberFromDLtoDriveLetter
|
---|
72 | jmp HotkeyBar_StoreHotkeyToBootvarsForDriveLetterInDL
|
---|
73 |
|
---|
74 | %else
|
---|
75 | jmp Memory_ZeroESDIwithSizeInCX
|
---|
76 |
|
---|
77 | %endif ; MODULE_HOTKEYS
|
---|