|
@@ -19,40 +19,12 @@
|
|
|
|
|
|
#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
|
|
|
|
|
|
-struct edd_dapa {
|
|
|
- u8 pkt_size;
|
|
|
- u8 rsvd;
|
|
|
- u16 sector_cnt;
|
|
|
- u16 buf_off, buf_seg;
|
|
|
- u64 lba;
|
|
|
- u64 buf_lin_addr;
|
|
|
-};
|
|
|
-
|
|
|
/*
|
|
|
* Read the MBR (first sector) from a specific device.
|
|
|
*/
|
|
|
static int read_mbr(u8 devno, void *buf)
|
|
|
{
|
|
|
- struct edd_dapa dapa;
|
|
|
- u16 ax, bx, cx, dx, si;
|
|
|
-
|
|
|
- memset(&dapa, 0, sizeof dapa);
|
|
|
- dapa.pkt_size = sizeof(dapa);
|
|
|
- dapa.sector_cnt = 1;
|
|
|
- dapa.buf_off = (size_t)buf;
|
|
|
- dapa.buf_seg = ds();
|
|
|
- /* dapa.lba = 0; */
|
|
|
-
|
|
|
- ax = 0x4200; /* Extended Read */
|
|
|
- si = (size_t)&dapa;
|
|
|
- dx = devno;
|
|
|
- asm("pushfl; stc; int $0x13; setc %%al; popfl"
|
|
|
- : "+a" (ax), "+S" (si), "+d" (dx)
|
|
|
- : "m" (dapa)
|
|
|
- : "ebx", "ecx", "edi", "memory");
|
|
|
-
|
|
|
- if (!(u8)ax)
|
|
|
- return 0; /* OK */
|
|
|
+ u16 ax, bx, cx, dx;
|
|
|
|
|
|
ax = 0x0201; /* Legacy Read, one sector */
|
|
|
cx = 0x0001; /* Sector 0-0-1 */
|