diff --git a/hdr/kconfig.h b/hdr/kconfig.h index 3d3f8c9..02c340a 100644 --- a/hdr/kconfig.h +++ b/hdr/kconfig.h @@ -28,6 +28,22 @@ Revision: revision sequence, e.g. 42 for kernel 2042 Release: 0 if released version, >0 for svn builds (e.g. svn revision #) + CheckDebugger: during initialization enable/disable check to stop in debugger if one is active + 0 = do not check (assume absent), + 1 = do check by running breakpoint, + 2 = assume present + + Verbose: amount of messages to display during initialization + -1 = quiet + 0 = normal + 1 = verbose + + PartitionMode: how to handle GPT and MBR partitions + bits 0-1: 01=GPT if found, 00=MBR if found, 11=Hybrid, GPT first then MBR, 10=Hybrid, MBR first then GPT + in hybrid mode, EE partitions ignored, drives assigned by GPT or MBR first based on hybrid type + bits 2-4: 001=mount ESP (usually FAT32) partition, 010=mount MS Basic partitions, 100=mount unknown partitions + 111=attempt to mount all paritions, 110=attempt to mount all but ESP partitions + bits 5-7: reserved, 0 else undefined behavior */ typedef struct _KernelConfig { char CONFIG[6]; /* "CONFIG" */ @@ -46,10 +62,8 @@ typedef struct _KernelConfig { unsigned short Version_Revision; unsigned short Version_Release; + /* for version 2044 and higher only */ unsigned char CheckDebugger; - /* 0 = do not check (assume absent), - 1 = do check by running breakpoint, - 2 = assume present */ - - signed char Verbose; /* -1 = quiet, 0 = normal, 1 = verbose */ + signed char Verbose; + unsigned char PartitionMode; } KernelConfig; diff --git a/kernel/kernel.asm b/kernel/kernel.asm index dad361c..583e66b 100644 --- a/kernel/kernel.asm +++ b/kernel/kernel.asm @@ -79,6 +79,13 @@ Version_Release dw 1 ; 0=release build, >0=svn# CheckDebugger: db 0 ; 0 = no check, 1 = check, 2 = assume present Verbose db 0 ; -1 = quiet, 0 = normal, 1 = verbose + +PartitionMode db 0x1f ; bits 0-1: 01=GPT if found, 00=MBR if found, 11=Hybrid, GPT first then MBR, 10=Hybrid, MBR first then GPT + ; in hybrid mode, EE partitions ignored, drives assigned by GPT or MBR first based on hybrid type + ; bits 2-4: 001=mount ESP (usually FAT32) partition, 010=mount MS Basic partitions, 100=mount unknown partitions + ; 111=attempt to mount all paritions, 110=attempt to mount all but ESP partitions + ; bits 5-7: reserved, 0 else undefined behavior + configend: kernel_config_size: equ configend - config_signature ; must be below-or-equal the size of struct _KernelConfig diff --git a/sys/fdkrncfg.c b/sys/fdkrncfg.c index d121433..40e7110 100644 --- a/sys/fdkrncfg.c +++ b/sys/fdkrncfg.c @@ -13,7 +13,7 @@ * merged into SYS by tom ehlert * ***************************************************************************/ -char VERSION[] = "v1.04"; +char VERSION[] = "v1.05"; char PROGRAM[] = "SYS CONFIG"; char KERNEL[] = "KERNEL.SYS"; @@ -134,9 +134,21 @@ int readConfigSettings(int kfile, char *kfilename, KernelConfig * cfg) exit(1); } - /* check if config settings old UPX header and adjust */ - if (cfg->ConfigSize == 19) - cfg->ConfigSize = 14; /* ignore 'nused87654321' */ + /* check if config settings old UPX header and adjust + original UPX header incorrectly set size value to 19, + a while back this was fixed and if we ran across a kernel + with the wrong value we would update it to 14. Another bug, + the correct value is 6 (possibly 5 if kernel old enough, but + we can safely ignore the 'u' value for BootHarddiskSeconds + as it won't be used if the kernel doesn't support that option. + The "corrected size" incorrectly included the 8 bytes of the CONFIG + header ['C','O','N','F','I','G' + WORD ConfigSize ]. + 14 was never valid for a released kernel, so we can safely + assume 13 is valid, 15-18 is valid, and >= 20 valid but + that a value of 14 or 19 should really be 6. + */ + if ((cfg->ConfigSize == 19) || (cfg->ConfigSize == 14)) + cfg->ConfigSize = 6; /* ignore 'nused87654321' */ return 1; } @@ -169,7 +181,7 @@ void displayConfigSettings(KernelConfig * cfg) printf ("%s kernel %s (build %d.%d OEM:%02X)\n", (cfg->Version_OemID == 0xFD)?"FreeDOS":"DOS-C", - cfg->Version_Release?"SVN":"Release", + cfg->Version_Release?"Nightly":"Release", cfg->Version_Major, cfg->Version_Revision, cfg->Version_OemID @@ -228,9 +240,16 @@ void displayConfigSettings(KernelConfig * cfg) if (cfg->ConfigSize >= 14) { printf - ("Verbose=%d : -1=quiet, *0=normal, 1=verbose\n", + ("Verbose=%d : -1=quiet, *0=normal, 1=verbose\n", cfg->Verbose); } + + if (cfg->ConfigSize >= 15) + { + printf + ("PartitionMode=0x%02X How GPT or hybrid GPT/MBR partitions used\n", + cfg->PartitionMode); + } #if 0 /* we assume that SYS is as current as the kernel */