Hi!

29-Мар-2004 21:05 [EMAIL PROTECTED] (Bernd Blaauw) wrote to
[EMAIL PROTECTED]:

>>      Wrong.
BB> it was a proposed algorythm for a patch.

     From your letter I suggest that you try explain how you understand how
it works.

BB> since YOUR patch assumes 6 buffers minimum,

     No, my patch _allows_ to allocate less than 20 buffers (but not less
than 6, as it is/was be).

BB> I thought I could use that as a minimum amount
BB> (instead of allowing "buffers=1" )

     Currently, there is allowed to allocate only one buffer by buffers=-1.
Of course, this is bug, and without my patch kernel tries to deallocate all
buffers for INT 2F/4A02. (I already enumerate all related bugs, which fixes
my patch).

BB> that would explain my algorythm:
BB> *HMA must have space to store the minimum amount of 6 YOU mentioned.

     This limit was selected before me.

BB> *requested number of buffers must be at least this minimum. (6<=N)
BB> *request number of buffers must fit in free HMA (N<=M)

     With my patch, if requested buffers not fit into HMA, they allocated in
lower memory. And I don't see the reason, why we should cut value, requested
by user - if by some reason he wants 80 buffers, kernel shouldn't limit
buffers by 27 (current value of buffers in HMA).

BB> *number of requested buffers must be below 100, as 99 is the maximum.
if{M>>=6}
BB> {
BB>    if(6<=N<=M<100) --> mark N buffers as used
BB>                        after marking, fill HMA with N=min(M,99) buffers //
BB> fill up until full or
BB>                        99 reached.
BB> }

     Let me quote my patch:

______________O\_/_________________________________\_/O______________
unsigned buffers = 0;

/* fill HMA with buffers if BUFFERS count >=0 and DOS in HMA          */
if (wantedbuffers < 0)
    wantedbuffers = -wantedbuffers;
else if (HMAState == HMA_DONE)
  buffers = (0xFFF0 - HMAFree) / sizeof (struct buffer);

if (wantedbuffers < 6)                /* min 6 buffers                */
    wantedbuffers = 6;
if (wantedbuffers > 99)               /* max 99 buffers               */
{
  printf("BUFFERS=%u not supported, reducing to 99\n", wantedbuffers);
  wantedbuffers = 99;
}

if (buffers < wantedbuffers)          /* not less than requested      */
    buffers = wantedbuffers;
LoL->nbuffers = buffers;
_____________________________________________________________________
              O/~\                                 /~\O

BB> if any of above conditions fail, buffers are stored in conventional memory.
BB> and that explains my use of "-" (negative value)

     In current case (also as with my patch) negative value used only to
prevent buffer count expansion (to fill rest of HMA).

BB> Tom said the requested number of buffers are marked as "used" in HMA,

     They are _not_ marked as "used" - there is pointer into HMA, which
points to Nth buffer in buffers array. Memory after this pointer may be
later reused for INT 2F/4A01 - for this all buffers, which intersects with
requested ared will be removed from chain. My patch changes (fixes) the
pointer behavior: now it always points to HMA (if present), even if buffers
are in lower memory; this allows to reuse rest of HMA notwithstanding
buffers placement.

BB> and that the ones used for filling up could be used for a (non-existing..)
BB> HMA-using program instead.

     I repeat again: memory, allocated for buffers over requested count,
later may be removed to make memory available for INT 2F/4A02.

     Because there are no function to release memory (by application), this
memory should be allocated for permanent needings (ie., for TSR). Currently
I know only one TSR, which uses HMA for its needings (so, tom is wrong when
says that such TSR are non-existing).




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to