mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[freedos] fixes CHS warning and date/time prompt
* create an empty AUTOEXEC.BAT file to avoid date/time prompt * use a patched version of KERNEL.SYS from 2011.12.16 FreeDOS SVN to avoid CHS warnings see freedos/readme.txt for details * also removed read-only attribute on COMMAND.COM and KERNEL.SYS to allow SYS CONFIG * also * closes #19 * closes #20
This commit is contained in:
parent
6def8f8abe
commit
80f12bce4d
4 changed files with 50 additions and 8 deletions
Binary file not shown.
|
@ -1,2 +1,31 @@
|
||||||
These files were extracted from the fd11tst3.img image available at:
|
The COMMAND.COM file was extracted from the fd11tst3.img image available at:
|
||||||
http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.1-test3/
|
http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.1-test3/
|
||||||
|
|
||||||
|
Because of issue #19 (see https://github.com/pbatard/rufus/issues/19) KERNEL.SYS
|
||||||
|
is a recompiled version, from the 2011.12.16 svn source, with FORCELBA enabled
|
||||||
|
and with the following patch having been applied:
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
Recompilation was done using Open Watcom, as described at:
|
||||||
|
http://pete.akeo.ie/2011/12/compiling-freedos-on-windows-using.html
|
||||||
|
|
15
src/msdos.c
15
src/msdos.c
|
@ -379,7 +379,7 @@ BOOL ExtractFreeDOS(const char* path)
|
||||||
safe_strcat(filename, sizeof(filename), res_name[i]);
|
safe_strcat(filename, sizeof(filename), res_name[i]);
|
||||||
|
|
||||||
hFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
hFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||||
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM, 0);
|
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM, 0);
|
||||||
if (hFile == INVALID_HANDLE_VALUE) {
|
if (hFile == INVALID_HANDLE_VALUE) {
|
||||||
uprintf("Unable to create file '%s': %s.\n", filename, WindowsErrorString());
|
uprintf("Unable to create file '%s': %s.\n", filename, WindowsErrorString());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -397,6 +397,19 @@ BOOL ExtractFreeDOS(const char* path)
|
||||||
safe_closehandle(hFile);
|
safe_closehandle(hFile);
|
||||||
uprintf("Succesfully wrote '%s' (%d bytes)\n", filename, res_size[i]);
|
uprintf("Succesfully wrote '%s' (%d bytes)\n", filename, res_size[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There needs to be at least an AUTOEXEC.BAT to avoid the user being prompted for date and time
|
||||||
|
strcpy(filename, path);
|
||||||
|
pos = strlen(path);
|
||||||
|
filename[pos++] = '\\';
|
||||||
|
filename[pos] = 0;
|
||||||
|
safe_strcat(filename, sizeof(filename), "AUTOEXEC.BAT");
|
||||||
|
hFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||||
|
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||||
|
if (hFile == INVALID_HANDLE_VALUE) {
|
||||||
|
uprintf("Unable to create 'AUTOEXEC.BAT': %s.\n", WindowsErrorString());
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
src/rufus.rc
12
src/rufus.rc
|
@ -30,7 +30,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 206, 278
|
IDD_DIALOG DIALOGEX 12, 12, 206, 278
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_APPWINDOW
|
EXSTYLE WS_EX_APPWINDOW
|
||||||
CAPTION "Rufus v1.0.3.98"
|
CAPTION "Rufus v1.0.3.99"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Start",IDC_START,94,236,50,14
|
DEFPUSHBUTTON "Start",IDC_START,94,236,50,14
|
||||||
|
@ -65,7 +65,7 @@ BEGIN
|
||||||
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
|
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
|
||||||
CONTROL "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL,
|
CONTROL "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL,
|
||||||
"SysLink",WS_TABSTOP,46,47,114,9
|
"SysLink",WS_TABSTOP,46,47,114,9
|
||||||
LTEXT "Version 1.0.3 (Build 98)",IDC_STATIC,46,19,78,8
|
LTEXT "Version 1.0.3 (Build 99)",IDC_STATIC,46,19,78,8
|
||||||
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP
|
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP
|
||||||
EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL
|
EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL
|
||||||
LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
|
LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
|
||||||
|
@ -170,8 +170,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,3,98
|
FILEVERSION 1,0,3,99
|
||||||
PRODUCTVERSION 1,0,3,98
|
PRODUCTVERSION 1,0,3,99
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -188,13 +188,13 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "akeo.ie"
|
VALUE "CompanyName", "akeo.ie"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "1.0.3.98"
|
VALUE "FileVersion", "1.0.3.99"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus.exe"
|
VALUE "OriginalFilename", "rufus.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "1.0.3.98"
|
VALUE "ProductVersion", "1.0.3.99"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Reference in a new issue