From 1de6cd492b87c9fbd70bb6e9f9e72b336a81d3a0 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 1 Jun 2007 18:17:46 -0700 Subject: [PATCH] "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. --- extlinux.asm | 16 ++++++++++++++-- ldlinux.asm | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/extlinux.asm b/extlinux.asm index a590a36..70bd604 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 eed2951..d8c8cc7 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 -- 2.7.4