All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Domsch <Matt_Domsch@dell.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: David Balazic <david.balazic@hermes.si>,
	Dave Jones <davej@redhat.com>, Andries Brouwer <aebr@win.tue.nl>,
	Pavel Machek <pavel@suse.cz>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@suse.de>, Andrew Morton <akpm@osdl.org>
Subject: Re: Weird:  30 sec delay during early boot
Date: Tue, 13 Jul 2004 21:32:33 -0500	[thread overview]
Message-ID: <20040714023233.GA15328@lists.us.dell.com> (raw)
In-Reply-To: <40F463B0.1010706@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

On Tue, Jul 13, 2004 at 06:35:28PM -0400, Jeff Garzik wrote:
> Can you attach the patch, or switch mailers?
> 
> The patch is word-wrapped and otherwise munged :(

That was sent with mutt-1.4.1-3 on a RHEL3 system...

Attached this time.
-- 
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

[-- Attachment #2: 30sec_delay.patch --]
[-- Type: text/plain, Size: 2062 bytes --]

===== arch/i386/boot/edd.S 1.2 vs edited =====
--- 1.2/arch/i386/boot/edd.S	2004-06-29 09:44:48 -05:00
+++ edited/arch/i386/boot/edd.S	2004-07-13 16:48:50 -05:00
@@ -12,13 +12,31 @@
 #include <linux/edd.h>
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
-# Read the first sector of each BIOS disk device and store the 4-byte signature
 edd_mbr_sig_start:
+	xor	%ebx, %ebx
+	xor	%edx, %edx
 	movb	$0, (EDD_MBR_SIG_NR_BUF)	# zero value at EDD_MBR_SIG_NR_BUF
+       	movw	$EDD_MBR_SIG_BUF, %bx		# store buffer ptr in bx
 	movb	$0x80, %dl			# from device 80
-	movw	$EDD_MBR_SIG_BUF, %bx		# store buffer ptr in bx
+
 edd_mbr_sig_read:
-	movl	$0xFFFFFFFF, %eax
+# Do int13 fn15 first, as BIOS should know if a disk is present or not.
+# This avoids long (>30s) delays waiting for the READ_SECTORS to a non-present disk.
+	xor	%eax, %eax
+	xor	%ecx, %ecx
+       	movb	$GETDISKTYPE, %ah		# Function 15
+	pushw	%dx				# which stomps on dx
+	stc					# work around buggy BIOSes
+    	int	$0x13				# make the call
+	sti					# work around buggy BIOSes
+	popw	%dx				# so get back dx
+	jc	edd_mbr_sig_done		# no more BIOS devices
+	cmpb	$HARDDRIVEPRESENT, %ah		# is hard drive present?
+	jne	edd_mbr_sig_done		# no more BIOS devices
+
+# Read the first sector of each BIOS disk device and store the 4-byte signature
+	xor	%ecx, %ecx
+    	movl	$0xFFFFFFFF, %eax
 	movl	%eax, (%bx)			# assume failure
 	pushw	%bx
 	movb	$READ_SECTORS, %ah
===== include/linux/edd.h 1.11 vs edited =====
--- 1.11/include/linux/edd.h	2004-06-29 09:44:48 -05:00
+++ edited/include/linux/edd.h	2004-07-13 16:05:14 -05:00
@@ -49,6 +49,9 @@
 #define EDD_MBR_SIG_MAX 16        /* max number of signatures to store */
 #define EDD_MBR_SIG_NR_BUF 0x1ea  /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
 				     in boot_params - treat this as 1 byte  */
+#define GETDISKTYPE 0x15          /* int13 AH=0x15 is Get Disk Type command */
+#define HARDDRIVEPRESENT 0x03     /* int13 AH=15 return code in AH */
+
 #ifndef __ASSEMBLY__
 
 #define EDD_EXT_FIXED_DISK_ACCESS           (1 << 0)

  reply	other threads:[~2004-07-14  2:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-05 11:30 Weird: 30 sec delay during early boot David Balazic
2004-07-13 22:16 ` Matt Domsch
2004-07-13 22:35   ` Jeff Garzik
2004-07-14  2:32     ` Matt Domsch [this message]
2004-07-14  3:03       ` Matt Domsch
2004-07-14  3:18         ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2004-07-30 12:52 David Balazic
2004-07-29 13:05 David Balazic
2004-07-29 16:02 ` Matt Domsch
2004-07-28 12:16 David Balazic
2004-07-28 12:40 ` Matt Domsch
2004-07-05  7:21 David Balazic
2004-07-05 11:25 ` Dave Jones
     [not found] <2e55c-392-7@gated-at.bofh.it>
2004-07-04  2:47 ` Andi Kleen
2004-07-04  2:52   ` Jeff Garzik
2004-07-04  3:23     ` Andi Kleen
2004-07-04  2:34 Jeff Garzik
2004-07-04  6:33 ` Pavel Machek
2004-07-04 17:33   ` Jeff Garzik
2004-07-04 20:52     ` Matt Domsch
2004-07-04 23:27       ` Andries Brouwer
2004-07-05 13:31         ` Matt Domsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040714023233.GA15328@lists.us.dell.com \
    --to=matt_domsch@dell.com \
    --cc=aebr@win.tue.nl \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=davej@redhat.com \
    --cc=david.balazic@hermes.si \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.