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