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 | ; Clear to zero |
---|
35 | mov al, BOOTMENUINFO_size |
---|
36 | mul BYTE [cs:ROMVARS.bIdeCnt] |
---|
37 | mov di, BOOTVARS.hotkeyVars ; We must not initialize anything before this! |
---|
38 | add ax, BOOTVARS_size |
---|
39 | sub ax, di |
---|
40 | xchg cx, ax |
---|
41 | call Memory_ZeroESDIwithSizeInCX |
---|
42 | |
---|
43 | ; Store default drives to boot from |
---|
44 | mov di, BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters |
---|
45 | call HotkeyBar_GetLetterForFirstHardDriveToAX |
---|
46 | mov ah, DEFAULT_FLOPPY_DRIVE_LETTER |
---|
47 | mov [es:di], ax |
---|
48 | |
---|
49 | ; Check if boot drive is overridden in ROMVARs |
---|
50 | mov al, [cs:ROMVARS.bBootDrv] |
---|
51 | test al, al |
---|
52 | js SHORT .StoreUserHardDiskToBootFrom |
---|
53 | inc di |
---|
54 | jmp SHORT .AddToDefaultDrive |
---|
55 | |
---|
56 | .StoreUserHardDiskToBootFrom: |
---|
57 | sub al, 80h ; Clear HD bit |
---|
58 | .AddToDefaultDrive: |
---|
59 | add [es:di], al |
---|
60 | ret |
---|