home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
ramfs102.zip
/
readme.txt
< prev
Wrap
Text File
|
2002-10-21
|
9KB
|
224 lines
RAMFS - an IFS-based RAM Disk for OS/2 - Version 1.02.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Foreword by Karl Olsen
~~~~~~~~~~~~~~~~~~~~~~
Some time ago I wanted to learn about Installable File Systems (IFSes) in OS/2,
so I wrote RAMFS, an IFS-based RAM disk.
RAMFS is freeware. Feel free to use it, and to get ideas from the source code
when you develop your own file systems. I developed RAMFS on OS/2 Warp 3.0,
and have seen it work on OS/2 Warp 4.0.
RAMFS is a "remote file system" (as opposed to a "local file system") meaning
that it isn't associated with a hard disk partition. Instead, drive letters
are created through OS/2 calls. OS/2 doesn't know the internal data format in
the file system - it only accesses the data through special file system
functions.
Files are stored in RAM. This means that the data are lost when the system is
rebooted. It is useful for holding temporary files - just let the TMP and
TEMP variables point to a RAMFS drive, and your temp directory is
automatically cleaned up at each boot.
Features
~~~~~~~~
o Create as many RAM drives as you want, using the drive letters that you
want
o Size only limited by available RAM and swap disk space
o Allocates swappable RAM from OS/2 as necessary when files are created, and
releases it again when files are deleted
o Long file name support like in HPFS. Case isn't significant, but preserved
like in HPFS. Files with long names are not visible from DOS and WINOS2
programs.
o Extended Attributes - up to 64 KB total for each file/directory
o Intelligent RAM allocation algorithm - variable-length clusters provide
greater performance yet less system resources
o 3DNow!<TM> performance optimizations for AMD Athlon processor as well as
the Duron and AMD K6-2/K6-III.
Non-features
~~~~~~~~~~~~
o Does not support file locking functions (DosSetFileLocks())
o Does not support the DosFindNotify...() functions. I have never seen OS/2
use these functions.
o Smaller files heavily consume system resources. For a typical OS/2
workstation, having more than 10000 files on RAMFS volume may lead to
premature exhaust of RAM handles.
Installation and use
~~~~~~~~~~~~~~~~~~~~
Add "IFS=d:\path\RAMFS.IFS" to CONFIG.SYS and reboot. During boot, it will
show a short version message.
Then, from an OS/2 prompt, use RAMDISK.EXE to create a RAM drive. To create a
drive R:, type "RAMDISK R:" To have a RAM drive created at every boot, you
can add "CALL=d:\path\RAMDISK R:" to CONFIG.SYS.
Advanced configuration
~~~~~~~~~~~~~~~~~~~~~~
The following parameters may be supplied to RAMFS.IFS entry in the
CONFIG.SYS:
o /Q = quiet initialization (suppresses the display of version notice)
o /S:<size> = preset the free space reported by RAMFS. Default is 64M,
however, if any applications complain about insufficient free space,
this parameter may be helpful. The default unit is bytes. Append the
value with 'K', 'M', 'G' or 'T' to scale accordingly. Examples:
/S:100000 = Report 100000 bytes (rounded down to 98304)
/S:355K = Report 355 kilobytes (rounded down to 352K)
/S:15M = Report 15 megabytes
/S:1G = Report 1 gigabyte
/S:1T = Report 1 terabyte
The granularity is 4K. Values above 2047M are not recommended (some
applications misinterpret larger values).
o /!3 = disable 3DNow!<TM>. Using the AMD 3DNow!<TM> instruction set
requires some modifications to the kernel code in memory. Use this
parameter if you experience any abnormal effects (none are known
so far).
o /3 = force 3DNow!<TM>. By default, if RAMFS fails to patch the
kernel, it disables the 3DNow!<TM> support regardless of your CPU
capabilities. You may enforce 3DNow!<TM> if you are unsure about
whether it has been enabled, and leave this option if nothing breaks.
Currently the 3DNow! initialization is deferred till the first use of
RAMFS drive, hence the user is unable to see it during boot.
Memory usage considerations
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The amount of free memory reported by RAMFS 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 can be controlled with the /S
parameter). 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 :-)
Source code
~~~~~~~~~~~
RAMFS.IFS was originally written in Borland C++ 3.1 and Turbo Assembler 3.1.
Yes, Borland C++ happily compiles 16-bit code for OS/2. Starting with
version 1.02, it has been migrated to IBM DDK environment (Microsoft C v
6.0). To rebuild DDK, register for it (it is free) at:
http://techsupport.services.ibm.com/ddk/
RAMDISK.EXE is a small and simple 32-bit utility. You should be able to
recompile it with any 32-bit OS/2 compiler. The enclosed copy was built
with IBM C Set++ v 2.1.
One may downgrade the code easily to the official 1.01 release by using
"rollback.gz" patch:
gzip -dc<rollback.gz|patch -p0
(gzip and GNU Patch are to be present on PATH).
History
~~~~~~~
The development path of this public-domain utility, due to independent
participation of various developers, is quite scattered. See the enclosed
RAMFS.GIF for better understanding of various branches.
1998-01-03: (without version number). Initial release by Karl Olsen.
1998-12-05: RAMFS64. The only modification is reporting 64M free space.
Released by Jack Stein.
2002-03-21: RAMFS64 Performance Update. Changed memory allocation algorithm
to avoid performance penalties associated with moving the same data back
and forth. This version was developed by Andrew Belov.
2002-04-14: Version 1.01. No big changes. Released by Karl Olsen and
Stewart Buckingham. Version 1.01 does NOT contain the aforementioned
performance patch. Here is the original change log:
o Added a version number :-), the boot message, and the /Q switch.
o Fixed a bug that showed up when doing wildcard searches from 32-bit
programs, in particular Jonathan de Boyne Pollard's 32-bit Command
Interpreter. Strange things happened if you specified an exact filename
to a command that allowed wildcards.
o Changed the amount of free space and total space reported to OS/2 from 1 MB
to 64 MB. Some programs don't like to write large files to a drive that
apparently only has 1 MB free. A test version, ramfs64.zip, with just this
change has been floating around for some time.
o Added the RCOPY program.
2002-10-21: Version 1.02 Performance Update. This is a merger of the
previous two releases, released by Andrew Belov. Summary of changes:
o Removed RCOPY (made obsolete by the performance patch).
o Moved to Microsoft C v 6.0 and the DDK build environment.
o Implemented AMD 3DNow!<TM> block copy code as per AMD technical note
#22007. Added a kernel patch module and command-line parameters
(/3, /!3) to control 3DNow!<TM>.
o Added /S command-line parameter to set the free space amount reported
by RAMFS.
Distribution package
~~~~~~~~~~~~~~~~~~~~
README.TXT : This file
RAMFS.GIF : Graphical supplement :-)
RAMFS.IFS : The Installable File System driver
RAMFS.SYM : Symbolic information for debugging
RAMDISK.EXE : Utility to create RAM disk drives
SRC\*.* : Source code to RAMFS.IFS, RAMDISK.EXE, and RCOPY.EXE
Contacting the authors
~~~~~~~~~~~~~~~~~~~~~~
This version was released by Andrew Belov <andrew_belov@newmail.ru>
Original RAMFS author:
Me : Karl Olsen
Email: kro@post3.tele.dk
www : http://karl.myip.org