; Project name : XTIDE Universal BIOS ; Authors : Tomi Tilli ; : aitotat@gmail.com ; : ; : Greg Lindhorst ; : gregli@hotmail.com ; ; ; : Krister Nordvall ; : krille_n_@hotmail.com ; : ; Description : Main file for BIOS. This is the only file that needs ; to be compiled since other files are included to this ; file (so no linker needed, Nasm does it all). ; ; XTIDE Universal BIOS and Associated Tools ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 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 ; ORG 0 ; Code start offset 0000h ; We must define included libraries before including "AssemblyLibrary.inc". %define EXCLUDE_FROM_XUB ; Exclude unused library functions %ifdef MODULE_BOOT_MENU %define MENUEVENT_INLINE_OFFSETS ; Only one menu required, save space and inline offsets %define INCLUDE_MENU_LIBRARY %define MENU_NO_ESC ; User cannot 'esc' out of the menu %else ; If no boot menu included %define INCLUDE_DISPLAY_LIBRARY %define INCLUDE_KEYBOARD_LIBRARY %define INCLUDE_TIME_LIBRARY %endif ; Included .inc files %include "AssemblyLibrary.inc" ; Assembly Library. Must be included first! %include "ModuleDependency.inc" ; Dependency checks for optional modules. Must be included second! %include "Version.inc" %include "ATA_ID.inc" ; For ATA Drive Information structs %include "IdeRegisters.inc" ; For ATA Registers, flags and commands %include "Int13h.inc" ; Equates for INT 13h functions %include "CustomDPT.inc" ; For Disk Parameter Table %include "RomVars.inc" ; For ROMVARS and IDEVARS structs %include "RamVars.inc" ; For RAMVARS struct %include "BootVars.inc" ; For BOOTVARS struct %include "IdeIO.inc" ; Macros for IDE port I/O %include "DeviceIDE.inc" ; For IDE device equates ; Section containing code SECTION .text ; ROM variables (must start at offset 0) CNT_ROM_BLOCKS EQU BIOS_SIZE / 512 ; number of 512B blocks, 16 = 8kB BIOS istruc ROMVARS at ROMVARS.wRomSign, dw 0AA55h ; PC ROM signature at ROMVARS.bRomSize, db CNT_ROM_BLOCKS ; ROM size in 512B blocks at ROMVARS.rgbJump, jmp Initialize_FromMainBiosRomSearch at ROMVARS.rgbSign, db FLASH_SIGNATURE at ROMVARS.szTitle, db TITLE_STRING at ROMVARS.szVersion, db "r" db ROM_VERSION_STRING db BUILD_DATE_STRING,NULL %ifdef MODULE_BOOT_MENU at ROMVARS.pColorTheme, dw ColorTheme ; Offset to the ATTRIBUTE_CHARS struc that holds the color theme %endif ;---------------------------; ; AT Build default settings ; ;---------------------------; %ifdef USE_AT %ifdef USE_386 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | FLG_ROMVARS_CLEAR_BDA_HD_COUNT | MASK_ROMVARS_INCLUDED_MODULES %else at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | MASK_ROMVARS_INCLUDED_MODULES %endif at ROMVARS.wRamVars, dw NULL ; Use 'stolen' top of conventional memory by default in Full mode at ROMVARS.wDisplayMode, dw DEFAULT_TEXT_MODE %ifdef MODULE_BOOT_MENU at ROMVARS.wBootTimeout, dw BOOT_MENU_DEFAULT_TIMEOUT %endif %ifdef USE_PS2 at ROMVARS.bIdeCnt, db 4 ; Number of supported controllers with two McIDE adapters %else at ROMVARS.bIdeCnt, db 2 ; Number of supported controllers %endif at ROMVARS.bBootDrv, db 80h ; Boot Menu default drive at ROMVARS.bMinFddCnt, db 0 ; Do not force minimum number of floppy drives at ROMVARS.bStealSize, db 1 ; Steal 1kB from base memory at ROMVARS.bIdleTimeout, db 0 ; Standby timer disabled by default at ROMVARS.ideVars0+IDEVARS.wBasePort, dw DEVICE_ATA_PRIMARY_PORT ; Controller Command Block base port at ROMVARS.ideVars0+IDEVARS.wControlBlockPort, dw DEVICE_ATA_PRIMARY_PORTCTRL ; Controller Control Block base port at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_16BIT_ATA %ifdef MODULE_IRQ %ifdef USE_PS2 at ROMVARS.ideVars0+IDEVARS.bIRQ, db 0 %else at ROMVARS.ideVars0+IDEVARS.bIRQ, db 14 %endif %endif at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO< BIOS_SIZE - 3 %warning "This build is too large to be auto-checksummed!" %endif %endif %elif ($-$$) = BIOS_SIZE ; A large or tiny build. %warning "This build is too large to be auto-checksummed!" %endif %endif