Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113381
b: refs/heads/master
c: 6cdcdb9
h: refs/heads/master
i:
  113379: ede3109
v: v3
  • Loading branch information
Andrey Borzenkov authored and H. Peter Anvin committed Oct 3, 2008
1 parent 00e354e commit f91ddd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 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: 464f04c9e9b3b1c4f5ffb89c51d8ba2a2034c846
refs/heads/master: 6cdcdb99cf7c2e1835fc5b471864d21161c3e679
7 changes: 6 additions & 1 deletion trunk/arch/x86/boot/edd.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static u32 read_mbr_sig(u8 devno, struct edd_info *ei, u32 *mbrsig)
char *mbrbuf_ptr, *mbrbuf_end;
u32 buf_base, mbr_base;
extern char _end[];
u16 mbr_magic;

sector_size = ei->params.bytes_per_sector;
if (!sector_size)
Expand All @@ -60,11 +61,15 @@ static u32 read_mbr_sig(u8 devno, struct edd_info *ei, u32 *mbrsig)
if (mbrbuf_end > (char *)(size_t)boot_params.hdr.heap_end_ptr)
return -1;

memset(mbrbuf_ptr, 0, sector_size);
if (read_mbr(devno, mbrbuf_ptr))
return -1;

*mbrsig = *(u32 *)&mbrbuf_ptr[EDD_MBR_SIG_OFFSET];
return 0;
mbr_magic = *(u16 *)&mbrbuf_ptr[510];

/* check for valid MBR magic */
return mbr_magic == 0xAA55 ? 0 : -1;
}

static int get_edd_info(u8 devno, struct edd_info *ei)
Expand Down

0 comments on commit f91ddd7

Please sign in to comment.