The newer version of grldrstart.S has this
. = _start1 + 0x06 + 2
.byte 0xff /* preferred boot drive number, 0xff for no-drive(i.e., drive not defined) */
.byte 0xff /* preferred partition number, 0xff for whole drive(a floppy that has no partition table) */
. = _start1 + 8 + 2
/* 2 bytes at offset 0x08 will be overwritten for storing the geometry
* reported by INT 13/AH=8.
so the preferred boot drive and partition were at byte 6 but are now at byte 8 and geometry was stored at 8 but it should now be 8+2
Basically I searched for 0x02 0x03 0x04 0x06 0x08 and 0x09 to find what was missed.
so I found these were missed
3:
popal
cmpl %eax, (%bx) /* helper loaded? */
jne Error_or_prev_MBR /* Missing helper */
/* Helper is loaded from floppy, so we set floppy as preferred. */
//call set_floppy_preferred
movw $0xff00, 0x06 /* preferred drive=0, partition=0xff */
andb $0xFE, 0x02 /* bit0=0, enable GRLDR search on floppy */
1:
also
movl $0x45435544, %eax
movb %cs:0x02, %al
andb $0x0C, %al
orb $0x40, %al
stosl
popw %es
1:
testb $0x80, %cs:0x02+2 /* boot previous MBR first? */
jnz 2f /* no, continue to find GRLDR */
call sleep_5_seconds
jnc 3f
/* desired hot-key pressed */
andb $0x7F, %cs:0x02
call boot_prev_mbr //Error_modify
/* floppy search disabled ? */
#if 0
testb $1, 0x02 /* test bit0 of the third byte */
jz 1f /* zero means floppy search enabled */
/* 0x1fd or below means disable floppy search */
decw (add_sub_si + 5 - _start1)
#else
movb 0x02, %al
andb $0x01, %al
subb %al, (add_sub_si + 5 - _start1)
#endif
2:
//movl -4(%si), %eax
//cmpl $0xfffffe00, %eax /* check the starting CHS */
//jb 1f /* use normal CHS mode */
pushaw /* <------ at least DL,SI need to be saved */
cmpw $0xFFFF, 0x08 /* geometry determined? */
jne 3f /* yes, skip */
movw $0xFE3F, 0x08 /* use a default of H=255, S=63 */
movb %dh, %ch /* DH=Hmax */
movw %cx, 0x08 /* CL=Smax, CH=Hmax */
3:
/******************************************************************/
/* read the boot sectors once again using CHS translated from LBA */
/******************************************************************/
//addl $32, %ebx /* read sector 32 past the boot sector */
movw $0, %bp
movw 0x08, %ax
movw %ax, %dx
1:
movw $0xffff, 0x08
/* return with success */
movw %cs:(Smax_tuned - _start1), %cx
movb %cs:(Hmax_tuned - _start1), %dh
movb %cl, %cs:0x08 /* Smax */
movb %dh, %cs:0x09 /* Hmax */
movb $0, %ah /* success */
ret
2:
also
movb $15, %cs:0x03 /* reset time out to 15 seconds */
//--------------------------------------------------------------------
/* floppy search disabled ? */
#if 0
testb $1, 0x02 /* test bit0 of the third byte */
jz 1f /* zero means floppy search enabled */
/* 0x1fd or below means disable floppy search */
decw (add_sub_si + 5 - _start1)
#else
movb 0x02, %al
andb $0x01, %al
subb %al, (add_sub_si + 5 - _start1)
#endif
//--------------------------------------------------------------------
testb $0x08, 0x02 /* chs-no-tune */
jnz 2f
movw $0x3920, %cs:0x04+2 /* reset hot-key to space bar */
movb $15, %cs:0x03 /* reset time out to 15 seconds */
call print_message /* CS:SI points to message string */
New file attached - NOT TESTED!