From 1ce349ef26e4dff322a2a9d67af4c34fe63c28d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20Wilhelm=20B=C3=B6ckmann?= Date: Thu, 16 May 2024 22:49:17 +0200 Subject: [PATCH] fixes #148 --- kernel/config.c | 5 +---- kernel/main.c | 9 +++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel/config.c b/kernel/config.c index ddd9b764..a8ea9926 100644 --- a/kernel/config.c +++ b/kernel/config.c @@ -351,10 +351,7 @@ void PreConfig(void) #ifdef DEBUG /* printf("Preliminary %d buffers allocated at 0x%p\n", Config.cfgBuffers, buffers);*/ #endif - - LoL->DPBp = - DynAlloc("DPBp", blk_dev.dh_name[0], sizeof(struct dpb)); - + LoL->sfthead = MK_FP(FP_SEG(LoL), 0xcc); /* &(LoL->firstsftt) */ /* LoL->FCBp = (sfttbl FAR *)&FcbSft; */ /* LoL->FCBp = (sfttbl FAR *) diff --git a/kernel/main.c b/kernel/main.c index e846e799..f2a61e02 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -547,8 +547,13 @@ STATIC VOID update_dcb(struct dhdr FAR * dhp) if (nunits == 0) return; /* allocate memory for new device control blocks, insert into chain [at end], and update our pointer to new end */ - dpb = (struct dpb FAR *)KernelAlloc(nunits * sizeof(struct dpb), 'E', Config.cfgDosDataUmb); - + if ( LoL->first_mcb ) { + dpb = (struct dpb FAR *)KernelAlloc(nunits * sizeof(struct dpb), 'E', Config.cfgDosDataUmb); + } + else { + dpb = DynAlloc("DPBp", blk_dev.dh_name[0], sizeof(struct dpb)); + } + /* find end of dpb chain or initialize root if needed */ if (LoL->nblkdev == 0) {