Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64036
b: refs/heads/master
c: c1a6e2b
h: refs/heads/master
v: v3
  • Loading branch information
H. Peter Anvin committed Aug 15, 2007
1 parent b3af453 commit 73ec2de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 362cea339a34e04caae6cad67ea9bde5c100d12b
refs/heads/master: c1a6e2b082a7cefe58315af7a461bbf2f33221a3
30 changes: 1 addition & 29 deletions trunk/arch/i386/boot/edd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 73ec2de

Please sign in to comment.