My second bootloader SHUTTLE2 is complete and, in this post, I describe
the tests that I did on it for the first launch. I will not document the
repetition of all the tests done as it was with the first
Space Shuttle in the post
"Test and deploy the Space Shuttle". Additionally, this times, the tests were repeated two times on different
machines (the IBM T41 and the HP EliteBook) and this would require an
extremely long post here with screenshots and comments. You have to trust me
that I did all of them. Here, I document only one of all these tests because
it is the most significant one and it is an experiment at the same time.
I show here the test to check the loading mechanism of SHUTTLE2 in case
the SOFTWARE.BIG file was larger that one cluster and its FAT chain spanned
across two different pages of RAM buffer when SHUTTLE2 read the FAT
from HDD into RAM. For this purpose, I prepared one SOFTWARE.BIG file that
started with a very little code, then it did a big jump across the boundary of
the cluster to find very little code again and finally jumped one more time.
The test checked whether or not SHUTTLE2 was loading SOFTWARE.BIG in
RAM in the correct way. If there was a mistake in the loading, then
SOFTWARE.BIG had to crash because the jumps would not hit the targets.
Similarly to what I did in the post
"Test and deploy the Space Shuttle", I preparade a .BMP ballast file as large as 27,9 MB (just an empty canvas
2000x4891 pixels large). This time, I took care to prepare the "ballast.bmp"
file and the "SOFTWARE.BIG" file on Windows 7 partition then I formatted the
"TEST" partition and I copied first the "ballast.bmp" file and after that the
"SOFTWARE.BIG" file as you can see in
Fig. A
(of course, since I had formatted the TEST partition I also had to put
SHUTTLE2 on the Partition Boot Record again).
|
Fig. A - Preparation of the "TEST" partition
|
I took a dump of the "TEST" Partition, and in
Fig. B
you can see that I made it to place SOFTWARE.BIG just across the two pages of
RAM buffer when SHUTTLE2 reads the FAT from HDD into RAM.
|
Fig. B - Dump of the "TEST" partition on HP EliteBook
|
Besides the main purpose why I did the dump (verifying that SOFTWARE.BIG was
across the two pages of RAM buffer indeed ), I also observed that the partition
contained eight reserved blocks (as confirmed by the word at address 0x0e in
the BIOS Parameter Block). Additionally, I observed how a .BMP starts at
cluster 2.
This is all about the test, but what about the experiment? Well, looking at
the
"Ralf Brown Interrupt List", I saw that the INT 18 is supposed to load ROM BASIC software. I read
also that ROM BASIC software was only available in some IBM machines
and I was curious to find out if there was a BASIC in the ROM of my old IBM
T41 or not.
Here follows the code for the test and experiment (you can download the file
test_SHUTTLE2.npp from the
DOWNLOAD AREA):
[...]
137B:7C00 ;234567890123456789012345678901234567890123456789012345678901234567890123456789
137B:7C00 ;-------10--------20--------30--------40--------50--------60--------70-------79
137B:7C00 ;##############################################################################
137B:7C00 ; test_SHUTTLE2: TEST for SHUTTLE2
137B:7C00 ;
137B:7C00 ; Copyright (C) 2020 - Michele Musci
137B:7C00 ; Distributed under the GNU Affero General Public License version 3.
137B:7C00 ; See https://www.gnu.org/licenses/agpl-3.0.txt
137B:7C00 ;
137B:7C00 ; This is a test for Shuttle 2.
137B:7C00 ; It produces a SOFTWARE.BIG which is larger than a single cluster.
137B:7C00 ;
137B:7C00 ; Build it with command:
137B:7C00 ; debug < test_SHUTTLE2.npp > test_SHUTTLE2_dbg.npp
137B:7C00 ;##############################################################################
137B:7C00 ;
137B:7C00 ; Check signature
137B:7C00 DB A2 DD 7B 8B 87 00 05 3D FF FF 74 19 3D 02 00 72
137B:7C10 ;
137B:7C10 ;
137B:7C10 ;##############################################################################
137B:7C10 ;
137B:7C10 ; Start of code
137B:7C10 ;
137B:7C10 ;##############################################################################
137B:7C10 ;------------------------------------------------------------------------------
137B:7C10 ; General reset.
137B:7C10 ; Remember that SHUTTLE2 leaves the all segments to 0x0000.
137B:7C10 ;------------------------------------------------------------------------------
137B:7C10 mov sp, 7c0e ; Put stack before code.
137B:7C13 jmp 7c40 ; Jump over local procedures.
137B:7C15 ; JUMP main_entry_point: --->
137B:7C15 ;
137B:7C15 ;
137B:7C15 ;##############################################################################
137B:7C15 ;
137B:7C15 ; LOCAL PROCEDURES
137B:7C15 ;
137B:7C15 ;##############################################################################
137B:7C15 ;------------------------------------------------------------------------------
137B:7C15 ; Load service functions into memory
137B:7C15 ;------------------------------------------------------------------------------
137B:7C15
-
-n SHOW_STR.BIN
-l 7c20
-
-
-
-a 7c40
137B:7C40 ;##############################################################################
137B:7C40 ;
137B:7C40 ; MAIN ENTRY POINT
137B:7C40 ;
137B:7C40 ;##############################################################################
137B:7C40 ;
137B:7C40 ; main_entry_point: <---
137B:7C40 ;
137B:7C40 mov si, 7c4d ; point string
137B:7C43 call 7c20 ; Call SHOW_STR
137B:7C46 xor ax, ax ; int 16/ah = 00 : keyboard get keystroke
137B:7C48 int 16 ; returns: ah = BIOS scan code
137B:7C4A ; al = ASCII character
137B:7C4A ;
137B:7C4A jmp 8000 ; Jump 1st_jump: --->
137B:7C4D db 'Test started ok.' 0d 0a
137B:7C5F db 'Press any key for 1st jump...' 0d 0a 0d 0a 00
137B:7C81
-
-
-
-a 8000
137B:8000 ;------------------------------------------------------------------------------
137B:8000 ; First big jump
137B:8000 ;------------------------------------------------------------------------------
137B:8000 ;
137B:8000 ; 1st_jump: <---
137B:8000 ;
137B:8000 mov si, 800d ; point string
137B:8003 call 7c20 ; Call SHOW_STR
137B:8006 xor ax, ax ; int 16/ah = 00 : keyboard get keystroke
137B:8008 int 16 ; returns: ah = BIOS scan code
137B:800A ; al = ASCII character
137B:800A ;
137B:800A jmp C000 ; Jump last_jump: --->
137B:800D db 'Test continued ok.' 0d 0a
137B:8021 db 'Press any key for last jump...' 0d 0a 0d 0a 00
137B:8044
-
-
-
-a C000
137B:C000 ;------------------------------------------------------------------------------
137B:C000 ; Last big jump and test INT 18
137B:C000 ;------------------------------------------------------------------------------
137B:C000 ;
137B:C000 ; last_jump: <---
137B:C000 ;
137B:C000 mov si, c01b ; point string
137B:C003 call 7c20 ; Call SHOW_STR
137B:C006 xor ax, ax ; int 16/ah = 00 : keyboard get keystroke
137B:C008 int 16 ; returns: ah = BIOS scan code
137B:C00A ; al = ASCII character
137B:C00A ;
137B:C00A int 18 ; Try BASIC ROM, but result is unpredictible.
137B:C00C ;
137B:C00C ;
137B:C00C ;------------------------------------------------------------------------------
137B:C00C ; Terminate and reboot.
137B:C00C ;------------------------------------------------------------------------------
137B:C00C mov si, c05b ; point string
137B:C00F call 7c20 ; Call SHOW_STR
137B:C012 xor ax, ax ; int 16/ah = 00 : keyboard get keystroke
137B:C014 int 16 ; returns: ah = BIOS scan code
137B:C016 ; al = ASCII character
137B:C016 ;
137B:C016 jmp FFFF:0000 ; Total system reset since, sometimes,
137B:C01B ; INT19 hangs...
137B:C01B ;
137B:C01B db 'Test continued ok.' 0d 0a
137B:C02F db 'Press any key to try INT18 ROM BASIC...' 0d 0a 0d 0a 00
137B:C05B db 'Return from INT18...' 0d 0a
137B:C071 db 'Press any key to reboot...' 0d 0a 0d 0a 00
137B:C090
-
[...]
I started with the signature at 0x07C00. The entry point was at 0x7C10 (after
the signature) where the software adjusted the stack and jumped over the local
procedure
SHOW_STR. I loaded the local procedure
SHOW_STR
using the simple linking technique as explained in the post
"Hand made linking". The block of the program starting at 0x7C40 displayed a message on the
screen and then jumped ahead (from 0x7C4D to 0x8000 so 947 Bytes in total thus
remaining within the same cluster with the first jump). After that, the
program displayed a second message on the screen and then jumped again 16371
Bytes ahead (from 0x800D to 0xC000) so this time the jump was quite far
outside the current cluster. Finally, at address 0xC00A you see the experiment
with INT 18H. With the experience done after the experiment, I can tell
you that the lines of codes after the INT 18H were never executed. With a
little bit of disappointment, I didn't find and BASIC in the ROM of my
IBM T41. The invocation of INT 18H started a procedure that tried to
boot the system from the network and other media (not the HDD) and then
terminated. The test was successful and you can see both results on the
IBM T41 (Fig. C) and on the HP EliteBook (Fig. D).
|
Fig. C - TEST for SHUTTLE2 on IBM T41
|
|
Fig. D - TEST for SHUTTLE2 on HP EliteBook
|
Comments
Post a Comment