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