source: trunk/INCLUDE/ASM.INC@ 51

Last change on this file since 51 was 51, checked in by Ben Rietbroek, 12 years ago

AiR-BOOT v1.0.8-rc3 build-20120909 [2012-09-10]

With Git one can easily hop-skip-and-jump between branches.
So I use Git for my local repos and make use of this easy branching.
Because SVN can only handle lineair history, these branches had to be
rebased before committing them to Netlabs. So, this commit contains a
multitude of changes which makes it a bit hairy.

New

o Display LVM drive-letters in the main menu

A populair request was to show drive-letter information in the menu.
Drive-letters however, are OS specific and AiR-BOOT cannot
accurately predict what drive-letter other operating systems would
assign to what partition. eCS LVM drive-letters however are stored
in the LVM-record and can thus be displayed.

o Added 'Show LVM Drive Letters' option in SETUP/BASIC

This will toggle the display of LVM drive-letters in the main menu.
By default this option is enabled.

o Show popup message when BIOS INT13X extensions are not available

The system is halted.

o Show 'DEL to Power Off' in the bottom left corner

This tries to power-off the system, but it may not work for you.

o Simple interactive debugger

Outputs to the serial port with a few one-letter commands to dump
internal tables and state. (Only available in debug builds)

o Enhanced drive-letter feature

Enable multiple eCS installations using the same drive-letter.
This makes it possible to clone a system with the command
'XCOPY /h /o /t /s /e /r /v /e' to another drive and have that boot
from the same drive-letter.
(Or installing to the same drive by hiding the other system)

Changes

o Reduced MBR protection-image from 1024 to 768 bytes

Luckily the MBR Protection Image code does not exceed 768 bytes,
so that gives us another 256 bytes of precious code-space.
Now the non-EN versions are happy again.
Note that the alignment for the image changed from 512 to 256 bytes.
MBR-PROT.ASM, FIXCODE.C, PARTMAIN.ASM and AIR-BOOT.ASM have been
adjusted for this change.
The fight for code-space continues...

o Updating from v1.06 now also copies over drive-letters

When the user has forced drive-letters in v1.06 these will be copied
over to the v1.0.8 configuration when upgrading.
Because the drive-letter feature is broken in v1.07,
the drive-letter table does not get copied over when upgrading
from v1.07.

o Made FX-code optional to compile in

The FX-code supplies the shifting screen-effects when 'Cooper Bars'
is enabled in the setup. With the current enhancements made however,
there is a continuous lack of code-space, especially when debug-code
is included during development. The FX-code occupies some
1200 bytes, a space that can be put to better use. Therefore the
inclusion of the FX-code has been made conditional to make room for
either debugging or future new features.

o Also rewrite PBR on HPFS

Earlier, a fix was made to write a modified PBR back in case JFS was
used. This was done to enable the drive-letter feature on JFS, since
the PBR JFS-bootcode does not use the supplied PBR in memory.
With the enhancements in the drive-letter feature, the HPFS PBR
needs to be updated on disk also, to cope with zero drive-letters in
the HPFS PBR. This potentially fixes a missing drive-letter in the
PBR when the system is restored from an archive. You might need the
drive-letter feature to force the correct drive-letter on the first
boot, after which the feature can be disabled.

o Added extra MBR protection

When AiR-BOOT is active, it is only AiR-BOOT that writes to the MBR.
To protect the MBR from programming errors, like the one below,
any write to the MBR is now checked for validity.
In essence this is protecting your MBR from bad programming done
by me...

Fixes

o Fixed a minor bug with displaying LVM drive-letters

When more partitions that can be displayed were present, scrolling
the menu would not scroll the drive-letter. Fixed.

o Fixed a bug with regard to the drive-letter feature

When partitions were deleted, and some partitions above the deleted
partition(s) had a drive-letter forced, these partitions would lose
this assignment. This bug is also present in v1.06.

Note

The AIRBOOT.HIS file mentions a DOCU directory with the AiR-BOOT
documentation etc. However, this is not present in this commit and
will be provided at a later time.

File size: 7.2 KB
Line 
1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
2;
3; This file is part of AiR-BOOT
4;
5; AiR-BOOT is free software: you can redistribute it and/or modify it under
6; the terms of the GNU General Public License as published by the Free
7; Software Foundation, either version 3 of the License, or (at your option)
8; any later version.
9;
10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
11; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
12; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13; details.
14;
15; You should have received a copy of the GNU General Public License along with
16; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
17;
18; Some Standard macros to make life easier with ALP and other assemblers :D
19
20MPush Macro reglist
21 irp reg,<reglist>
22 push reg
23 EndM
24EndM
25
26MPop Macro reglist
27 irp reg,<reglist>
28 pop reg
29 EndM
30EndM
31
32
33; Rousseau:
34; My editor (Geany) keeps auto-completing 'call' to 'callfar' because
35; of this definition. Since it's not used anywhere I disabled it.
36;~ callfar Macro destination
37 ;~ push cs
38 ;~ call &destination
39;~ EndM
40
41
42;
43; OLD OVERLAP CHECKER, DOES NOT WORK WELL WITH JWASM.
44;
45; NOTE: Overlapchecking in JWasm is not as reliable as in Tasm.
46; Because it's a single pass assembler, the current location can be
47; incorrect. Tasm with multiple passes works correct.
48; FIXME: Get JWasm and Tasm use some common ECHO/%OUT method.
49; (Tasm only pases first word of non-quoted string to a macro)
50check_overlap MACRO loc
51
52 ; Exit macro immediately if no overlap.
53 ; We don't want to assign values to z_last_... if there is no
54 ; overlap because they would then hold the values the last time this
55 ; macro was called and not those of the last overlap.
56 IF (loc - $) LE 0
57 ;~ IF ($ - loc) GE 0
58 EXITM
59 ENDIF
60
61 ; Calculate the overlap.
62 z_last_overlap_size = (loc - $)
63 z_last_overlap_location = loc - z_last_overlap_size
64
65 IFDEF JWASM
66 ; Output message.
67 ECHO
68 ECHO ** ERROR: LOCATION OVERLAP DETECTED [JWASM] ! **
69 ECHO . THIS IS MOST LIKELY CAUSED BY CODE / DATA
70 ECHO . EXPANSION TOWARDS AN 'ORG' DIRECTIVE.
71 ECHO . LOOK AT 'z_last_overlap_location' TO SEE WHERE.
72 ECHO . LOOK AT 'z_last_overlap_size' TO SEE SIZE.
73 ECHO . FORCING ERROR...
74 ECHO
75 ENDIF
76 IFDEF TASM
77 IF2
78 ; Output message (only on pass2).
79 %OUT
80 %OUT ** ERROR: LOCATION OVERLAP DETECTED [TASM] ! **
81 %OUT . THIS IS MOST LIKELY CAUSED BY CODE / DATA
82 %OUT . EXPANSION TOWARDS AN 'ORG' DIRECTIVE.
83 %OUT . LOOK AT 'z_last_overlap_location' TO WHERE.
84 %OUT . LOOK AT 'z_last_overlap_size' TO SEE SIZE.
85 %OUT . FORCING ERROR...
86 %OUT
87 ENDIF
88 ENDIF
89
90 ; Terminate assembly by forcing an error.
91 .ERR
92ENDM
93
94
95;
96; A normal ORG directive resets the location counter where code and data is
97; going to be emitted. If the location counter is reset back to a point
98; where code or data already has been emitted, this will be overwritten
99; without warning.
100; This macro does a check for this condition and aborts if it exists.
101; If there is space between the new location and the last emitted code or data
102; it will be filled with a filler-value defined in this macro..
103;
104; There are differences between assemblers on when and how labels and values
105; are evaluated. Since JWasm is a single-pass assembler, some expressions
106; do not work that do work in multi-pass Tasm.
107; That's why the actual check for overlap is done by db getting a negative
108; value if an overlap occured.
109; Don't change the (after - before) expression to a pre-calculated label
110; because that won't work and will break this macro.
111;
112ORIGIN MACRO loc
113 ;~ IFDEF JWASM
114 ;~ db (@F - $) dup('X')
115 ;~ ORG loc
116 ;~ @@:
117 ;~ ENDIF
118
119 ; Use this value to fill the gap between the new origin and the last
120 ; emitted code or data.
121 IFDEF AUX_DEBUG
122 fillchar = '#'
123 ELSE
124 fillchar = 0
125 ENDIF
126
127 ; Mark the location of the last emitted code or data.
128 z_&loc&_1before:
129
130 ; JWasm can do db 0 dup (0).
131 ; Using db dup() causes JWasm to recognize the after label so that
132 ; overlap calculations are correct.
133 IFDEF JWASM
134 db (z_&loc&_2after - z_&loc&_1before) dup(fillchar)
135 ENDIF
136
137 ; Tasm cannot do db 0 dup(0), so we exclude that condition.
138 ; Overlap checking could be done differently in Tasm but to keep things
139 ; easy the JWasm method above is used.
140 IFDEF TASM
141 IF (z_&loc&_2after - z_&loc&_1before) NE 0
142 db (z_&loc&_2after - z_&loc&_1before) dup(fillchar)
143 ENDIF
144 ENDIF
145
146 ; Masm can also do db 0 dup (0), and it does calculate correctly
147 ; but cannot find the after label.
148 ; Same issue as with JWasm but the db construct does not solve it for Masm.
149 ; The label-values show-up to be correct in the listing though.
150 ; Currently overlap-checking is disabled when assembling with Masm !
151 ; FIXME: Find a solution for Masm.
152 IFDEF MASM
153 ;~ db (z_&loc&_2after - z_&loc&_1before) dup(fillchar)
154 ECHO ** Warning: Overlap Check on: loc not performed !
155 ENDIF
156
157 ; Wasm can also do db 0 dup (0), but it complains about brackets or so.
158 ; Seems to be some syntax issue.
159 ; It cannot generate a list-file so values cannot be checked.
160 ; It does not even support ECHO so no warning can be given.
161 ; So overlap-checking is disabled when assembling with Wasm !
162 ; FIXME: Find a solution for Wasm.
163 IFDEF WASM
164 ; NOT EVEN ECHO IS SUPPORTED !
165 ;~ db (z_&loc&_2after - z_&loc&_1before) dup(fillchar)
166 ENDIF
167
168 ; Set the new origin.
169 ORG loc
170
171 ; Mark the new location.
172 z_&loc&_2after:
173
174 ; Calculate the gap.
175 z_&loc&_3gap = z_&loc&_2after - z_&loc&_1before
176
177 ;
178 ; Note that the variables are prefixed with z_ so they appear
179 ; at the end of the list-file.
180 ;
181ENDM
182
183
184
185; Shortcuts for pointer-types
186bptr equ byte ptr
187wptr equ word ptr
188dptr equ dword ptr
189qptr equ qword ptr
190tptr equ tbyte ptr
191
192
193sector_size equ 512 ; Normal size of a sector.
194image_size_60secs equ 7800h ; Size of the pre v1.07 image.
195image_size_62secs equ 7c00h ; Size of the post v1.06 image.
196
197;image_size equ image_size_60secs
198image_size equ image_size_62secs
199
200; Image size in sectors
201sector_count equ image_size / sector_size
202
203IF image_size EQ image_size_60secs
204 ; Maximum number of partitions supported in pre v1.07.
205 max_partitions equ 30
206ELSE
207 ; Maximum number of partitions supported in post v1.06.
208 max_partitions equ 45
209ENDIF
Note: See TracBrowser for help on using the repository browser.