aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 */