30
30
#include "portab.h"
31
31
#include "init-mod.h"
32
32
#include "dyndata.h"
33
+ #include "debug.h"
33
34
34
35
35
- #ifdef DEBUG
36
- #define DebugPrintf (x ) printf x
37
- #else
38
- #define DebugPrintf (x )
39
- #endif
40
36
#define para2far (seg ) ((mcb FAR *)MK_FP((seg), 0))
41
37
42
38
/**
@@ -338,7 +334,7 @@ void PreConfig(void)
338
334
{
339
335
/* Initialize the base memory pointers */
340
336
341
- DebugPrintf (("SDA located at 0x%p\n" , internal_data ));
337
+ CfgDbgPrintf (("SDA located at 0x%p\n" , internal_data ));
342
338
/* Begin by initializing our system buffers */
343
339
/* DebugPrintf(("Preliminary %d buffers allocated at 0x%p\n", Config.cfgBuffers, buffers));*/
344
340
@@ -352,14 +348,14 @@ void PreConfig(void)
352
348
353
349
LoL -> CDSp = KernelAlloc (sizeof (struct cds ) * LoL -> lastdrive , 'L' , 0 );
354
350
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 ));
359
355
360
356
/* Done. Now initialize the MCB structure */
361
357
/* 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 ));
363
359
}
364
360
365
361
/* Do second pass initialization: near allocation and MCBs */
@@ -425,7 +421,7 @@ void PostConfig(void)
425
421
if (LoL -> lastdrive < LoL -> nblkdev )
426
422
LoL -> lastdrive = LoL -> nblkdev ;
427
423
428
- DebugPrintf (("starting FAR allocations at %x\n" , base_seg ));
424
+ CfgDbgPrintf (("starting FAR allocations at %x\n" , base_seg ));
429
425
430
426
/* Begin by initializing our system buffers */
431
427
/* dma_scratch = (BYTE FAR *) KernelAllocDma(BUFFERSIZE); */
@@ -446,10 +442,10 @@ void PostConfig(void)
446
442
447
443
LoL -> CDSp = KernelAlloc (sizeof (struct cds ) * LoL -> lastdrive , 'L' , Config .cfgLastdriveHigh );
448
444
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 ));
453
449
454
450
if (Config .cfgStacks )
455
451
{
@@ -458,9 +454,9 @@ void PostConfig(void)
458
454
Config .cfgStacksHigh );
459
455
init_stacks (stackBase , Config .cfgStacks , Config .cfgStackSize );
460
456
461
- DebugPrintf (("Stacks allocated at %p\n" , stackBase ));
457
+ CfgDbgPrintf (("Stacks allocated at %p\n" , stackBase ));
462
458
}
463
- DebugPrintf (("Allocation completed: top at 0x%x\n" , base_seg ));
459
+ CfgDbgPrintf (("Allocation completed: top at 0x%x\n" , base_seg ));
464
460
465
461
}
466
462
@@ -483,12 +479,12 @@ VOID configDone(VOID)
483
479
p -> m_name [1 ] = 'C' ;
484
480
p -> m_psp = 8 ;
485
481
486
- DebugPrintf (("HMA not available, moving text to %x\n" , kernel_seg ));
482
+ CfgDbgPrintf (("HMA not available, moving text to %x\n" , kernel_seg ));
487
483
MoveKernel (kernel_seg );
488
484
489
485
kernel_seg += hma_paras + 1 ;
490
486
491
- DebugPrintf (("kernel is low, start alloc at %x" , kernel_seg ));
487
+ CfgDbgPrintf (("kernel is low, start alloc at %x\n " , kernel_seg ));
492
488
}
493
489
494
490
/* The standard handles should be reopened here, because
@@ -590,7 +586,7 @@ STATIC void umb_init(void)
590
586
}
591
587
para2far (umb_max )-> m_size ++ ;
592
588
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 ));
594
590
}
595
591
}
596
592
@@ -830,11 +826,11 @@ VOID DoConfig(int nPass)
830
826
if (mdsk != NULL )
831
827
{
832
828
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 ));
834
830
}
835
831
else
836
832
{
837
- DebugPrintf (("MEMDISK not detected!\n" ));
833
+ CfgDbgPrintf (("MEMDISK not detected!\n" ));
838
834
}
839
835
#endif
840
836
}
@@ -871,10 +867,10 @@ VOID DoConfig(int nPass)
871
867
for (ii = 0 ; configcommands [ii ].pointer != NULL ; ++ ii ) {
872
868
if (* * configcommands [ii ].pointer != '\0' ) {
873
869
if ((nFileDesc = open (* configcommands [ii ].pointer , 0 )) >= 0 ) {
874
- DebugPrintf (("Reading \"%s\"...\n" , * configcommands [ii ].pointer ));
870
+ CfgDbgPrintf (("Reading \"%s\"...\n" , * configcommands [ii ].pointer ));
875
871
break ;
876
872
} else {
877
- DebugPrintf (("\"%s\" not found\n" , * configcommands [ii ].pointer ));
873
+ CfgDbgPrintf (("\"%s\" not found\n" , * configcommands [ii ].pointer ));
878
874
}
879
875
}
880
876
}
@@ -955,7 +951,7 @@ VOID DoConfig(int nPass)
955
951
continue ;
956
952
}
957
953
958
- DebugPrintf (("CONFIG=[%s]\n" , szLine ));
954
+ CfgDbgPrintf (("CONFIG=[%s]\n" , szLine ));
959
955
960
956
/* Skip leading white space and get verb. */
961
957
pLine = scan (szLine , szBuf , 1 );
@@ -1828,7 +1824,7 @@ STATIC BOOL LoadDevice(BYTE * pLine, char FAR *top, COUNT mode)
1828
1824
/* The device driver is paragraph aligned. */
1829
1825
eb .load .reloc = eb .load .load_seg = base ;
1830
1826
1831
- DebugPrintf (("Loading device driver %s at segment %04x\n" , szBuf , base ));
1827
+ CfgDbgPrintf (("Loading device driver %s at segment %04x\n" , szBuf , base ));
1832
1828
1833
1829
if ((result = init_DosExec (3 , & eb , szBuf )) != SUCCESS )
1834
1830
{
@@ -1923,7 +1919,7 @@ void FAR * KernelAllocPara(size_t nPara, char type, char *name, int mode)
1923
1919
}
1924
1920
1925
1921
/* 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 ));
1927
1923
1928
1924
if (base == start )
1929
1925
{
@@ -2178,8 +2174,8 @@ STATIC void config_init_buffers(int wantedbuffers)
2178
2174
LoL -> deblock_buf = DiskTransferBuffer ;
2179
2175
LoL -> firstbuf = pbuffer ;
2180
2176
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 ));
2183
2179
2184
2180
buffers -- ;
2185
2181
pbuffer -> b_prev = FP_OFF (pbuffer + buffers );
@@ -2201,7 +2197,7 @@ STATIC void config_init_buffers(int wantedbuffers)
2201
2197
but not if the BUFFERS count is negative ;-)
2202
2198
*/
2203
2199
2204
- DebugPrintf ((" done\n" ));
2200
+ CfgDbgPrintf ((" done\n" ));
2205
2201
2206
2202
if (FP_SEG (pbuffer ) == 0xffff )
2207
2203
{
0 commit comments