I am currently trying to throw together a DOS-clone system (to be used
as an advanced bootloader, eventually), but have run into a delimma
working with MCBs. It appears to me through the documents I've read
that when an allocation request is made, DOS scans each memory control
block based on the currently selected allocation semantic (First-Fit,
Best-Fit, Last-Fit). The questions I have are this:
- On initialization of the kernel (*DOS.SYS), how many MCBs are generated? I intended to only pre-create 1, but another question makes
me apprehensive about doing so. If the current allocation mode is first
or last fit, an allocation call would consume the entire free
conventional memory area. Would a mcb-splitting procedure be in order?
Or would it be better to pre-create a number of mcb's, splitting
conventional memory into 64KB (or whatever) blocks right from the get
go?
- When using first or best fit allocation methods, I can determine
where the next mcb in memory is by the summation (mcb segment + number
of paragraphs allocated). But when it comes to last-fit (working from
the last mcb to the first), I don't understand how one would determine
where the previous mcb is in memory. I was thinking of using a portion
of the reserved mcb header area to maintain a link of the previous mcb.
Is this the method DOS uses, or does DOS actually keep record of memory
allocations elsewhere (seems redundant)?
Any help on this would be greatly appreciated.
Thanks,
John
DOS Memory Control Block question
RE:DOS Memory Control Block question
you get one huge mcb, when something is allocted, that size is allocated and the mcb is split. mcbs are as basic as it gets, and work very well since its just a quick linked list.
-- Stu --