[syslinux:master] chain.c: move reg setup of dos drive to find_dp( )

syslinux-bot for Michal Soltys soltys at ziu.info
Mon Mar 26 15:03:09 PDT 2012


Commit-ID:  51b3b315298e824b282cae7a0d894f71be816251
Gitweb:     http://www.syslinux.org/commit/51b3b315298e824b282cae7a0d894f71be816251
Author:     Michal Soltys <soltys at ziu.info>
AuthorDate: Mon, 16 Aug 2010 00:31:03 +0200
Committer:  Michal Soltys <soltys at ziu.info>
CommitDate: Sun, 22 Aug 2010 23:45:15 +0200

chain.c: move reg setup of dos drive to find_dp()

Signed-off-by: Michal Soltys <soltys at ziu.info>

---
 com32/chain/chain.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/com32/chain/chain.c b/com32/chain/chain.c
index bdd522c..0f9adb5 100644
--- a/com32/chain/chain.c
+++ b/com32/chain/chain.c
@@ -669,7 +669,11 @@ int find_dp(struct part_iter **_iter)
 	error("WARNING: Partitions on floppy devices may not work.\n");
     }
 
+    /* DOS kernels want the drive number in BL instead of DL. Indulge them. */
+    opt.regs.ebx.b[0] = opt.regs.edx.b[0] = (uint8_t)iter->di.disk;
+
     *_iter = iter;
+
     return 0;
 
 bail:
@@ -910,7 +914,7 @@ int main(int argc, char *argv[])
 
     /* Prepare and set default values */
     memset(&opt, 0, sizeof(opt));
-    opt.drivename = "boot";	/* potential FIXME: maybe we shouldn't assume boot by default */
+    opt.drivename = "boot";	/* potential FIXME: maybe we shouldn't assume boot by default, do wonder later */
 
     /* Parse arguments */
     if(parse_args(argc, argv))
@@ -927,9 +931,6 @@ int main(int argc, char *argv[])
     if(find_dp(&iter))
 	goto bail;
 
-    /* DOS kernels want the drive number in BL instead of DL. Indulge them. */
-    opt.regs.ebx.b[0] = opt.regs.edx.b[0] = (uint8_t)iter->di.disk;
-
     /* Do hide / unhide if appropriate */
     if (opt.hide)
 	hide_unhide(iter); 
@@ -1003,6 +1004,7 @@ int main(int argc, char *argv[])
 	    *(uint32_t *) ((char *)data[sidx].data + 0x1c) = ~0u;
     }
 
+    /* Prepare handover */
 
     if (iter->index) {
 	if (iter->type == typegpt) {


More information about the Syslinux-commits mailing list