summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-06-01 18:17:46 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-06-01 18:17:46 -0700
commit1de6cd492b87c9fbd70bb6e9f9e72b336a81d3a0 (patch)
tree3b7e6816e37369ea863af78d93a66ca4b52ec18f
parent14d611fd4b4060531ba15d81af56f58779a18af9 (diff)
downloadsyslinux-1de6cd492b87c9fbd70bb6e9f9e72b336a81d3a0.tar.gz
"RAID mode": execute INT 18h on boot failure instead of wait for key
In "RAID mode" we want to execute INT 18h on boot failure instead of waiting for a user keypress.
-rw-r--r--extlinux.asm16
-rw-r--r--ldlinux.asm16
2 files changed, 28 insertions, 4 deletions
diff --git a/extlinux.asm b/extlinux.asm
index a590a366..70bd604b 100644
--- a/extlinux.asm
+++ b/extlinux.asm
@@ -534,7 +534,9 @@ kaboom:
jmp short .loop
.done:
cbw ; AH <- 0
- int 16h ; Wait for keypress
+.again: int 16h ; Wait for keypress
+ ; NB: replaced by int 18h if
+ ; chosen at install time..
int 19h ; And try once more to boot...
.norge: jmp short .norge ; If int 19h returned; this is the end
@@ -557,7 +559,11 @@ bailmsg: db 'Boot error', 0Dh, 0Ah, 0
FirstSector dd 0xDEADBEEF ; Location of sector 1
MaxTransfer dw 0x007F ; Max transfer size
-bootsignature dw 0AA55h
+
+; This field will be filled in 0xAA55 by the installer, but we abuse it
+; to house a pointer to the INT 16h instruction at
+; kaboom.again, which gets patched to INT 18h in RAID mode.
+bootsignature dw kaboom.again-$
;
; ===========================================================================
@@ -1331,10 +1337,16 @@ unmangle_name: call strcpy
kaboom2:
mov si,err_bootfailed
call cwritestr
+ cmp byte [kaboom.again+1],18h ; INT 18h version?
+ je .int18
call getchar
call vgaclearmode
int 19h ; And try once more to boot...
.norge: jmp short .norge ; If int 19h returned; this is the end
+.int18:
+ call vgaclearmode
+ int 18h
+.noreg: jmp short .noreg ; Nynorsk
;
diff --git a/ldlinux.asm b/ldlinux.asm
index eed29519..d8c8cc77 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -541,7 +541,9 @@ kaboom:
jmp short .loop
.done:
cbw ; AH <- 0
- int 16h ; Wait for keypress
+.again: int 16h ; Wait for keypress
+ ; NB: replaced by int 18h if
+ ; chosen at install time..
int 19h ; And try once more to boot...
.norge: jmp short .norge ; If int 19h returned; this is the end
@@ -564,7 +566,11 @@ bailmsg: db 'Boot error', 0Dh, 0Ah, 0
FirstSector dd 0xDEADBEEF ; Location of sector 1
MaxTransfer dw 0x007F ; Max transfer size
-bootsignature dw 0AA55h
+
+; This field will be filled in 0xAA55 by the installer, but we abuse it
+; to house a pointer to the INT 16h instruction at
+; kaboom.again, which gets patched to INT 18h in RAID mode.
+bootsignature dw kaboom.again-$
;
; ===========================================================================
@@ -1163,10 +1169,16 @@ PrevDir resd 1 ; Last scanned directory
kaboom2:
mov si,err_bootfailed
call cwritestr
+ cmp byte [kaboom.again+1],18h ; INT 18h version?
+ je .int18
call getchar
call vgaclearmode
int 19h ; And try once more to boot...
.norge: jmp short .norge ; If int 19h returned; this is the end
+.int18:
+ call vgaclearmode
+ int 18h
+.noreg: jmp short .noreg ; Nynorsk
;
; mangle_name: Mangle a filename pointed to by DS:SI into a buffer pointed