RAM.C   A non-compressing ram drive for Beos 4.5 - 5.03
CAM.C   A very simple (bytes == 0) compressing ram drive for Beos 4.5 - 5.03

Version 6.00 These versions combines Carlos working code and my additions to hopefully make better drivers.

First, there is now a code fork. RAM.C is a non-compressing drive. As you add files it uses more memory,
but if you delete the files in the drive the memory is not freed up. This memory will be re-used however,
if more files are again written to the drive.

CAM.C is a compressing drive. As tracks are being written to, all instances of 256 zero bytes in a row 
will be replace with a single zero byte. Otherwise a non-zero byte followed with 256 data bytes.

In both drivers a read to an un-allocated track will not use up memory, it is freed up as soon as the
reading of that track is done. In both drivers the code is written to be as fast as possible in the
present style of code.  Expect future versions to used very dense coding for more speed.

I have removed all debugging code to make the code as fast amd small as possible.
I have set the default size to 64 Megabytes, you can make it bigger if you wish.

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+  Extra Notes  +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

From Carlos Hasan: To test the driver, copy the binary to
 ~/config/add-ons/kernel/drivers/bin/ramdrive, and make a link in
 ~/config/add-ons/kernel/drivers/dev/disk/virtual/.

Btw, if you don't have another PC to debug the driver through the serial line and dprintf(), do the following:

- Press F1 when you boot BeOS, and enable the output console
- Open a Terminal window and type:

	tail -f /var/log/syslog

You will see the messages printed with dprintf() in your Terminal.

+=+=+=+=+=+=+=+=+=+=+=+=+=+  Additional notes from E.C.P. --  IT WORKS GREAT NOW !  +=+=+=+=+=+=+=+=+=+=+=+=+=+

How to get it to partition and work with 16MB and greater.  The compiler will place the binary in the directory
~/config/add-ons/kernel/drivers/bin/ as per Carlos Hasan's instructions.  However, the name of the file has been
changed to "ram", as when I use "ramdisk" as the file name I found that DriveSetup kept seeing a drive called
"ram"!   So I decide to go along with DriveSetup and give a drive named "ram".

In ~/config/add-ons/kernel/drivers/dev/disk/virtual/ I created a link to the binary also called "ram".  Then when
you use the DriveSetup you will find a entry for the ramdrive called "ram" and partition it.  Then initilize the
partition.  It should work fine. 

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+  Additional notes for CRAM DRIVE  +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

The compressed version is called CAM, for some reason it can not exist at the same time the RAM drive is
installed. Follow the same instructions for the "ram" drive, but use "cam" instead.  This drive has very
poor compression, it is a test that compression can be added to the code.  I expect better compressors in
the future.

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+  Last notes for both drives +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

If you wish a larger ram drive, increase the value of RAM_SECTORS.  Do not change RAM_BLOCK_SIZE as that causes
strange problems during setup.

                              Earl Colby Pottinger

