Good news: i unblocked the 'auto boot' feature available within SET UP (see
latest pull request).
The bad thing: i discovered a weird one-off bug in WUTIL 3.2. It appears that the primary boot loader (located in
PREBOOT.LDX) has an unexplained offset of 1 byte.
This is either a bug in a 27+ year old, widely used hard disk tool nobody noticed - or an emulation bug.
PREBOOT.ASM is assembled with a NOP - which is vital, but eaten away by the BIOS (explanation in part 2 below). And the FAR call afterwards does add another +1 offset (call 0000:1001 in disassembly, which results in a botched stack pointer save right after
START):
mov [1170],sp 89 26 70 11
is executed instead of
mov CS:[1170],sp 2E 89 26 70 11
(= correct statement)
It is unclear why real machines do not crash. Unfortunately i have no working machine left.
When i add an extra $90 (NOP) byte at the start of PREBOOT.LDX it suddenly works. Hey, it even boots CP/M :-)
So it would be very nice if someone (perhaps a 8086 expert) could give me a pointer in the right direction :-)
Robert or Warner, can you please test my bug fixed / 1 byte longer PREBOOT (complete with Wutil 3.2) on a real machine?
https://www.dropbox.com/s/s5eitbyy409yrzu/MODDED_WUTIL_V3.2.ZIP?dl=0From listing:
https://www.dropbox.com/s/hjdslxjdv6726gt/PREBOOT.ASM?dl=0
SECBOOT SEGMENT AT SECSEG
ORG 0
ASSUME CS:SECBOOT
SBFRST DB ?
SBSTART PROC FAR
NOP
SBSTART ENDP
SECBOOT ENDS
CODE SEGMENT
ORG 1000H
ASSUME CS:CODE, DS:NOTHING, ES:NOTHING, SS:NOTHING
START: NOP ;This NOP must be here for ROM boot [ <--- EATEN AWAY BY BIOS, see code before / at F48C0 ]
MOV WORD PTR CS:SAVESP,SP ;Save SP contents at entry time
Full source for boot loaders:
https://www.dropbox.com/s/mvdjtupnbfb2bsq/WUTIL_3.x_SRC.zip?dl=0-----------------------------------------------------------------------------------------
From BIOS source:
https://github.com/shattered/retro-bios/blob/master/dec-rainbow100b/8086_DISASSEMBLY_23-022e5-00Use 'bpset F48C0' to see the far call in action.
seg000:08A0 in al, 60h
seg000:08A2 cmp al, 90h ; 'É' ; First byte is $90 (NOP) ?
seg000:08A4 jnz short NON_SYSTEM__loc_8CD ;
seg000:08A4 ;
seg000:08A6 mov cx, 200h ; 512 bytes
seg000:08A9 mov di, 1000h
seg000:08AC
seg000:08AC GET_BYTES__loc_8AC: ; CODE XREF: sub_84+82Bj
seg000:08AC in al, 60h ; WD1010 input port (8 bit data)
seg000:08AE stosb
seg000:08AF loop GET_BYTES__loc_8AC ;
seg000:08AF ;
seg000:08B1 in al, 67h
seg000:08B3 mov ax, 0EE00h
seg000:08B6 mov ds, ax
seg000:08B8 assume ds:nothing
seg000:08B8 mov ax, sp
seg000:08BA sub ax, 4
seg000:08BD mov ds:1FF7h, ax
seg000:08C0 call far ptr loc_FFF+2 ; BOOT STRAP FROM HARD DISK [ translates to 9A 01 10 00 00 ]