diff options
author | Michal Soltys <soltys@ziu.info> | 2010-10-05 20:47:20 +0200 |
---|---|---|
committer | Michal Soltys <soltys@ziu.info> | 2010-10-08 12:40:51 +0200 |
commit | 0104b5d220f8cc5676a7c09b5689d7b13023fac1 (patch) | |
tree | aed0d04cc0353233ebf8192c5889983e415559cd | |
parent | f167db559451bfdca148a712ba256d1c616b7af6 (diff) | |
download | syslinux-0104b5d220f8cc5676a7c09b5689d7b13023fac1.tar.gz syslinux-0104b5d220f8cc5676a7c09b5689d7b13023fac1.tar.xz syslinux-0104b5d220f8cc5676a7c09b5689d7b13023fac1.zip |
com32/chain: make raw handover use total sectors info
With disklib update providing total sectors info, make raw handover
use it (instead of forcing arbitrary number).
Signed-off-by: Michal Soltys <soltys@ziu.info>
-rw-r--r-- | com32/chain/chain.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/com32/chain/chain.c b/com32/chain/chain.c index ae46fec0..9fdb6ce5 100644 --- a/com32/chain/chain.c +++ b/com32/chain/chain.c @@ -603,12 +603,15 @@ static int setup_handover(const struct part_iter *iter, goto bail; } if (!iter->index) { + uint32_t len = ~0u; + if (iter->di.lbacnt < len) + len = (uint32_t)iter->di.lbacnt; *(uint32_t *)ha->start = lba2chs(&iter->di, 0, l2c_cadd); - *(uint32_t *)ha->end = lba2chs(&iter->di, 2879, l2c_cadd); + *(uint32_t *)ha->end = lba2chs(&iter->di, len - 1, l2c_cadd); ha->active_flag = 0x80; - ha->ostype = 0xDA; + ha->ostype = 0xDA; /* "Non-FS Data", anything is good here though ... */ ha->start_lba = 0; - ha->length = 2880; + ha->length = len; } else if (iter->type == typedos) { dp = (const struct disk_dos_part_entry *)iter->record; |