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