Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63432
b: refs/heads/master
c: ff659d1
h: refs/heads/master
v: v3
  • Loading branch information
H. Peter Anvin committed Jul 31, 2007
1 parent 383220d commit 70e0e99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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: 8b608d2f5a1b3552363a3161566645a409ff8530
refs/heads/master: ff659d13ed91dd0b237064aba91a5259f827aeb3
5 changes: 3 additions & 2 deletions trunk/arch/i386/boot/edd.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,18 @@ static u32 read_mbr_sig(u8 devno, struct edd_info *ei)
u32 mbrsig;
u32 buf_base, mbr_base;
extern char _end[];
static char mbr_buf[1024];

sector_size = ei->params.bytes_per_sector;
if (!sector_size)
sector_size = 512; /* Best available guess */

/* Produce a naturally aligned buffer on the heap */
buf_base = (ds() << 4) + (u32)&_end;
mbr_base = (buf_base+sector_size-1) & ~(sector_size-1);
mbrbuf_ptr = mbr_buf + (mbr_base-buf_base);
mbrbuf_ptr = _end + (mbr_base-buf_base);
mbrbuf_end = mbrbuf_ptr + sector_size;

/* Make sure we actually have space on the heap... */
if (!(boot_params.hdr.loadflags & CAN_USE_HEAP))
return 0;
if (mbrbuf_end > (char *)(size_t)boot_params.hdr.heap_end_ptr)
Expand Down

0 comments on commit 70e0e99

Please sign in to comment.