aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2010-08-01 12:55:27 -0400
committerGene Cumm <gene.cumm@gmail.com>2010-08-01 13:02:35 -0400
commit17cdc1e604dbed3c7a5aefc37a3fb303c539225e (patch)
tree4c3e2f0e12f65f0656748d16a79c69abed3ecda2 /com32
parent6ad62265d73432b5379f04f484c9c1d8934f5aa4 (diff)
downloadsyslinux-17cdc1e604dbed3c7a5aefc37a3fb303c539225e.tar.gz
syslinux-17cdc1e604dbed3c7a5aefc37a3fb303c539225e.tar.xz
syslinux-17cdc1e604dbed3c7a5aefc37a3fb303c539225e.zip
chain: Extra comments; shrink the new space to minimum
Diffstat (limited to 'com32')
-rw-r--r--com32/modules/chain.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index 15c181c2..6a5b1151 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -1705,12 +1705,12 @@ int main(int argc, char *argv[])
}
if (opt.drmk) {
- /* DRMK entry is different */
+ /* DRMK entry is different than MS-DOS/PC-DOS */
/*
- * A new size, aligned to 16 bytes, with one full extra row to
- * guarantee the needed space and ease other values.
+ * A new size, aligned to 16 bytes to ease use of ds:[bp+28].
+ * We only really need 4 new, usable bytes at the end.
*/
- int tsize = (data[ndata].size + 31) & 0xfffffff0;
+ int tsize = (data[ndata].size + 19) & 0xfffffff0;
regs.ss = regs.fs = regs.gs = 0; /* Used before initialized */
if (!realloc(data[ndata].data, tsize)) {
error("Failed to realloc for DRMK\n");
@@ -1719,7 +1719,7 @@ int main(int argc, char *argv[])
data[ndata].size = tsize;
/* ds:[bp+28] must be 0x0000003f */
regs.ds = (tsize >> 4) + (opt.seg - 2);
- /* "Patch" into the extra row */
+ /* "Patch" into tail of the new space */
*(int *)(data[ndata].data + tsize - 4) = 0x0000003f;
}