Last change
on this file since 43 was 43, checked in by Ben Rietbroek, 11 years ago |
BSS Corruption Problem located (auxdebug on) [2012-02-21]
WARNING!!
All commits upto and including the commit of [2012-05-13] contain
a severe bug!! Building from these sources and then disabling
the 'force LBA' feature while also using the drive-letter feature or
editing the label can DESTROY THE MBR on ALL ATTACHED DISKS!!
DO NOT DISABLE 'FORCE LBA USAGE' WHEN BUILT FROM THE THESE COMMITS!!
Problem
o Function with Xrefs goes out-of-bounds because hideparttable is too small
Has only 30 entries and should be 45.
Lost partition checker initializes out-of-bounds.
Info
o About the hideparttable
For each partition it can be specified which other partitions need to
be hidden when that partition is booted. This is useful for legacy DOS
but also braindead Windows that presents HPFS/JFS partitions as
unformatted and tries to persuade the user to format them.
With v1.07 the numer of partitions that can be handled was expanded from
30 to 45, but the size of the hideparttable was overseen.
o The need to compress the hideparttable
The old size was 30x30=900 bytes while the required size is 45x45=2045 bytes.
This amount of space is not available in the image.
Since 6 bits are enough to identify the partition number to be hidden,
the solution is to devide the table into bitfields. This will result
in a table of (45*45*6)/8=1519 bytes, which can be fitted.
Changes
Revamped the sources quite a bit and moved the history to a separate
file. (AIR-BOOT.HIS)
New
o FIXCODE script for Linux
Just until the C version is ready...
|
-
Property svn:executable
set to
*
|
File size:
1.4 KB
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | #
|
---|
4 | # $airboot@ecomstation.com$
|
---|
5 | #
|
---|
6 | # This is a hack until the Linux version of FIXCODE.C is finished.
|
---|
7 | # Note that it does not search for the AiR-BOOT Protection Signature,
|
---|
8 | # but embeds it at the 'well known' location.
|
---|
9 | # It the protection image is moved, this script will corrupt AIR-BOOT.COM
|
---|
10 | # of which the final AIRBOOT.BIN is derived.
|
---|
11 | # Also, a code-size of 35h (max size) is always inserted.
|
---|
12 | # Furthermore, it does no sanity checks whatsoever.
|
---|
13 | #
|
---|
14 |
|
---|
15 | PROT_IMG="MBR-PROT/MBR_PROT.COM"
|
---|
16 | AB_INTERIM_IMG="AIR-BOOT.COM"
|
---|
17 | CODE_SIZE_OFFSET=16
|
---|
18 | PROT_IMG_OFFSET=26624
|
---|
19 |
|
---|
20 |
|
---|
21 | function Header() {
|
---|
22 | echo "Header";
|
---|
23 | }
|
---|
24 |
|
---|
25 | function CheckIfFileExists() {
|
---|
26 | echo "CheckIfFileExists";
|
---|
27 | if [ ! -f "${1}" ]; then
|
---|
28 | echo "ERROR: File ${1} could not be found !";
|
---|
29 | echo " Aborting...";
|
---|
30 | exit 1;
|
---|
31 | else
|
---|
32 | echo "File ${1} found, OK.";
|
---|
33 | fi;
|
---|
34 | }
|
---|
35 |
|
---|
36 | function EmbedCodeSize() {
|
---|
37 | echo "EmbedCodeSize";
|
---|
38 | echo -n "5" | dd of="${1}" bs=1 seek=${CODE_SIZE_OFFSET} conv=notrunc;
|
---|
39 | }
|
---|
40 |
|
---|
41 | function EmbedProtectionImage() {
|
---|
42 | echo "EmbedProtectionImage";
|
---|
43 | dd if="${1}" of="${2}" bs=1 seek=${PROT_IMG_OFFSET} conv=notrunc;
|
---|
44 | }
|
---|
45 |
|
---|
46 | function VerifyImage() {
|
---|
47 | echo "VerfyImage";
|
---|
48 | }
|
---|
49 |
|
---|
50 | function Footer() {
|
---|
51 | echo "Footer";
|
---|
52 | }
|
---|
53 |
|
---|
54 |
|
---|
55 |
|
---|
56 | #
|
---|
57 | # Main program logic.
|
---|
58 | #
|
---|
59 | function Main() {
|
---|
60 | echo "## Main ##";
|
---|
61 | Header;
|
---|
62 | CheckIfFileExists "${PROT_IMG}"
|
---|
63 | CheckIfFileExists "${AB_INTERIM_IMG}"
|
---|
64 | EmbedCodeSize "${AB_INTERIM_IMG}";
|
---|
65 | EmbedProtectionImage "${PROT_IMG}" "${AB_INTERIM_IMG}";
|
---|
66 | Footer;
|
---|
67 | }
|
---|
68 |
|
---|
69 |
|
---|
70 |
|
---|
71 |
|
---|
72 | #
|
---|
73 | # Invoke the main function.
|
---|
74 | #
|
---|
75 | Main;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.