[Coco] NitrOS-9 GET/PUT buffer questions

gene heskett gheskett at wdtv.com
Sun Mar 18 05:07:25 EDT 2012


On Sunday, March 18, 2012 05:03:06 AM Lothan did opine:

> From: Boisy G. Pitre
> Sent: Saturday, March 17, 2012 11:46 PM
> To: CoCoList for Color Computer Enthusiasts
> Subject: Re: [Coco] NitrOS-9 GET/PUT buffer questions
> 
> > GrfDrv is in charge of this I believe, and memory for GP buffers are
> > allocated and managed by it, I believe.  I don't think the memory
> > for these comes from the >OS's 64K address space.
> 
> If I'm reading the code correctly, it looks as if CoWin verifies and
> stores the group/buffer numbers and then hands off all remaining logic
> to GrfDrv.
> 
> On the initial call to DefGBP, GrfDrv calls F$AllRAM to allocate the
> requested space rounded up in 8K chunk for the initial buffers.
> Effectively, this means requesting a 32-byte buffer actually results in
> an 8K block being allocated. Subsequent calls to DefGPB are then stored
> in the preallocated block while sufficient unfragmented space is
> available. If there isn't sufficient unfragmented space available or
> the requested buffer size is larger than 8K, GrfDrv allocates another
> chunk rounded up to 8K.
> 
> The buffers are always rounded up in multiples of 32 bytes,which I
> imagine just makes it easier to manage tables tracking the buffer pool.
> Given the constrained space available, I suspect managing the order of
> allocating and deallocating the buffer is important to keep
> fragmentation to a minimum.
> 
> I don't remember whether F$AllRAM can be used to allocated memory in the
> user address space, though.
 
IIRC that is how I acquired ram in 8k blocks for myram.  Verify that by 
looking at the code though.  I believe that I also used F$DelRam to return 
it all to the memory pool when you deiniz /r0.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene>
Hear me, my chiefs, I am tired; my heart is sick and sad.  From where the
sun now stands I Will Fight No More Forever.
		-- Chief Joseph of the Nez Perce



More information about the Coco mailing list