[392] | 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:
|
---|
[473] | 34 | %ifdef MODULE_8BIT_IDE
|
---|
| 35 | mov WORD [es:BOOTVARS.wNextXTCFportToScan], XTCF_BASE_PORT_1
|
---|
| 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 |
|
---|
[395] | 52 | ;--------------------------------------------------------------------
|
---|
| 53 | ; BootVars_StoreHotkeyForDriveNumberInDL
|
---|
| 54 | ; Parameters:
|
---|
| 55 | ; DL: Floppy or Hard Drive number
|
---|
| 56 | ; DS: RAMVARS Segment
|
---|
| 57 | ; ES: BDA Segment
|
---|
| 58 | ; Returns:
|
---|
| 59 | ; Nothing
|
---|
| 60 | ; Corrupts registers:
|
---|
| 61 | ; AX, CX, DI
|
---|
| 62 | ;--------------------------------------------------------------------
|
---|
| 63 | BootVars_StoreHotkeyForDriveNumberInDL:
|
---|
| 64 | mov WORD [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wHddAndFddLetters], DEFAULT_HARD_DRIVE_LETTER | (DEFAULT_FLOPPY_DRIVE_LETTER<<8)
|
---|
| 65 | call HotkeyBar_ConvertDriveNumberFromDLtoDriveLetter
|
---|
| 66 | jmp HotkeyBar_StoreHotkeyToBootvarsForDriveLetterInDL
|
---|
[392] | 67 |
|
---|
[395] | 68 | %else
|
---|
| 69 | jmp Memory_ZeroESDIwithSizeInCX
|
---|
| 70 |
|
---|
| 71 | %endif ; MODULE_HOTKEYS
|
---|
[473] | 72 |
|
---|
| 73 |
|
---|
| 74 | %ifdef MODULE_8BIT_IDE
|
---|
| 75 | ;--------------------------------------------------------------------
|
---|
| 76 | ; BootVars_GetNextXTCFportToDetectToDX
|
---|
| 77 | ; Parameters:
|
---|
| 78 | ; ES: BDA Segment
|
---|
| 79 | ; Returns:
|
---|
| 80 | ; DX: Next XT-CF port to detect
|
---|
| 81 | ; Corrupts registers:
|
---|
| 82 | ; AX
|
---|
| 83 | ;--------------------------------------------------------------------
|
---|
| 84 | BootVars_GetNextXTCFportToDetectToDX:
|
---|
| 85 | mov dx, [es:BOOTVARS.wNextXTCFportToScan]
|
---|
| 86 | test dl, dl
|
---|
| 87 | jz SHORT .NextOneIs240hor340h
|
---|
| 88 | add WORD [es:BOOTVARS.wNextXTCFportToScan], XTCF_BASE_PORT_3 - XTCF_BASE_PORT_2
|
---|
| 89 | ret
|
---|
| 90 | .NextOneIs240hor340h:
|
---|
| 91 | mov BYTE [es:BOOTVARS.wNextXTCFportToScan], XTCF_BASE_PORT_2 & 0FFh ; 40h
|
---|
| 92 | ret
|
---|
| 93 | %endif ; MODULE_8BIT_IDE
|
---|