aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-08-13 19:27:42 -0400
committerH. Peter Anvin <hpa@zytor.com>2007-08-14 20:54:47 -0400
commitc1a6e2b082a7cefe58315af7a461bbf2f33221a3 (patch)
tree81fbc5ec4232118b33e1e5acf5704462fe3c23d1 /arch
parent362cea339a34e04caae6cad67ea9bde5c100d12b (diff)
[x86 setup] Don't use EDD to get the MBR signature
At least one machine has been identified in the field which advertises EDD for all drives but locks up if one attempts an extended read from a non-primary drive. The MBR is always at CHS 0-0-1, so there is no reason to use an extended read, other than the possibility that the BIOS cannot handle it. Although this might break as many machines as it fixes (a small number either way), the current state is a regression but the reverse is not. Therefore revert to the previous state of not using extended read. Quite probably the Right Thing to do is to read using plain (CHS) read and extended read on failure, but that change would definitely have to go through -mm first. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/boot/edd.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/arch/i386/boot/edd.c b/arch/i386/boot/edd.c
index 658834d9f92a..d65dd21c09f2 100644
--- a/arch/i386/boot/edd.c
+++ b/arch/i386/boot/edd.c
@@ -19,40 +19,12 @@
19 19
20#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) 20#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
21 21
22struct edd_dapa {
23 u8 pkt_size;
24 u8 rsvd;
25 u16 sector_cnt;
26 u16 buf_off, buf_seg;
27 u64 lba;
28 u64 buf_lin_addr;
29};
30
31/* 22/*
32 * Read the MBR (first sector) from a specific device. 23 * Read the MBR (first sector) from a specific device.
33 */ 24 */
34static int read_mbr(u8 devno, void *buf) 25static int read_mbr(u8 devno, void *buf)
35{ 26{
36 struct edd_dapa dapa; 27 u16 ax, bx, cx, dx;
37 u16 ax, bx, cx, dx, si;
38
39 memset(&dapa, 0, sizeof dapa);
40 dapa.pkt_size = sizeof(dapa);
41 dapa.sector_cnt = 1;
42 dapa.buf_off = (size_t)buf;
43 dapa.buf_seg = ds();
44 /* dapa.lba = 0; */
45
46 ax = 0x4200; /* Extended Read */
47 si = (size_t)&dapa;
48 dx = devno;
49 asm("pushfl; stc; int $0x13; setc %%al; popfl"
50 : "+a" (ax), "+S" (si), "+d" (dx)
51 : "m" (dapa)
52 : "ebx", "ecx", "edi", "memory");
53
54 if (!(u8)ax)
55 return 0; /* OK */
56 28
57 ax = 0x0201; /* Legacy Read, one sector */ 29 ax = 0x0201; /* Legacy Read, one sector */
58 cx = 0x0001; /* Sector 0-0-1 */ 30 cx = 0x0001; /* Sector 0-0-1 */