Bochs/bochs/patches/patch.mohn-bximage-2gig

54 lines
2.2 KiB
Plaintext

Index: misc/bximage.c
===================================================================
RCS file: /cvsroot/bochs/bochs/misc/bximage.c,v
retrieving revision 1.5
diff -u -r1.5 bximage.c
--- misc/bximage.c 2001/06/01 05:45:55 1.5
+++ misc/bximage.c 2001/12/07 05:19:34
@@ -16,6 +16,7 @@
char *EOF_ERR = "ERROR: End of input";
char *rcsid = "$Id: patch.mohn-bximage-2gig,v 1.1 2001-12-07 05:21:18 bdenney Exp $";
char *divider = "========================================================================";
+int hdsize; //declared this integer here instead of in the "main" section so that the "make_image" section would work
/* menu data for choosing floppy/hard disk */
char *fdhd_menu = "\nDo you want to create a floppy disk image or a hard disk image?\nPlease type hd or fd. [hd] ";
@@ -44,6 +45,7 @@
bx_center_print (stdout, "bximage\n", 72);
bx_center_print (stdout, "Disk Image Creation Tool for Bochs\n", 72);
bx_center_print (stdout, rcsid, 72);
+ bx_center_print (stdout, "# MODIFIED BY HENRY III #", 72);
printf ("\n%s\n", divider);
}
@@ -216,11 +218,12 @@
for (i=0; i<sec; i++) {
n = (unsigned int) fwrite (buffer, 512, 1, fp);
if (n != 1) {
- printf ("\nWrite failed with %d sectors written\n", i);
+ printf ("\nWrite failed with %d sectors written\n",
+i);
fclose (fp);
fatal ("ERROR: The disk image is not complete!");
}
- if ((i%2048) == 0) {
+ if ((i%hdsize) == 0) { //changed from "2048" to "hdsize" instead so that it would keep going
printf (".");
fflush (stdout);
}
@@ -241,10 +244,12 @@
if (ask_menu (fdhd_menu, fdhd_n_choices, fdhd_choices, 1, &hd) < 0)
fatal (EOF_ERR);
if (hd) {
- int hdsize, cyl, heads=16, spt=63;
+ int cyl, heads=16, spt=63;
if (ask_int ("\nEnter the hard disk size in megabytes, between 1 and 32255\n[10] ", 1, 32255, 10, &hdsize) < 0)
fatal (EOF_ERR);
- cyl = hdsize*1024*1024/16/63/512;
+// cyl = hdsize*1024*1024/16/63/512; - this is the old
+string
+ cyl = hdsize*2.031746031746031746031746031746; //the long number following "hdsize" is simply the "1024*1024*/16/63/512" worked out
assert (cyl < 65536);
sectors = cyl*heads*spt;
printf ("\nI will create a hard disk image with\n");