Hello all,

I am proposing the attached patch for your consideration.

I believe it makes sense not to print the CHS/LBA mismatch warnings when
FORCELBA is in use, as, if someone uses FORCELBA, they probably don't
care whether the CHS values that were fed by the BIOS match or not: they already indicated that they want to use LBA regardless.


Now, the full reasoning of why I would like this change integrated is as
follows:

1. I am the developer of Rufus [1], which is a DOS-bootable USB flash drive creation utility for Windows. One of the versions of Rufus embeds FreeDOS (kernel + freecom) for installation as the default DOS, in lieu of the WinMe DOS that can be extracted from diskcopy.dll.

2. The current Rufus utility only creates LBA partitions for bootable FAT16 and FAT32, as this offers the best compatibility.

3. All the machines I have tried so far report the CHS vs LBA computed mismatch warnings. Considering that first time FreeDOS users might be put off because of these benign warnings, I would very much like to avoid them.

4. My current understanding is that it is the BIOS that feeds the CHS values that are compared against the LBA computed ones. Unfortunately that means that, since the bootable USB stick is most likely created on a different machine than the one it will boot, even if we could act on it, it is next to impossible to guess what CHS values the BIOS will use. Thus, the expectation is that these warnings will always manifest themselves.

5. At the moment, I am embedding a KERNEL.SYS which I recompiled with the attached patch and with FORCELBA enabled, so this is not a major issue. Still I would prefer embedding an official KERNEL.SYS, so that users can easily confirm that there is nothing malicious in the FreeDOS files provided in the utility.

6. Finally, since the current default is not to have FORCELBA on, I expect this change to be low impact for existing users.

Could this patch be considered for the mainline tree then?

Regards,

/Pete

[1] http://rufus.akeo.ie

PS: is there a reason why one must have an AUTOEXEC.BAT present, even a blank one, to avoid the prompts for date&time in FreeCOM? What is the purpose of mandatory prompting for those?

Index: kernel/initdisk.c
===================================================================
--- kernel/initdisk.c   (revision 1696)
+++ kernel/initdisk.c   (working copy)
@@ -810,10 +810,13 @@
 void print_warning_suspect(char *partitionName, UBYTE fs, struct CHS *chs,
                            struct CHS *pEntry_chs)
 {
-  printf("WARNING: using suspect partition %s FS %02x:", partitionName, fs);
-  printCHS(" with calculated values ", chs);
-  printCHS(" instead of ", pEntry_chs);
-  printf("\n");
+  if (!InitKernelConfig.ForceLBA)
+  {
+    printf("WARNING: using suspect partition %s FS %02x:", partitionName, fs);
+    printCHS(" with calculated values ", chs);
+    printCHS(" instead of ", pEntry_chs);
+    printf("\n");
+  }
   memcpy(pEntry_chs, chs, sizeof(struct CHS));
 }
 

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to