- Should boot in a reasonable time if '/dev/hda' is very very broken.
*/
#define STRIP_BOOT_HEADER 1
*/
#define STRIP_BOOT_HEADER 1
+/* Reduce size by omitting INT 0x18 handler.
+ */
+#define STRIP_INT18 1
+
/* Maintainers: Disable .org macroinstructions: ONLY FOR compilation tuning!
* - image produced doen't have any functionality!
#define DISABLE_ORG 1
/* Maintainers: Disable .org macroinstructions: ONLY FOR compilation tuning!
* - image produced doen't have any functionality!
#define DISABLE_ORG 1
movw %ax,%ss
movw $0x7C00,%sp
sti
movw %ax,%ss
movw $0x7C00,%sp
sti
ljmp $0x7C0/*segment*/ , $InitContinue7C0-START/*offset*/
InitContinue7C0:
ljmp $0x7C0/*segment*/ , $InitContinue7C0-START/*offset*/
InitContinue7C0:
/***********************/
/* DS invalid, ES==CS */
InitContinueTop:
/***********************/
/* DS invalid, ES==CS */
InitContinueTop:
movw $0x18*4,%di /* ROM basic - failed boot */
movw $SniffFunction0x18-START,%ax
stosw
pushw %cs
popw %ax
stosw
movw $0x18*4,%di /* ROM basic - failed boot */
movw $SniffFunction0x18-START,%ax
stosw
pushw %cs
popw %ax
stosw
+#endif /* !STRIP_INT18 */
sti
/* we WANT DS left with 0x0000 */
/* we WANT ES left with 0x0000 */
sti
/* we WANT DS left with 0x0000 */
/* we WANT ES left with 0x0000 */
cli /* IMPORTANT: Boot sectors must be run with CLI! */
lret /* lret to 0x0000:0x7C00 */
cli /* IMPORTANT: Boot sectors must be run with CLI! */
lret /* lret to 0x0000:0x7C00 */
SniffFunction0x18:
movw $Interrupt0x18Msg-START,%si /* %ds gets fixed in PrintFatal */
SniffFunction0x18:
movw $Interrupt0x18Msg-START,%si /* %ds gets fixed in PrintFatal */
+#endif /* !STRIP_INT18 */
/* fallthru */
PrintFatal:
call PrintString
/* fallthru */
PrintFatal:
call PrintString
+ pushw %bp
+ movw %sp,%bp
+ movb /*orig-%dl:*/ %ss:2/*%bp*/+PUSHALL_SIZE+2/*%ds*/+2/*trash*/+2/*orig-%ax*/(%bp),%dl
+ xorb %cs:DriveFlipFlag-START,%dl /* %ds not yet initialized by: PrintString */
+ movb %dl,/*%dl:*/ %ss:2/*%bp*/+2/*%bp*/+2/*%di*/+2/*%si*/(%bp)
+ popw %bp
call CallVector0x13
jnc SF13_selfcheck
movw $SF13_02_Err_Msg-START,%si
call CallVector0x13
jnc SF13_selfcheck
movw $SF13_02_Err_Msg-START,%si
jz SF13_leave /* just a floppy? */
test $0x7E,%dl
jnz SF13_leave /* 0x82+ disk? It may be correct unsuccessful read. */
jz SF13_leave /* just a floppy? */
test $0x7E,%dl
jnz SF13_leave /* 0x82+ disk? It may be correct unsuccessful read. */
- pushw %bp
- movw %sp,%bp
- xorb $0x01,/*%dl:*/ %ss:2/*%bp*/+2/*%bp*/+2/*%di*/+2/*%si*/(%bp)
-SF13_do02_retry_popw_bp:
- popw %bp
+ xorb $0x01,%ds:DriveFlipFlag-START /* %ds already initialized by: PrintString */
jmp SF13_do02_retry
/* Prevent: Error 17
jmp SF13_do02_retry
/* Prevent: Error 17
cmpb $0x00,%dh /* Head 0 ? */
jne SF13_leave_zero
movb $BACKUP_SECTOR/63,%dh
cmpb $0x00,%dh /* Head 0 ? */
jne SF13_leave_zero
movb $BACKUP_SECTOR/63,%dh
- movw $1+(BACKUP_SECTOR%63),%cx
+ movb $1+(BACKUP_SECTOR%63),%cl
+ pushw %dx
+ xorb %cs:DriveFlipFlag-START,%dl /* %ds not yet initialized by: PrintString */
movw $0x0201,%ax
CallJumpVector0x13
movw $0x0201,%ax
CallJumpVector0x13
+ xorb $0x01,%cs:DriveFlipFlag-START /* %ds not yet initialized by: PrintString */
jmp SF13_self_retry
SF13_self_ok:
jmp SF13_self_retry
SF13_self_ok:
.ascii "BaR"
#endif
.byte 13,10
.ascii "BaR"
#endif
.byte 13,10
.byte 0
BadSignatureMsg:
#if 0
.byte 0
BadSignatureMsg:
#if 0
/* Interrupt sniffing messages */
/*******************************/
/* Interrupt sniffing messages */
/*******************************/
Interrupt0x18Msg:
#if 0
.asciz "Interrupt 0x18 - Failed boot!"
#else
.asciz "18"
#endif
Interrupt0x18Msg:
#if 0
.asciz "Interrupt 0x18 - Failed boot!"
#else
.asciz "18"
#endif
+#endif /* !STRIP_INT18 */
/**************************************************************/
/**************************************************************/