RAMFS64 - returns 64 MB as free space
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you haven't done already, you should get the original RAMFS archive,
this includes the normal documentation and the source code.
See also README.TXT in the original RAMFS archive.

This version of RAMFS.IFS is named RAMFS64.IFS to distuingish this one from
the original version. You can rename RAMFS64.IFS into RAMFS.IFS if you want.

Eddy Thilleman has created this archive, but this version of RAMFS.IFS is
created by the author Karl Olsen.


Files in RAMFS64.ZIP
~~~~~~~~~~~~~~~~~~~~
RAMFS64.TXT - this file
RAMFS64.IFS - The Installable File System which returns 64 MB free space
RAMDISK.EXE - Utility to create RAM disk drives (original version)


Author: Karl Olsen
Email : kro@post3.tele.dk
WWW   : home3.inet.tele.dk/kro


The 64 MB is a fixed value.  (It isn't easy to get the amount of free
virtual memory from a ring-0 file system.)

When an application creates (or grows) a file on a RAMFS drive, RAMFS.IFS
allocates some swappable memory from OS/2.  If this allocation fails, then
RAMFS.IFS returns a "disk full" error code to the application.  This
mechanism has nothing to do with the value returned when an application asks
for the amount of free disk space (which now is 64 MB).  So theoretically
there is no risk involved in returning an arbitrary value for the free disk
space.

Badly written applications might fail to check the return values from file
write operations if they have just found out that there is plenty of free
space.  Applications should of course always check the return codes from all
system calls.

And what happens when OS/2 runs out of physical memory and disk swap space?
I am not sure that it checks the free space on the swap drive when virtual
memory is allocated.  It would then have to enforce that there always is at
least as much free space on the swap drive as the amount of virtual memory
that could potentially need to be swapped out.  And consequently it would
have to return "disk full" to applications that tried to create files on the
swap drive if that would cause the free space to drop below the enforced
minimum.  I don't think that OS/2 does this.

So practically, I think that you should be careful about exhausting virtual
memory.  When you experiment about what happens when you try to fill a RAMFS
drive, don't have important unsaved data in open applications :-)

Regards,
Karl Olsen

