[syslinux:pathbased] mdiskchk: Add --no-sequential mode

syslinux-bot for Shao Miller shao.miller at yrdsb.edu.on.ca
Sat Jun 19 19:12:02 PDT 2010


Commit-ID:  107806f9ab7e87b0535944606d53b07dca291b1c
Gitweb:     http://syslinux.zytor.com/commit/107806f9ab7e87b0535944606d53b07dca291b1c
Author:     Shao Miller <shao.miller at yrdsb.edu.on.ca>
AuthorDate: Tue, 15 Jun 2010 00:34:20 -0400
Committer:  Shao Miller <shao.miller at yrdsb.edu.on.ca>
CommitDate: Tue, 15 Jun 2010 00:48:56 -0400

mdiskchk: Add --no-sequential mode

It might be useful to suppress MDISKCHK.COM's classic behaviour
of probing all BIOS drive numbers in search of MEMDISKs.  Some BIOSes
might not enjoy being probed.

Reported-by: bylokk
Reported-by: Gert Hulselmans <gerth at zytor.com>
Signed-off-by: Shao Miller <shao.miller at yrdsb.edu.on.ca>


---
 dosutil/mdiskchk.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/dosutil/mdiskchk.c b/dosutil/mdiskchk.c
index ddc5763..f7bde61 100644
--- a/dosutil/mdiskchk.c
+++ b/dosutil/mdiskchk.c
@@ -200,7 +200,8 @@ static MDISKCHK_FUNC_DECL(show_usage)
 	   "Action: --safe-hooks . . Will scan INT 13h \"safe hook\" chain\n"
 	   "        --mbfts . . . .  Will scan memory for MEMDISK mBFTs\n"
 	   "        --batch-output . Will output SET command output based\n"
-	   "                         on MEMDISK kernel arguments\n");
+	   "                         on MEMDISK kernel arguments\n"
+	   "        --no-sequential  Suppresses probing all drive numbers\n");
 }
 
 /* Search memory for mBFTs and report them via the output method */
@@ -297,6 +298,7 @@ int main(int argc, char *argv[])
 {
     int d;
     int found = 0;
+    int sequential_scan = 1;	/* Classic behaviour */
     const struct memdiskinfo *m;
 
     /* Default behaviour */
@@ -331,6 +333,10 @@ int main(int argc, char *argv[])
 	    case 'b':
 		show_memdisk = batch_output;
 		break;
+	    case 'N':
+	    case 'n':
+		sequential_scan = 0;
+		break;
 	    default:
 		usage = show_usage;
 	} /* switch */
@@ -338,6 +344,8 @@ int main(int argc, char *argv[])
 
     safe_hooks();
     mbfts();
+    if (!sequential_scan)
+	goto skip_sequential;
     for (d = 0; d <= 0xff; d++) {
 	m = query_memdisk(d);
 	if (m != NULL) {
@@ -345,6 +353,7 @@ int main(int argc, char *argv[])
 	    show_memdisk(d, m);
 	}
     }
+skip_sequential:
     usage();
 
     return found;



More information about the Syslinux-commits mailing list