Date: Mon, 15 Apr 2002 08:13:25 -0400 From: madodelatptdprolog.net Subject: [VOICENWS] IFS based RAMDISK for OS/2 version 1.01 From: tamatgmx.de (Timo Maier) "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. A RAMFS drive always reports a free space of 64 MB. This is an arbitrary number, and it doesn't mean that you can only store 64 MB -- RAMFS just has to answer something when OS/2 asks about the amount of free space." Program URL: http://karl.myip.org/ramfs.htm Dirrect download: http://karl.myip.org/ramfs101.zip Features * Create as many RAM drives as you want, using the drive letters that you want * Size only limited by available RAM and swap disk space * Allocates swappable RAM from OS/2 as necessary when files are created, and releases it again when files are deleted * 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. * Extended Attributes - up to 64 KB total for each file/directory * RAM is allocated in units of one page (4 KB) Non-features * Does not support file locking functions (DosSetFileLocks()) * Does not support the DosFindNotify...() functions. I have never seen OS/2 use these functions. * Changing the size of a large file is slow, because RAMFS allocates a new block of RAM, copies the contents into the new block, and then frees the old block. This happens often if you use COPY or XCOPY to copy files to a RAMFS drive. Installation and use Add IFS=d:\path\RAMFS.IFS to config.sys and reboot. During boot, it will show a short version message. If you like to keep your boot screen clean, you can suppress the message with the /Q switch, like this: IFS=d:\path\RAMFS.IFS /Q 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 RUN=d:\path\RAMDISK R: to config.sys. RCOPY.EXE is a small file copying program without any bells or whistles whatsoever -- it doesn't support things like wildcards or setting the destination file date and time. As I at the time of this writing don't have access to an OS/2 compiler, it is a DOS executable, and it doesn't support long filenames or EAs. Syntax: RCOPY sourcefile destfile Include drive and directory as necessary in sourcefile and destfile. The special feature of RCOPY is that before it starts copying, it creates the destination file with the size of the source file. It is useful for copying large files to a RAMFS drive since the size of the destination file is only changed once. On one system, I have seen COPY take 56 seconds to copy a 20 MB file from one RAMFS drive to another, while the same operation using RCOPY took 0.4 second. Source code RAMFS.IFS is written in Borland C++ 3.1 and Turbo Assembler 3.1. Yes, Borland C++ happily compiles 16-bit code for OS/2. If you want to recompile, you will need the 16-bit OS/2 header files (not included here). With some tweaking, you may be able to compile it with other 16-bit protect-mode compilers. You can link it with the 16-bit IBM LINK.EXE, or Borland TLink 5.1 (the one that comes with Borland C++ 3.1). Borland doesn't document it, but TLink can actually generate OS/2 executables. RAMDISK.EXE is a small and simple 32-bit utility. You should be able to recompile it with any 32-bit OS/2 compiler. I used IBM CSet++ 2.1. RCOPY.EXE is written in plain C and should be compilable with any 16- or 32-bit compiler. History 1998-01-03: (without version number). Initial release. 2002-04-14: Version 1.01. No big changes. * Added a version number :-), the boot message, and the /Q switch. * 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. * 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. * Added the RCOPY program. Program URL: http://karl.myip.org/ramfs.htm Dirrect download: http://karl.myip.org/ramfs101.zip -- To unsubscribe yourself from this list, send the following message to majormajoratos2voice.org unsubscribe news end If you have an announcement you would like posted to the VOICE News list, please send it to submitatos2voice.org. Please include a valid reply address and a real contact name. If you wish to comment on this post, please reply to feedbackatos2voice.org