[Coco] NitrOS-9 GET/PUT buffer questions

Lothan lothan at newsguy.com
Sun Mar 18 02:10:44 EDT 2012


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.




More information about the Coco mailing list