From: deraadt Date: Mon, 27 Jun 2022 16:10:07 +0000 (+0000) Subject: Delete the ancient "hold Shift key to force CHS" code. Noone has needed X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=51249ee399334822201653896040c64cc23040ce;p=openbsd Delete the ancient "hold Shift key to force CHS" code. Noone has needed this in decades. ok sthen krw --- diff --git a/sys/arch/amd64/stand/biosboot/biosboot.8 b/sys/arch/amd64/stand/biosboot/biosboot.8 index 165cdedf778..9cb6390c6aa 100644 --- a/sys/arch/amd64/stand/biosboot/biosboot.8 +++ b/sys/arch/amd64/stand/biosboot/biosboot.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: biosboot.8,v 1.13 2022/03/31 17:27:24 naddy Exp $ +.\" $OpenBSD: biosboot.8,v 1.14 2022/06/27 16:10:07 deraadt Exp $ .\" .\" Copyright (c) 2003 Tom Cosgrove .\" Copyright (c) 1997 Michael Shalayeff @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: March 31 2022 $ +.Dd $Mdocdate: June 27 2022 $ .Dt BIOSBOOT 8 amd64 .Os .Sh NAME @@ -93,31 +93,6 @@ If possible, will read disk sectors using calls detailed in the Phoenix Enhanced Disk Drive Specification (EDD, sometimes known as LBA, reads). It will fall back to CHS reads only if EDD calls are not available. -However, to allow users to boot on hardware that claims LBA capability, -but which requires CHS reads in order to boot, -the user may hold down either Shift key during boot. -If -.Nm -detects this, it will force itself to use CHS calls, ignoring -any LBA capability. -This will of course prevent booting if /boot lies above the 8 GB -CHS limit. -There is an exported symbol -.Dq force_chs -of type u_int8_t -which may be set to 1 to force CHS reads always. -(However, no tool is currently provided to set this flag.) -.Sh DIAGNOSTICS -.Nm -prints a -.Sq !\& -before the -.Dq Loading -message if it is being forced to use CHS rather than LBA reads -(by the user holding down either Shift key during boot, -or having set the -.Dq force_chs -flag in the boot sector). .Pp .Nm prints a @@ -196,21 +171,6 @@ attempted to read a disk sector. This might be any media error, including bad sectors (common on floppy disks), and invalid sectors (can occur with bad geometry translations). .Pp -If this error occurs during an LBA boot (no -.Sq ;\& -after -.Dq Loading ) , -then a CHS boot may succeed. -To do this, you should reboot, then hold down either Shift key -before -.Nm -starts. -You should see a -.Sq !\& -before -.Dq Loading -as confirmation that your -override was accepted. .It Er ERR X Can't boot. Issued when trying to read sectors in CHS mode, diff --git a/sys/arch/amd64/stand/mbr/mbr.S b/sys/arch/amd64/stand/mbr/mbr.S index 2b00826dd0c..8099532d35f 100644 --- a/sys/arch/amd64/stand/mbr/mbr.S +++ b/sys/arch/amd64/stand/mbr/mbr.S @@ -1,4 +1,4 @@ -/* $OpenBSD: mbr.S,v 1.6 2022/05/24 17:29:02 krw Exp $ */ +/* $OpenBSD: mbr.S,v 1.7 2022/06/27 16:10:09 deraadt Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff and Tobias Weingartner @@ -66,9 +66,6 @@ #define CHAR_LBA_READ '.' #define CHAR_CHS_READ ';' -#define CHAR_SHIFT_SEEN 0x07 /* Use BEL */ - -#define MBR_FLAGS_FORCE_CHS 0x0001 #ifdef DEBUG #define CHAR_S 'S' /* started */ @@ -178,27 +175,6 @@ reloc: popw %dx #endif - /* - * If the SHIFT key is held down on entry, force CHS read - */ - - /* - * BIOS call "INT 0x16 Get Keyboard Shift Flags - * Call with %ah = 0x02 - * Return: - * %al = shift flags - * %ah - undefined by many BIOSes - */ - movb $0x02, %ah - int $0x16 - testb $0x3, %al /* Either shift key down? */ - jz no_shift - - putc(CHAR_SHIFT_SEEN) /* Signal that shift key was seen */ - - orb $MBR_FLAGS_FORCE_CHS, flags - -no_shift: /* BIOS passes us drive number in %dl * * XXX - This is not always true. We currently check if %dl @@ -290,10 +266,6 @@ found: */ pushw %si movw $info, %si - testb $MBR_FLAGS_FORCE_CHS, flags - jnz 1f - incw %si -1: call Lmessage popw %si @@ -323,12 +295,6 @@ found: */ movw $0, %es:signature(,1) - /* - * Have we been instructed to ignore LBA? - */ - testb $MBR_FLAGS_FORCE_CHS, flags - jnz do_chs - /* * We will use the LBA sector number if we have LBA support, * so find out. @@ -414,7 +380,7 @@ do_lba: movw $lba_command, %si int $0x13 - popw %si /* (get back %si) flags unchanged */ + popw %si /* get back %si */ jnc booting_os /* If it worked, run the pbr we got */ @@ -523,7 +489,7 @@ lba_sector: .long 0, 0 /* sector number */ /* Info messages */ -info: .ascii "!Using drive " +info: .ascii "Using drive " drive_num: .byte 'X' .ascii ", partition " @@ -540,14 +506,6 @@ crlf: .asciz "\r\n" endofcode: nop -/* We're going to store a flags word here */ - - . = 0x1b4 -flags: - .word 0x0000 - .ascii "Ox" /* Indicate that the two bytes */ - /* before us are the flags word */ - /* (MBR) NT disk signature offset */ . = 0x1b8 .space 4, 0 diff --git a/sys/arch/i386/stand/biosboot/biosboot.8 b/sys/arch/i386/stand/biosboot/biosboot.8 index 4ee9ae78ea5..a1b8a4ebde7 100644 --- a/sys/arch/i386/stand/biosboot/biosboot.8 +++ b/sys/arch/i386/stand/biosboot/biosboot.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: biosboot.8,v 1.27 2022/03/31 17:27:24 naddy Exp $ +.\" $OpenBSD: biosboot.8,v 1.28 2022/06/27 16:10:09 deraadt Exp $ .\" .\" Copyright (c) 2003 Tom Cosgrove .\" Copyright (c) 1997 Michael Shalayeff @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: March 31 2022 $ +.Dd $Mdocdate: June 27 2022 $ .Dt BIOSBOOT 8 i386 .Os .Sh NAME @@ -93,31 +93,6 @@ If possible, will read disk sectors using calls detailed in the Phoenix Enhanced Disk Drive Specification (EDD, sometimes known as LBA, reads). It will fall back to CHS reads only if EDD calls are not available. -However, to allow users to boot on hardware that claims LBA capability, -but which requires CHS reads in order to boot, -the user may hold down either Shift key during boot. -If -.Nm -detects this, it will force itself to use CHS calls, ignoring -any LBA capability. -This will of course prevent booting if /boot lies above the 8 GB -CHS limit. -There is an exported symbol -.Dq force_chs -of type u_int8_t -which may be set to 1 to force CHS reads always. -(However, no tool is currently provided to set this flag.) -.Sh DIAGNOSTICS -.Nm -prints a -.Sq !\& -before the -.Dq Loading -message if it is being forced to use CHS rather than LBA reads -(by the user holding down either Shift key during boot, -or having set the -.Dq force_chs -flag in the boot sector). .Pp .Nm prints a @@ -196,21 +171,6 @@ attempted to read a disk sector. This might be any media error, including bad sectors (common on floppy disks), and invalid sectors (can occur with bad geometry translations). .Pp -If this error occurs during an LBA boot (no -.Sq ;\& -after -.Dq Loading ) , -then a CHS boot may succeed. -To do this, you should reboot, then hold down either Shift key -before -.Nm -starts. -You should see a -.Sq !\& -before -.Dq Loading -as confirmation that your -override was accepted. .It Er ERR X Can't boot. Issued when trying to read sectors in CHS mode, diff --git a/sys/arch/i386/stand/mbr/mbr.S b/sys/arch/i386/stand/mbr/mbr.S index 99ad02d1048..e234d9d12ad 100644 --- a/sys/arch/i386/stand/mbr/mbr.S +++ b/sys/arch/i386/stand/mbr/mbr.S @@ -1,4 +1,4 @@ -/* $OpenBSD: mbr.S,v 1.24 2022/05/24 17:29:02 krw Exp $ */ +/* $OpenBSD: mbr.S,v 1.25 2022/06/27 16:10:09 deraadt Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff and Tobias Weingartner @@ -66,9 +66,6 @@ #define CHAR_LBA_READ '.' #define CHAR_CHS_READ ';' -#define CHAR_SHIFT_SEEN 0x07 /* Use BEL */ - -#define MBR_FLAGS_FORCE_CHS 0x0001 #ifdef DEBUG #define CHAR_S 'S' /* started */ @@ -178,27 +175,6 @@ reloc: popw %dx #endif - /* - * If the SHIFT key is held down on entry, force CHS read - */ - - /* - * BIOS call "INT 0x16 Get Keyboard Shift Flags - * Call with %ah = 0x02 - * Return: - * %al = shift flags - * %ah - undefined by many BIOSes - */ - movb $0x02, %ah - int $0x16 - testb $0x3, %al /* Either shift key down? */ - jz no_shift - - putc(CHAR_SHIFT_SEEN) /* Signal that shift key was seen */ - - orb $MBR_FLAGS_FORCE_CHS, flags - -no_shift: /* BIOS passes us drive number in %dl * * XXX - This is not always true. We currently check if %dl @@ -290,10 +266,6 @@ found: */ pushw %si movw $info, %si - testb $MBR_FLAGS_FORCE_CHS, flags - jnz 1f - incw %si -1: call Lmessage popw %si @@ -323,12 +295,6 @@ found: */ movw $0, %es:signature(,1) - /* - * Have we been instructed to ignore LBA? - */ - testb $MBR_FLAGS_FORCE_CHS, flags - jnz do_chs - /* * We will use the LBA sector number if we have LBA support, * so find out. @@ -414,7 +380,7 @@ do_lba: movw $lba_command, %si int $0x13 - popw %si /* (get back %si) flags unchanged */ + popw %si /* get back %si */ jnc booting_os /* If it worked, run the pbr we got */ @@ -523,7 +489,7 @@ lba_sector: .long 0, 0 /* sector number */ /* Info messages */ -info: .ascii "!Using drive " +info: .ascii "Using drive " drive_num: .byte 'X' .ascii ", partition " @@ -540,14 +506,6 @@ crlf: .asciz "\r\n" endofcode: nop -/* We're going to store a flags word here */ - - . = 0x1b4 -flags: - .word 0x0000 - .ascii "Ox" /* Indicate that the two bytes */ - /* before us are the flags word */ - /* (MBR) NT disk signature offset */ . = 0x1b8 .space 4, 0