-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
The message "MCB chain corrupt, or MS-DOS incompatible system." is displayed on attempts to use LH on a recent lDOS kernel.
With this patch it works:
diff --git a/shell/loadhigh.c b/shell/loadhigh.c
index 81340ec..49d4c37 100644
--- a/shell/loadhigh.c
+++ b/shell/loadhigh.c
@@ -422,7 +422,7 @@ static int loadhigh_prepare(void)
/* Set the UMB link and malloc strategy */
dosSetUMBLinkState(1);
- dosSetAllocStrategy(0);
+ dosSetAllocStrategy(0x80);
if ((availBlock = malloc(256 * sizeof(*availBlock))) == 0)
return err_out_of_memory;
@@ -462,8 +462,10 @@ static int loadhigh_prepare(void)
/* Found a free memory block: allocate it */
word bl = DosAlloc(mcb->mcb_size);
- if (bl != FP_SEG(mcb) + 1) /* Did we get the block we wanted? */
+ if (bl != FP_SEG(mcb) + 1) /* Did we get the block we wanted? */ {
+ printf("bl = %04X, mcb = %04X\n", bl, FP_SEG(mcb));
return err_mcb_chain;
+ }
if (region->access) /* /L option allows access to this region */
{
@@ -540,6 +542,7 @@ static int loadfix_prepare(void)
if (bl != FP_SEG(mcb) + 1) /* Did we get the block we wanted? */
{
+ printf("bl = %04X, mcb = %04X\n", bl, FP_SEG(mcb));
return err_mcb_chain;
}
Without the line 422 hunk the debug message that I added to loadhigh_prepare (line 462 hunk) is displayed so that seems to be where the error code is generated.
I don't see how with a strategy of 0 ("LMA then UMA, as one area") the allocation should occur in the UMA first as this code expects. I will have to study the FreeDOS kernel to see whether it behaves differently.
Metadata
Metadata
Assignees
Labels
No labels