[haiku-development] Re: Writing Device Drivers - CRAM - Problem Malloc()

  • From: Earl Pottinger <earl_colby_pottinger@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 23 Aug 2011 06:07:21 -0700 (PDT)

> From: Travis Geiselbrecht <geist@xxxxxxxxxx>

> Really, the general solution to ramdisks like this on most
> oses are not to permanently map the array into kernel space,
> but to directly allocate from the physical page allocator
> and track the pages yourself, and map them on demand.

And that is why I am already asking questions about malloc().

Only version 0.1x and 0.2x use a single block image of the ramdisk. All of the 
later version allocate data_tracks from a common memory pool as they are needed.

And yes the code to copy data_tracks to external storage and free up the memory 
space is already written and work.  My problem right now in that area if 
balancing when and what data_tracks to flush.

PS. The reason I use the term data_track vs pages is that in most uses pages 
are 1K-8K in size, data_tracks are closer to 64K-8M in size.  This cuts down on 
the number of structures I have to keep track of.

Other related posts: