3030#include "portab.h"
3131#include "init-mod.h"
3232#include "dyndata.h"
33+ #include "debug.h"
3334
3435
35- #ifdef DEBUG
36- #define DebugPrintf (x ) printf x
37- #else
38- #define DebugPrintf (x )
39- #endif
4036#define para2far (seg ) ((mcb FAR *)MK_FP((seg), 0))
4137
4238/**
@@ -338,7 +334,7 @@ void PreConfig(void)
338334{
339335 /* Initialize the base memory pointers */
340336
341- DebugPrintf (("SDA located at 0x%p\n" , internal_data ));
337+ CfgDbgPrintf (("SDA located at 0x%p\n" , internal_data ));
342338 /* Begin by initializing our system buffers */
343339 /* DebugPrintf(("Preliminary %d buffers allocated at 0x%p\n", Config.cfgBuffers, buffers));*/
344340
@@ -352,14 +348,14 @@ void PreConfig(void)
352348
353349 LoL -> CDSp = KernelAlloc (sizeof (struct cds ) * LoL -> lastdrive , 'L' , 0 );
354350
355- /* DebugPrintf ((" FCB table 0x%p\n",LoL->FCBp));*/
356- DebugPrintf ((" sft table 0x%p\n" , LoL -> sfthead ));
357- DebugPrintf ((" CDS table 0x%p\n" , LoL -> CDSp ));
358- DebugPrintf ((" DPB table 0x%p\n" , LoL -> DPBp ));
351+ /* CfgDbgPrintf ((" FCB table 0x%p\n",LoL->FCBp));*/
352+ CfgDbgPrintf ((" sft table 0x%p\n" , LoL -> sfthead ));
353+ CfgDbgPrintf ((" CDS table 0x%p\n" , LoL -> CDSp ));
354+ CfgDbgPrintf ((" DPB table 0x%p\n" , LoL -> DPBp ));
359355
360356 /* Done. Now initialize the MCB structure */
361357 /* This next line is 8086 and 80x86 real mode specific */
362- DebugPrintf (("Preliminary allocation completed: top at %p\n" , lpTop ));
358+ CfgDbgPrintf (("Preliminary allocation completed: top at %p\n" , lpTop ));
363359}
364360
365361/* Do second pass initialization: near allocation and MCBs */
@@ -425,7 +421,7 @@ void PostConfig(void)
425421 if (LoL -> lastdrive < LoL -> nblkdev )
426422 LoL -> lastdrive = LoL -> nblkdev ;
427423
428- DebugPrintf (("starting FAR allocations at %x\n" , base_seg ));
424+ CfgDbgPrintf (("starting FAR allocations at %x\n" , base_seg ));
429425
430426 /* Begin by initializing our system buffers */
431427 /* dma_scratch = (BYTE FAR *) KernelAllocDma(BUFFERSIZE); */
@@ -446,10 +442,10 @@ void PostConfig(void)
446442
447443 LoL -> CDSp = KernelAlloc (sizeof (struct cds ) * LoL -> lastdrive , 'L' , Config .cfgLastdriveHigh );
448444
449- /* DebugPrintf ((" FCB table 0x%p\n",LoL->FCBp));*/
450- DebugPrintf ((" sft table 0x%p\n" , LoL -> sfthead -> sftt_next ));
451- DebugPrintf ((" CDS table 0x%p\n" , LoL -> CDSp ));
452- DebugPrintf ((" DPB table 0x%p\n" , LoL -> DPBp ));
445+ /* CfgDbgPrintf ((" FCB table 0x%p\n",LoL->FCBp));*/
446+ CfgDbgPrintf ((" sft table 0x%p\n" , LoL -> sfthead -> sftt_next ));
447+ CfgDbgPrintf ((" CDS table 0x%p\n" , LoL -> CDSp ));
448+ CfgDbgPrintf ((" DPB table 0x%p\n" , LoL -> DPBp ));
453449
454450 if (Config .cfgStacks )
455451 {
@@ -458,9 +454,9 @@ void PostConfig(void)
458454 Config .cfgStacksHigh );
459455 init_stacks (stackBase , Config .cfgStacks , Config .cfgStackSize );
460456
461- DebugPrintf (("Stacks allocated at %p\n" , stackBase ));
457+ CfgDbgPrintf (("Stacks allocated at %p\n" , stackBase ));
462458 }
463- DebugPrintf (("Allocation completed: top at 0x%x\n" , base_seg ));
459+ CfgDbgPrintf (("Allocation completed: top at 0x%x\n" , base_seg ));
464460
465461}
466462
@@ -483,12 +479,12 @@ VOID configDone(VOID)
483479 p -> m_name [1 ] = 'C' ;
484480 p -> m_psp = 8 ;
485481
486- DebugPrintf (("HMA not available, moving text to %x\n" , kernel_seg ));
482+ CfgDbgPrintf (("HMA not available, moving text to %x\n" , kernel_seg ));
487483 MoveKernel (kernel_seg );
488484
489485 kernel_seg += hma_paras + 1 ;
490486
491- DebugPrintf (("kernel is low, start alloc at %x" , kernel_seg ));
487+ CfgDbgPrintf (("kernel is low, start alloc at %x\n " , kernel_seg ));
492488 }
493489
494490 /* The standard handles should be reopened here, because
@@ -590,7 +586,7 @@ STATIC void umb_init(void)
590586 }
591587 para2far (umb_max )-> m_size ++ ;
592588 para2far (umb_max )-> m_type = MCB_LAST ;
593- DebugPrintf (("UMB Allocation completed: start at 0x%x\n" , umb_base_seg ));
589+ CfgDbgPrintf (("UMB Allocation completed: start at 0x%x\n" , umb_base_seg ));
594590 }
595591}
596592
@@ -830,11 +826,11 @@ VOID DoConfig(int nPass)
830826 if (mdsk != NULL )
831827 {
832828 printf ("MEMDISK version %u.%02u (%lu sectors)\n" , mdsk -> version , mdsk -> version_minor , mdsk -> size );
833- DebugPrintf (("MEMDISK args:{%S}\n" , mdsk -> cmdline ));
829+ CfgDbgPrintf (("MEMDISK args:{%S}\n" , mdsk -> cmdline ));
834830 }
835831 else
836832 {
837- DebugPrintf (("MEMDISK not detected!\n" ));
833+ CfgDbgPrintf (("MEMDISK not detected!\n" ));
838834 }
839835#endif
840836 }
@@ -871,10 +867,10 @@ VOID DoConfig(int nPass)
871867 for (ii = 0 ; configcommands [ii ].pointer != NULL ; ++ ii ) {
872868 if (* * configcommands [ii ].pointer != '\0' ) {
873869 if ((nFileDesc = open (* configcommands [ii ].pointer , 0 )) >= 0 ) {
874- DebugPrintf (("Reading \"%s\"...\n" , * configcommands [ii ].pointer ));
870+ CfgDbgPrintf (("Reading \"%s\"...\n" , * configcommands [ii ].pointer ));
875871 break ;
876872 } else {
877- DebugPrintf (("\"%s\" not found\n" , * configcommands [ii ].pointer ));
873+ CfgDbgPrintf (("\"%s\" not found\n" , * configcommands [ii ].pointer ));
878874 }
879875 }
880876 }
@@ -955,7 +951,7 @@ VOID DoConfig(int nPass)
955951 continue ;
956952 }
957953
958- DebugPrintf (("CONFIG=[%s]\n" , szLine ));
954+ CfgDbgPrintf (("CONFIG=[%s]\n" , szLine ));
959955
960956 /* Skip leading white space and get verb. */
961957 pLine = scan (szLine , szBuf , 1 );
@@ -1828,7 +1824,7 @@ STATIC BOOL LoadDevice(BYTE * pLine, char FAR *top, COUNT mode)
18281824 /* The device driver is paragraph aligned. */
18291825 eb .load .reloc = eb .load .load_seg = base ;
18301826
1831- DebugPrintf (("Loading device driver %s at segment %04x\n" , szBuf , base ));
1827+ CfgDbgPrintf (("Loading device driver %s at segment %04x\n" , szBuf , base ));
18321828
18331829 if ((result = init_DosExec (3 , & eb , szBuf )) != SUCCESS )
18341830 {
@@ -1923,7 +1919,7 @@ void FAR * KernelAllocPara(size_t nPara, char type, char *name, int mode)
19231919 }
19241920
19251921 /* create the special DOS data MCB if it doesn't exist yet */
1926- DebugPrintf (("kernelallocpara: %x %x %x %c %d\n" , start , base , nPara , type , mode ));
1922+ CfgDbgPrintf (("kernelallocpara: %x %x %x %c %d\n" , start , base , nPara , type , mode ));
19271923
19281924 if (base == start )
19291925 {
@@ -2178,8 +2174,8 @@ STATIC void config_init_buffers(int wantedbuffers)
21782174 LoL -> deblock_buf = DiskTransferBuffer ;
21792175 LoL -> firstbuf = pbuffer ;
21802176
2181- DebugPrintf (("init_buffers (size %u) at" , sizeof (struct buffer )));
2182- DebugPrintf ((" (%p)" , LoL -> firstbuf ));
2177+ CfgDbgPrintf (("init_buffers (size %u) at" , sizeof (struct buffer )));
2178+ CfgDbgPrintf ((" (%p)" , LoL -> firstbuf ));
21832179
21842180 buffers -- ;
21852181 pbuffer -> b_prev = FP_OFF (pbuffer + buffers );
@@ -2201,7 +2197,7 @@ STATIC void config_init_buffers(int wantedbuffers)
22012197 but not if the BUFFERS count is negative ;-)
22022198 */
22032199
2204- DebugPrintf ((" done\n" ));
2200+ CfgDbgPrintf ((" done\n" ));
22052201
22062202 if (FP_SEG (pbuffer ) == 0xffff )
22072203 {
0 commit comments