add support for more kernels to SYS, throw out EDR specifics

This commit is contained in:
Bernd Wilhelm Böckmann 2024-05-19 14:01:28 +02:00 committed by Kenneth J Davis
parent 8e8fcd1628
commit 76f14d608d
1 changed files with 46 additions and 56 deletions

102
sys/sys.c
View File

@ -30,22 +30,9 @@
/* #define DDEBUG */ /* to enable display of sector dumps */ /* #define DDEBUG */ /* to enable display of sector dumps */
/* #define WITHOEMCOMPATBS */ /* include support for OEM MS/PC DOS 3.??-6.x */ /* #define WITHOEMCOMPATBS */ /* include support for OEM MS/PC DOS 3.??-6.x */
#define FDCONFIG /* include support to configure FD kernel */ #define FDCONFIG /* include support to configure FD kernel */
/* #define DRSYS */ /* SYS for Enhanced DR-DOS (OpenDOS enhancement Project) */
#define SYS_VERSION "v3.6e" #define SYS_VERSION "v3.6f"
#define SYS_NAME "FreeDOS System Installer " #define SYS_NAME "DOS System Installer "
#ifdef DRSYS /* set displayed name & drop FD kernel config */
#undef SYS_NAME
#define SYS_NAME "Enhanced DR-DOS System Installer "
#ifdef FDCONFIG
#undef FDCONFIG
#endif
#ifdef WITHOEMCOMPATBS
#undef WITHOEMCOMPATBS
#endif
#endif
#include <stdlib.h> #include <stdlib.h>
#ifndef __GNUC__ #ifndef __GNUC__
@ -437,16 +424,15 @@ typedef struct DOSBootFiles {
#define FREEDOS_FILES { "KERNEL.SYS", NULL, 0x60/*:0*/, 1, 0 }, #define FREEDOS_FILES { "KERNEL.SYS", NULL, 0x60/*:0*/, 1, 0 },
DOSBootFiles bootFiles[] = { DOSBootFiles bootFiles[] = {
/* Note: This order is the order OEM:AUTO uses to determine DOS flavor. */ /* Note: This order is the order OEM:AUTO uses to determine DOS flavor. */
#ifndef DRSYS
/* FreeDOS */ FREEDOS_FILES /* FreeDOS */ FREEDOS_FILES
#endif /* DR-DOS */ { "DRBIO.SYS", "DRDOS.SYS", 0x70, 1, 1 },
/* DR-DOS */ { "DRBIO.SYS", "DRDOS.SYS", 0x70/*:0*/, 1, 1 }, /* DR-DOS */ { "EDRPACK.SYS", NULL, 0x60, 1, 0 },
/* DR-DOS */ { "IBMBIO.COM", "IBMDOS.COM", 0x70/*:0*/, 1, 1 }, /* DR-DOS */ { "EDRDOS.COM", NULL, 0x60, 1, 0 },
#ifdef DRSYS /* OSS MS-DOS */ { "LMSPACK.SYS", NULL, 0x60, 1, 0 },
/* FreeDOS */ FREEDOS_FILES /* OSS MS-DOS */ { "LMSDOS.COM", NULL, 0x60, 1, 0 },
#endif
#ifdef WITHOEMCOMPATBS #ifdef WITHOEMCOMPATBS
/* PC-DOS */ { "IBMBIO.COM", "IBMDOS.COM", /*0x70:*/0x0, 0, 6138 }, /* pre v7 DR ??? */ /* DR-DOS5+*/ { "IBMBIO.COM", "IBMDOS.COM", 0x70/*:0*/, 1, 1 },
/* PC-DOS */ { "IBMBIO.COM", "IBMDOS.COM", /*0x70:*/0x0, 0, 6138 },
/* MS-DOS */ { "IO.SYS", "MSDOS.SYS", /*0x70:*/0x0, 0, 10240 }, /* MS-DOS */ { "IO.SYS", "MSDOS.SYS", /*0x70:*/0x0, 0, 10240 },
/* W9x-DOS */ { "IO.SYS", "MSDOS.SYS", /*0x70:*/0x0200, 0, 0 }, /* W9x-DOS */ { "IO.SYS", "MSDOS.SYS", /*0x70:*/0x0200, 0, 0 },
/* Rx-DOS */ { "RXDOSBIO.SYS", "RXDOS.SYS", /*0x70:*/0x0, 0, 1 }, /* Rx-DOS */ { "RXDOSBIO.SYS", "RXDOS.SYS", /*0x70:*/0x0, 0, 1 },
@ -456,32 +442,29 @@ DOSBootFiles bootFiles[] = {
/* associate friendly name with index into bootFiles array */ /* associate friendly name with index into bootFiles array */
#define OEM_AUTO (-1) /* attempt to guess DOS on source drive */ #define OEM_AUTO (-1) /* attempt to guess DOS on source drive */
#ifndef DRSYS
#define OEM_FD 0 /* standard FreeDOS mode */ #define OEM_FD 0 /* standard FreeDOS mode */
#define OEM_EDR 1 /* use FreeDOS boot sector, but OEM names */ #define OEM_EDR 1 /* DRBIO, DRDOS version of EDR kernel */
#define OEM_DR 2 /* FD boot sector,(Enhanced) DR-DOS names */ #define OEM_LEDRPACK 2 /* lDOS drload version of EDR kernel */
#else #define OEM_LEDR 3 /* lDOS iniload version of EDR kernel */
#define OEM_FD 2 /* standard FreeDOS mode */ #define OEM_LMSPACK 4
#define OEM_EDR 0 /* use FreeDOS boot sector, but OEM names */ #define OEM_LMS 5
#define OEM_DR 1 /* FD boot sector,(Enhanced) DR-DOS names */
#endif
#ifdef WITHOEMCOMPATBS #ifdef WITHOEMCOMPATBS
#define OEM_PC 3 /* use PC-DOS compatible boot sector and names */ #define OEM_DR 6 /* old IBMBIO, IBMDOS compatible DR-DOS versions */
#define OEM_MS 4 /* use PC-DOS compatible BS with MS names */ #define OEM_PC 7 /* use PC-DOS compatible boot sector and names */
#define OEM_W9x 5 /* use PC-DOS compatible BS with MS names */ #define OEM_MS 8 /* use PC-DOS compatible BS with MS names */
#define OEM_RX 6 /* use PC-DOS compatible BS with Rx names */ #define OEM_W9x 9 /* use PC-DOS compatible BS with MS names */
#define OEM_RX 10 /* use PC-DOS compatible BS with Rx names */
#endif #endif
CONST char * msgDOS[DOSFLAVORS] = { /* order should match above items */ CONST char * msgDOS[DOSFLAVORS] = { /* order should match above items */
"\n", /* In standard FreeDOS/EnhancedDR mode, don't print anything special */ "\n", /* In standard FreeDOS mode, don't print anything special */
#ifndef DRSYS "Enhanced DR-DOS mode (DRBIO.SYS and DRDOS.SYS)\n",
"Enhanced DR DOS (OpenDOS Enhancement Project) mode\n", "Enhanced DR-DOS mode (EDRPACK.SYS, lDOS drload)\n",
#endif "Enhanced DR-DOS mode (EDRDOS.COM, lDOS iniload)\n",
"DR DOS (OpenDOS Enhancement Project) mode\n", "OSS MS-DOS mode (LMSPACK.SYS, lDOS)\n",
#ifdef DRSYS "OSS MS-DOS mode (LMSDOS.COM, lDOS iniload)\n"
"\n", /* FreeDOS mode so don't print anything special */
#endif
#ifdef WITHOEMCOMPATBS #ifdef WITHOEMCOMPATBS
"DR-DOS 5+ / OpenDOS / Enhanced DR-DOS (before 2023) mode\n",
"PC-DOS compatibility mode\n", "PC-DOS compatibility mode\n",
"MS-DOS compatibility mode\n", "MS-DOS compatibility mode\n",
"Win9x DOS compatibility mode\n", "Win9x DOS compatibility mode\n",
@ -527,13 +510,17 @@ void showHelpAndExit(void)
" /BOOTONLY: do *not* copy kernel / shell, only update boot sector or image\n" " /BOOTONLY: do *not* copy kernel / shell, only update boot sector or image\n"
" /UPDATE : copy kernel and update boot sector (do *not* copy shell)\n" " /UPDATE : copy kernel and update boot sector (do *not* copy shell)\n"
" /OEM : indicates boot sector, filenames, and load segment to use\n" " /OEM : indicates boot sector, filenames, and load segment to use\n"
" /OEM:FD use FreeDOS compatible settings\n" " /OEM:FD FreeDOS settings\n"
" /OEM:EDR use Enhanced DR DOS 7+ compatible settings\n" " /OEM:EDR Enhanced DR DOS (DRBIO.SYS and DRDOS.SYS)\n"
" /OEM:DR use DR DOS 7+ compatible settings\n" " /OEM:LEDRPACK Enhanced DR DOS (EDRPACK.SYS, lDOS drload)\n"
" /OEM:LEDR Enhanced DR DOS (EDRDOS.COM, lDOS iniload)\n"
" /OEM:LMSPACK OSS MS-DOS (LMSPACK.SYS, lDOS)\n"
" /OEM:LMS OSS MS-DOS (LMSDOS.COM, lDOS iniload)\n"
#ifdef WITHOEMCOMPATBS #ifdef WITHOEMCOMPATBS
" /OEM:PC use PC-DOS compatible settings\n" " /OEM:DR use DR DOS 5+ settings\n"
" /OEM:MS use MS-DOS compatible settings\n" " /OEM:PC use PC-DOS compatible settings\n"
" /OEM:W9x use MS Win9x DOS compatible settings\n" " /OEM:MS use MS-DOS compatible settings\n"
" /OEM:W9x use MS Win9x DOS compatible settings\n"
#endif #endif
" default is /OEM[:AUTO], select DOS based on existing files\n" " default is /OEM[:AUTO], select DOS based on existing files\n"
" /K name : name of kernel to use in boot sector instead of %s\n" " /K name : name of kernel to use in boot sector instead of %s\n"
@ -619,11 +606,19 @@ void initOptions(int argc, char *argv[], SYSOptions *opts)
argp++; /* point to DR/PC/MS that follows */ argp++; /* point to DR/PC/MS that follows */
if (memicmp(argp, "AUTO", 4) == 0) if (memicmp(argp, "AUTO", 4) == 0)
opts->flavor = OEM_AUTO; opts->flavor = OEM_AUTO;
else if (memicmp(argp, "LEDRPACK", 8) == 0)
opts->flavor = OEM_LEDRPACK;
else if (memicmp(argp, "LEDR", 4) == 0)
opts->flavor = OEM_LEDR;
else if (memicmp(argp, "EDR", 3) == 0) else if (memicmp(argp, "EDR", 3) == 0)
opts->flavor = OEM_EDR; opts->flavor = OEM_EDR;
else if (memicmp(argp, "LMSPACK", 7) == 0)
opts->flavor = OEM_LMSPACK;
else if (memicmp(argp, "LMS", 3) == 0)
opts->flavor = OEM_LMS;
#ifdef WITHOEMCOMPATBS
else if (memicmp(argp, "DR", 2) == 0) else if (memicmp(argp, "DR", 2) == 0)
opts->flavor = OEM_DR; opts->flavor = OEM_DR;
#ifdef WITHOEMCOMPATBS
else if (memicmp(argp, "PC", 2) == 0) else if (memicmp(argp, "PC", 2) == 0)
opts->flavor = OEM_PC; opts->flavor = OEM_PC;
else if (memicmp(argp, "MS", 2) == 0) else if (memicmp(argp, "MS", 2) == 0)
@ -894,12 +889,7 @@ void initOptions(int argc, char *argv[], SYSOptions *opts)
} }
/* if unable to determine DOS, assume FreeDOS */ /* if unable to determine DOS, assume FreeDOS */
if (opts->flavor == OEM_AUTO) opts->flavor = if (opts->flavor == OEM_AUTO) opts->flavor = OEM_FD;
#ifdef DRSYS
OEM_EDR;
#else
OEM_FD;
#endif
if (opts->verbose) if (opts->verbose)
printf(msgDOS[opts->flavor]); printf(msgDOS[opts->flavor]);