; Project name : XTIDE Universal BIOS Configurator v2 ; Description : Functions to automatically configure XTIDE ; Universal BIOS for current system. ; ; XTIDE Universal BIOS and Associated Tools ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html ; ; Section containing code SECTION .text ;-------------------------------------------------------------------- ; AutoConfigure_ForThisSystem ; MENUITEM activation function (.fnActivate) ; Parameters: ; SS:BP: Ptr to MENU ; Returns: ; Nothing ; Corrupts registers: ; All, except segments ;-------------------------------------------------------------------- ALIGN JUMP_ALIGN AutoConfigure_ForThisSystem: push es push ds call Buffers_GetFileBufferToESDI ; ROMVARS now in ES:DI push es pop ds ; ROMVARS now in DS:DI call ResetIdevarsToDefaultValues call DetectIdePortsAndDevices call StoreAndDisplayNumberOfControllers pop ds pop es ret ;-------------------------------------------------------------------- ; ResetIdevarsToDefaultValues ; Parameters: ; DS:DI: Ptr to ROMVARS ; Returns: ; Nothing ; Corrupts registers: ; AX, CX ;-------------------------------------------------------------------- ALIGN JUMP_ALIGN ResetIdevarsToDefaultValues: push di add di, BYTE ROMVARS.ideVarsBegin mov cx, ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin call Memory_ZeroESDIwithSizeInCX ; Never clears ROMVARS.ideVarsSerialAuto pop di ; Set default values (other than zero) mov ax, DISABLE_WRITE_CACHE | (TRANSLATEMODE_AUTO<