[57] | 1 | ; Project name : XTIDE Univeral BIOS Configurator v2
|
---|
[153] | 2 | ; Description : Program start and exit.
|
---|
[57] | 3 |
|
---|
[376] | 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 |
|
---|
[57] | 20 | ; Include .inc files
|
---|
[280] | 21 |
|
---|
[57] | 22 | %define INCLUDE_MENU_DIALOGS
|
---|
[280] | 23 | %define INCLUDE_SERIAL_LIBRARY
|
---|
| 24 |
|
---|
[57] | 25 | %include "AssemblyLibrary.inc" ; Assembly Library. Must be included first!
|
---|
| 26 | %include "Romvars.inc" ; XTIDE Universal BIOS variables
|
---|
| 27 |
|
---|
| 28 | %include "MenuCfg.inc"
|
---|
| 29 | %include "MenuStructs.inc"
|
---|
| 30 | %include "Variables.inc"
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | ; Section containing code
|
---|
| 34 | SECTION .text
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | ; Program first instruction.
|
---|
| 38 | ORG 100h ; Code starts at offset 100h (DOS .COM)
|
---|
| 39 | Start:
|
---|
| 40 | jmp Main_Start
|
---|
| 41 |
|
---|
| 42 | ; Include library sources
|
---|
| 43 | %include "AssemblyLibrary.asm"
|
---|
| 44 |
|
---|
| 45 | ; Include sources for this program
|
---|
| 46 | %include "BiosFile.asm"
|
---|
| 47 | %include "Buffers.asm"
|
---|
| 48 | %include "Dialogs.asm"
|
---|
| 49 | %include "EEPROM.asm"
|
---|
[65] | 50 | %include "Flash.asm"
|
---|
[57] | 51 | %include "MenuEvents.asm"
|
---|
| 52 | %include "Menuitem.asm"
|
---|
| 53 | %include "MenuitemPrint.asm"
|
---|
| 54 | %include "Menupage.asm"
|
---|
| 55 | %include "Strings.asm"
|
---|
| 56 |
|
---|
[59] | 57 | %include "BootMenuSettingsMenu.asm"
|
---|
[57] | 58 | %include "ConfigurationMenu.asm"
|
---|
[59] | 59 | %include "FlashMenu.asm"
|
---|
[57] | 60 | %include "IdeControllerMenu.asm"
|
---|
| 61 | %include "MainMenu.asm"
|
---|
| 62 | %include "MasterSlaveMenu.asm"
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 |
|
---|
| 66 | ;--------------------------------------------------------------------
|
---|
| 67 | ; Program start
|
---|
| 68 | ;--------------------------------------------------------------------
|
---|
| 69 | ALIGN JUMP_ALIGN
|
---|
| 70 | Main_Start:
|
---|
[68] | 71 | mov ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE
|
---|
| 72 | call InitializeScreenWithBackgroudCharAndAttrInAX
|
---|
[57] | 73 |
|
---|
| 74 | call Main_InitializeCfgVars
|
---|
| 75 | call MenuEvents_DisplayMenu
|
---|
[68] | 76 | mov ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE
|
---|
| 77 | call InitializeScreenWithBackgroudCharAndAttrInAX
|
---|
[57] | 78 |
|
---|
| 79 | ; Exit to DOS
|
---|
| 80 | mov ax, 4C00h ; Exit to DOS
|
---|
| 81 | int 21h
|
---|
| 82 |
|
---|
| 83 |
|
---|
| 84 | ;--------------------------------------------------------------------
|
---|
[68] | 85 | ; InitializeScreenWithBackgroudCharAndAttrInAX
|
---|
| 86 | ; Parameters:
|
---|
| 87 | ; AL: Background character
|
---|
| 88 | ; AH: Background attribute
|
---|
| 89 | ; Returns:
|
---|
| 90 | ; Nothing
|
---|
| 91 | ; Corrupts registers:
|
---|
| 92 | ; AX, DX, DI
|
---|
| 93 | ;--------------------------------------------------------------------
|
---|
| 94 | ALIGN JUMP_ALIGN
|
---|
| 95 | InitializeScreenWithBackgroudCharAndAttrInAX:
|
---|
| 96 | xchg dx, ax
|
---|
| 97 | CALL_DISPLAY_LIBRARY InitializeDisplayContext ; Reset cursor etc
|
---|
| 98 | xchg ax, dx
|
---|
| 99 | CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH
|
---|
| 100 | ret
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 | ;--------------------------------------------------------------------
|
---|
[57] | 104 | ; Main_InitializeCfgVars
|
---|
| 105 | ; Parameters:
|
---|
| 106 | ; DS: Segment to CFGVARS
|
---|
| 107 | ; Returns:
|
---|
| 108 | ; Nothing
|
---|
| 109 | ; Corrupts registers:
|
---|
| 110 | ; AX, BX, CX, DI
|
---|
| 111 | ;--------------------------------------------------------------------
|
---|
| 112 | ALIGN JUMP_ALIGN
|
---|
| 113 | Main_InitializeCfgVars:
|
---|
| 114 | push es
|
---|
| 115 |
|
---|
| 116 | call Buffers_Clear
|
---|
| 117 | call EEPROM_FindXtideUniversalBiosROMtoESDI
|
---|
| 118 | jnc SHORT .InitializationCompleted
|
---|
| 119 | mov [CFGVARS.wEepromSegment], es
|
---|
| 120 | .InitializationCompleted:
|
---|
| 121 | pop es
|
---|
| 122 | ret
|
---|
| 123 |
|
---|
| 124 |
|
---|
| 125 | ; Section containing initialized data
|
---|
| 126 | SECTION .data
|
---|
| 127 |
|
---|
| 128 | ALIGN WORD_ALIGN
|
---|
| 129 | g_cfgVars:
|
---|
| 130 | istruc CFGVARS
|
---|
[59] | 131 | at CFGVARS.pMenupage, dw g_MenupageForMainMenu
|
---|
| 132 | at CFGVARS.wFlags, dw DEFAULT_CFGVARS_FLAGS
|
---|
[371] | 133 | at CFGVARS.wEepromSegment, dw 0
|
---|
[63] | 134 | at CFGVARS.bEepromType, db DEFAULT_EEPROM_TYPE
|
---|
[65] | 135 | at CFGVARS.bEepromPage, db DEFAULT_PAGE_SIZE
|
---|
[59] | 136 | at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND
|
---|
[57] | 137 | iend
|
---|
| 138 |
|
---|
| 139 |
|
---|
| 140 | ; Section containing uninitialized data
|
---|
| 141 | SECTION .bss
|
---|