add ability to adjust verboseness of messages during booting
This commit is contained in:
parent
e4a62f239d
commit
5880d36ba9
@ -410,8 +410,12 @@ readDisk: push si
|
||||
mov word [READADDR_SEG], es
|
||||
mov word [READADDR_OFF], bx
|
||||
|
||||
%ifndef QUIET
|
||||
call show
|
||||
db ".",0
|
||||
%else ; ensure code after this still at same location
|
||||
times 5 nop
|
||||
%endif
|
||||
read_next:
|
||||
|
||||
;******************** LBA_READ *******************************
|
||||
|
@ -135,8 +135,12 @@ cont: mov ds, ax
|
||||
sti
|
||||
mov [drive], dl ; BIOS passes drive number in DL
|
||||
|
||||
%ifndef QUIET
|
||||
mov si, msg_LoadFreeDOS
|
||||
call print ; modifies AX BX SI
|
||||
%else ; ensure code after this still at same location
|
||||
times 6 nop
|
||||
%endif
|
||||
|
||||
|
||||
; -------------
|
||||
|
@ -8,22 +8,22 @@
|
||||
production: fat12com.bin fat16com.bin fat32chs.bin fat32lba.bin oemfat12.bin oemfat16.bin
|
||||
|
||||
fat12com.bin: boot.asm
|
||||
$(NASM) -dISFAT12 boot.asm -l$*.lst -ofat12com.bin
|
||||
$(NASM) -dISFAT12 $(NASMFLAGS) boot.asm -l$*.lst -ofat12com.bin
|
||||
|
||||
fat16com.bin: boot.asm
|
||||
$(NASM) -dISFAT16 boot.asm -l$*.lst -ofat16com.bin
|
||||
$(NASM) -dISFAT16 $(NASMFLAGS) boot.asm -l$*.lst -ofat16com.bin
|
||||
|
||||
fat32chs.bin: boot32.asm
|
||||
$(NASM) boot32.asm -l$*.lst -ofat32chs.bin
|
||||
$(NASM) $(NASMFLAGS) boot32.asm -l$*.lst -ofat32chs.bin
|
||||
|
||||
fat32lba.bin: boot32lb.asm
|
||||
$(NASM) boot32lb.asm -l$*.lst -ofat32lba.bin
|
||||
$(NASM) $(NASMFLAGS) boot32lb.asm -l$*.lst -ofat32lba.bin
|
||||
|
||||
oemfat12.bin: oemboot.asm
|
||||
$(NASM) -dISFAT12 oemboot.asm -l$*.lst -ooemfat12.bin
|
||||
$(NASM) -dISFAT12 $(NASMFLAGS) oemboot.asm -l$*.lst -ooemfat12.bin
|
||||
|
||||
oemfat16.bin: oemboot.asm
|
||||
$(NASM) -dISFAT16 oemboot.asm -l$*.lst -ooemfat16.bin
|
||||
$(NASM) -dISFAT16 $(NASMFLAGS) oemboot.asm -l$*.lst -ooemfat16.bin
|
||||
|
||||
clobber: clean
|
||||
-$(RM) *.bin status.me
|
||||
|
@ -50,4 +50,6 @@ typedef struct _KernelConfig {
|
||||
/* 0 = do not check (assume absent),
|
||||
1 = do check by running breakpoint,
|
||||
2 = assume present */
|
||||
|
||||
signed char Verbose; /* -1 = quiet, 0 = normal, 1 = verbose */
|
||||
} KernelConfig;
|
||||
|
@ -1225,7 +1225,7 @@ STATIC void Config_Buffers(BYTE * pLine)
|
||||
STATIC void CfgBuffersHigh(BYTE * pLine)
|
||||
{
|
||||
Config_Buffers(pLine);
|
||||
printf("Note: BUFFERS will be in HMA or low RAM, not in UMB\n");
|
||||
if (InitKernelConfig.Verbose >= 0) printf("Note: BUFFERS will be in HMA or low RAM, not in UMB\n");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1276,7 +1276,7 @@ STATIC VOID sysVersion(BYTE * pLine)
|
||||
if (GetNumArg(p, &minor) == (BYTE *) 0)
|
||||
return;
|
||||
|
||||
printf("Changing reported version to %d.%d\n", major, minor);
|
||||
if (InitKernelConfig.Verbose >= 0) printf("Changing reported version to %d.%d\n", major, minor);
|
||||
|
||||
LoL->os_setver_major = major; /* not the internal os_major */
|
||||
LoL->os_setver_minor = minor; /* not the internal os_minor */
|
||||
@ -2223,8 +2223,11 @@ STATIC void config_init_buffers(int wantedbuffers)
|
||||
if (FP_SEG(pbuffer) == 0xffff)
|
||||
{
|
||||
buffers++;
|
||||
printf("Kernel: allocated %d Diskbuffers = %u Bytes in HMA\n",
|
||||
if (InitKernelConfig.Verbose >= 0)
|
||||
{
|
||||
printf("Kernel: allocated %d Diskbuffers = %u Bytes in HMA\n",
|
||||
buffers, buffers * sizeof(struct buffer));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ void init_LBA_to_CHS(struct CHS *chs, ULONG LBA_address,
|
||||
void printCHS(char *title, struct CHS *chs)
|
||||
{
|
||||
/* has no fixed size for head/sect: is often 1/1 in our context */
|
||||
printf("%s%4u-%u-%u", title, chs->Cylinder, chs->Head, chs->Sector);
|
||||
if (InitKernelConfig.Verbose >= 0) printf("%s%4u-%u-%u", title, chs->Cylinder, chs->Head, chs->Sector);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -735,7 +735,7 @@ StandardBios: /* old way to get parameters */
|
||||
if (driveParam->chs.Sector == 0) {
|
||||
/* happens e.g. with Bochs 1.x if no harddisk defined */
|
||||
driveParam->chs.Sector = 63; /* avoid division by zero...! */
|
||||
printf("BIOS reported 0 sectors/track, assuming 63!\n");
|
||||
if (InitKernelConfig.Verbose >= 0) printf("BIOS reported 0 sectors/track, assuming 63!\n");
|
||||
}
|
||||
|
||||
if (!(driveParam->descflags & DF_LBA))
|
||||
@ -819,10 +819,13 @@ void print_warning_suspect(char *partitionName, UBYTE fs, struct CHS *chs,
|
||||
{
|
||||
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");
|
||||
if (InitKernelConfig.Verbose >= 0)
|
||||
{
|
||||
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));
|
||||
}
|
||||
@ -1386,7 +1389,7 @@ void ReadAllPartitionTables(void)
|
||||
/* disk initialization: returns number of units */
|
||||
COUNT dsk_init()
|
||||
{
|
||||
printf(" - InitDisk");
|
||||
if (InitKernelConfig.Verbose >= 0) printf(" - InitDisk");
|
||||
|
||||
#if defined(DEBUG) && !defined(DOSEMU)
|
||||
{
|
||||
|
@ -77,7 +77,8 @@ Version_Major db 2
|
||||
Version_Revision dw 43 ; REVISION_SEQ
|
||||
Version_Release dw 1 ; 0=release build, >0=svn#
|
||||
|
||||
CheckDebugger: db 0 ; 0 = no check, 1 = check, 2 = assume present
|
||||
CheckDebugger: db 0 ; 0 = no check, 1 = check, 2 = assume present
|
||||
Verbose db -1 ; -1 = quiet, 0 = normal, 1 = verbose
|
||||
configend:
|
||||
kernel_config_size: equ configend - config_signature
|
||||
; must be below-or-equal the size of struct _KernelConfig
|
||||
@ -118,6 +119,7 @@ realentry: ; execution continues here
|
||||
|
||||
times 0C0h - ($ - $$) nop ; magic offset (used by exeflat)
|
||||
entry_common:
|
||||
%ifndef QUIET
|
||||
push ax
|
||||
push bx
|
||||
pushf
|
||||
@ -127,6 +129,7 @@ entry_common:
|
||||
popf
|
||||
pop bx
|
||||
pop ax
|
||||
%endif
|
||||
|
||||
push cs
|
||||
pop ds
|
||||
@ -165,6 +168,7 @@ segment INIT_TEXT
|
||||
kernel_start:
|
||||
cld
|
||||
|
||||
%ifndef QUIET
|
||||
push bx
|
||||
pushf
|
||||
mov ax, 0e32h ; '2' Tracecode - kernel entered
|
||||
@ -172,6 +176,7 @@ kernel_start:
|
||||
int 010h
|
||||
popf
|
||||
pop bx
|
||||
%endif
|
||||
|
||||
|
||||
extern _kernel_command_line
|
||||
@ -275,6 +280,7 @@ cont: ; Now set up call frame
|
||||
mov ds,[cs:_INIT_DGROUP]
|
||||
mov bp,sp ; and set up stack frame for c
|
||||
|
||||
%ifndef QUIET
|
||||
push bx
|
||||
pushf
|
||||
mov ax, 0e33h ; '3' Tracecode - kernel entered
|
||||
@ -282,6 +288,7 @@ cont: ; Now set up call frame
|
||||
int 010h
|
||||
popf
|
||||
pop bx
|
||||
%endif
|
||||
|
||||
mov byte [_BootDrive],bl ; tell where we came from
|
||||
|
||||
|
@ -437,6 +437,17 @@ STATIC VOID FsConfig(VOID)
|
||||
|
||||
STATIC VOID signon()
|
||||
{
|
||||
if (InitKernelConfig.Verbose < 0)
|
||||
{
|
||||
#ifdef CUSTOM_BRANDING
|
||||
printf("\n\r" CUSTOM_BRANDING "\n\n");
|
||||
#else
|
||||
printf("\n\r%S\n\n", MK_FP(FP_SEG(LoL), FP_OFF(LoL->os_release)));
|
||||
#endif
|
||||
} else {
|
||||
#ifdef CUSTOM_BRANDING
|
||||
printf("\n\r" CUSTOM_BRANDING "\n\n%s", copyright);
|
||||
#else
|
||||
printf("\r%S"
|
||||
"Kernel compatibility %d.%d - "
|
||||
#if defined(__BORLANDC__)
|
||||
@ -465,6 +476,8 @@ STATIC VOID signon()
|
||||
"\n\n%s",
|
||||
MK_FP(FP_SEG(LoL), FP_OFF(LoL->os_release)),
|
||||
MAJOR_RELEASE, MINOR_RELEASE, copyright);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
STATIC void kernel()
|
||||
|
@ -13,7 +13,7 @@
|
||||
* merged into SYS by tom ehlert *
|
||||
***************************************************************************/
|
||||
|
||||
char VERSION[] = "v1.03";
|
||||
char VERSION[] = "v1.04";
|
||||
char PROGRAM[] = "SYS CONFIG";
|
||||
char KERNEL[] = "KERNEL.SYS";
|
||||
|
||||
@ -94,7 +94,9 @@ void showUsage(void)
|
||||
" SKIPCONFIGSECONDS=#, FORCELBA=0|1\n"
|
||||
" GLOBALENABLELBASUPPORT=0|1\n"
|
||||
" BootHarddiskSeconds=0|seconds to wait\n"
|
||||
" CheckDebugger=0|1|2\n");
|
||||
" CheckDebugger=0|1|2\n"
|
||||
" Verbose=0|1\n"
|
||||
);
|
||||
}
|
||||
|
||||
/* simply reads in current configuration values, exiting program
|
||||
@ -223,6 +225,13 @@ void displayConfigSettings(KernelConfig * cfg)
|
||||
cfg->CheckDebugger);
|
||||
}
|
||||
|
||||
if (cfg->ConfigSize >= 14)
|
||||
{
|
||||
printf
|
||||
("Verbose=%d : -1=quiet, *0=normal, 1=verbose\n",
|
||||
cfg->Verbose);
|
||||
}
|
||||
|
||||
#if 0 /* we assume that SYS is as current as the kernel */
|
||||
|
||||
/* Print value any options added that are unknown as hex dump */
|
||||
@ -495,6 +504,11 @@ int FDKrnConfigMain(int argc, char **argv)
|
||||
setByteOption(&(cfg.CheckDebugger),
|
||||
cptr, 2, &updates, "CheckDebugger");
|
||||
}
|
||||
else if (memicmp(argptr, "VERBOSE", 3) == 0)
|
||||
{
|
||||
setSByteOption(&(cfg.Verbose),
|
||||
cptr, -1, 1, &updates, "VERBOSE");
|
||||
}
|
||||
else
|
||||
{
|
||||
illegal_arg:
|
||||
|
Loading…
Reference in New Issue
Block a user