Introduction

ext2-os2 is a file system driver that allows OS/2 to seamlessly access Linux native partitions (ext2fs partitions) in both read and write modes. Once installed, Linux partitions appear as standard OS/2 drive letters.

My initial purpose was to get limited read only access to ext2fs partitions from my OS/2 system, so at the beginning, it was more a quick and dirty rewrite than a clean and full port of the Linux ext2fs file system kernel code.

Now I'm trying to improve it to reuse as much original ext2fs code as possible in order to get a full featured ext2fs driver on OS/2. I'm writing a kind of IFS to VFS translation layer, and porting some Linux kernel services in order to minimize the changes required into the ext2fs sources. At the moment most of the changes in ext2fs are actually due to the 32 to 16 bits port (the IFS interface is still 16 bits), and the IFS code is 50% OS/2 specific (IFS to VFS translation layer, Linux kernel services) and 50% ported from Linux (ext2fs sources). My main constraint is not feasibility but ... time, so contributions will be welcome !

Please notice that ext2-os2 is still at beta level stability, and please read the "IMPORTANT WARNING - READ THIS FIRST".

Writing an IFS is not a simple thing, for several reasons : first there's only one IBM document on the IFS interface, and IBM provides it 'AS IS' ... it means lots of guess ! The second one is that the IFS interface is complex (lots of stuff to support, EAS ...) and still 16 bits. For instance making the Workplace Shell survive to my IFS was a headache... The third one is that the OS/2 IFS interface is quite different from the Linux VFS interface : I had to rewrite from scratch several Linux VFS or even kernel services. The fourth thing is the fact that OS/2 is a multithreaded OS : you can be reentered for the SAME open file instance in your IFS, so locking of resources must be more strict than under Linux, not even speaking of OS/2 SMP, which I really don't support ..... so don't blame me if it doesn't work as you hoped ... I'll try to do better the next time !

DISCLAIMER :

THE FACT THAT I WORK FOR IBM HAS NOTHING TO DO WITH THIS DRIVER. I'M WRITING IT AT HOME, DURING MY SPARE TIME, FOR MY OWN PURPOSES, ON MY OWN MACHINE, WITHOUT ANY IBM MEANS. I USED ONLY IBM PUBLISHED DOCUMENTS TO WRITE IT : I AM ABSOLUTELY NOT RELATED TO THE OS/2 DEVELOPMENT TEAM AND THUS I HAVE ABSOLUTELY NO ACCESS TO ANY CONFIDENTIAL OS/2 IFS RELATED INFORMATION.

Anyway I hope you'll enjoy trying this driver, and even if I don't have much time, I'll try to keep improving it. I wait for your feedback on this version : comments, ideas, bug reports and contributions are welcome.

Matthieu WILLM

willm@ibm.net
Home
mwillm@vnet.ibm.com
Work

Note : English is not my native language ... so this document isn't certainly perfect.

Copyright information

Copyright notice for the ext2fs IFS driver
Copyright notice for the ext2fs partition filter

Copyright notice for the ext2fs IFS driver

    Linux ext2fs file system driver for OS/2 2.x and WARP - Allows OS/2 to
    access your Linux ext2fs partitions as normal drive letters.
    OS/2 implementation : Copyright (C) 1995  Matthieu WILLM

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

This driver contains some copyrighted code whose owners are :

Copyright notice for the ext2fs partition filter

/************************************************************************/
/*                       Linux partition filter.                        */
/*          (C) Copyright Deon van der Westhuysen, July 1995.           */
/*                                                                      */
/*  Dedicated to Jesus Christ, my Lord and Saviour.                     */
/*                                                                      */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2, or (at your option)  */
/* any later version.                                                   */
/*                                                                      */
/* This program is distributed in the hope that it will be useful,      */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
/* GNU General Public License for more details.                         */
/*                                                                      */
/* You should have received a copy of the GNU General Public License    */
/* along with this program; if not, write to the Free Software          */
/* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.            */
/*                                                                      */
/*  This code is still under development; expect some rough edges.      */
/*                                                                      */
/************************************************************************/

***** IMPORTANT WARNING - READ THIS FIRST *****

This is a beta file system driver. It means that IT IS NOT FINISHED AND STILL UNSTABLE. Being a driver it runs at the most privileged level of the OS/2 operating system, known as "kernel mode". IN KERNEL MODE THERE IS NO MORE CRASH PROTECTION. It means that if a bug occurs in the driver IT CAN CAUSE A HANG OR A SYSTEM HALT, AND THUS CAN CAUSE LOSS OF DATA.

I'm not a professionnal IFS writer, so don't expect this driver to meet the same high degree of stability and performance as HPFS or FAT.

Installation instructions

This chapter describes the installation and setup instructions

Step 0 - Safety precautions ......
Step 1 - Make OS/2 see your Linux ext2fs partitions
Step 2 - Copying the files to your hard drive
Step 3 - Using the ext2 debug window
Step 4 - Specifying command line parameters

Step 0 - Safety precautions ......

Step 1 - Make OS/2 see your Linux ext2fs partitions

This chapter describes how to make OS/2 see your Linux ext2fs partitions

Understanding how does OS/2 assign drive letters

OS2DASD.DMD is the block device managing fixed partitionnable disks and floppies. It is always (as far as I know) the first block device loaded by the system. It first scans every .add drivers for physical disks. Then it reads the partition table of each disk. It first looks for active primary OS/2 partitions (Types 01, 04, 06 and 07) and installs a block device for each of them It repeats this for each physical drive in the system. Then it looks for extended volumes on the first physical drive (type 05 partition), reads the extended boot record, looks for an OS/2 partition and assign it a drive letter, looks for another extended volume ... and so on until no more extended volume is found on the first disk. It them repeats this for each physical drive.

Example :

þ Scans all *.add driver for fixed disks - found 2
þ Reads the MBR of physical disk 1
        þ Found an OS/2 type 7 partition (active primary OS/2 IFS)  - Install a block device (C:)
        þ Found an unknown type 0x83 partition                      - skip it
        þ Found an OS/2 type 5 partition (extended volume)          - skip it
        þ No more primary partition
þ Reads the MBR of physical disk 2
        þ Found an OS/2 type 7 partition                            - Install a block device (D:)
        þ Found an unknown type 17 (inactive primary OS/2 IFS)      - skip it
        þ Found an OS/2 type 5 partition (extended vol)             - skip it
        þ No more primary partition
Now done for primary partitions - processing extended volumes
þ Reread the MBR of physical disk 1
        þ Found an OS/2 type 5 partition (extended volume)
                þ Reads the extended boot record of the extended volume
                        þ Found a OS/2 type 7 partition             - Install a block device (E:)
                        þ Found an OS/2 type 5 partition
                                þ Reads the extended boot record
                                    þ Found a OS/2 type 7 partition - Install a block device (F:)
                                    þ No more partition
þ Reread the MBR of physical disk 2
        þ Found an OS/2 type 5 partition (extended volume)
                þ Reads the extended boot record of the extended volume
                        þ Found a OS/2 type 7 partition             - Install a block device (G:)
                        þ No more partition

Make OS/2 see your Linux ext2fs partitions

Make OS/2 see your Linux ext2fs partitions.

During "normal" operations, OS/2 will not assign a drive letter to the Linux partitions, because their type (0x83) is not one of the types OS/2 normally recognize. An installable file system driver does not have any control on how block devices are assigned : this is a device driver issue. If we don't do anything, the ext2fs IFS won't be very useful, since OS/2 doesn't even call it (no block device allocated).

In order for OS/2 to see your ext2fs partition, you must either change your Linux ext2fs partition ID from 0x83 (Linux native) to 0x7 (OS/2 IFS - and not OS/2 HPFS as stated in the Linux fdisk documentation), or make OS/2 think type 0x83 partitions are type 0x7 partitions.

In the first case we must manually alter the partition table, and in the second case we must use a special filter device driver - ext2flt.flt - whose purpose is to show a "hacked" partition table to OS2DASD.DMD.

Here's how ext2flt.flt works : A virtual fixed disk is created for each partition under control of the driver. These virtual fixed disks each contain one extended partition with a logical drive in it. Since OS2DASD.DMD that controls fixed disks first assigns drive letters to primary partitions the virtual partitions are tacked on at the end of allocated drive letters. (To control the mounting order of all partitions OS2DASD is prevented from directly accessing the fixed disks and the filter presents it with an alternate list of partitions.)

BE CAREFUL : IF YOU DECIDE TO CHANGE PARTITION ID MANUALLY BE AWARE THAT IT CAN CHANGE YOUR DRIVE LETTERS AND MAKE OS/2 UNBOOTABLE !!

Examples being better than a long speach, let's look at some different situations :

Example 1
Example 2
Example 3

Step 2 - Copying the files to your hard drive

To install the files on your hard drive :

  1. Open the "OS/2 System" folder
  2. Open the "System Setup" folder
  3. Open the "Device Driver Install" object
    1. Type in the "source directory" entry field the path where you decompacted the files
    2. Type in the "target directory" your OS/2 boot drive
    3. Click on the "Install..." push button
    4. Select the drivers to install (select both of them) :
      • "Linux ext2fs file system driver (IFS) version 0.5 for OS/2"
      • "ext2flt - Filter to make Linux partitions visable to OS/2."
    5. Click on OK
  4. Add <boot drive>:\OS2\FS\EXT2 to the PATH and LIBPATH statements in your CONFIG.SYS
  5. Set and/or change command line parameters for ext2-os2.ifs and ext2flt.flt.
  6. Reboot your computer

Step 3 - Using the ext2 debug window

If you want to get some debug info to try to identify a problem, run the program ext2-os2.exe. It is a kind of output console for the IFS driver in which it can prinf() anything it wants.

Step 4 - Specifying command line parameters

ext2-os2.ifs command line in CONFIG.SYS :

IFS = <drive>:path\ext2-os2.ifs [-q]
                                  [-cache:max. disk cache size]
                                  [-rw]
                                  [-no_auto_fsck]
                                  [-case_retensive]
                                  [-IFS entry point to trace]
                                  [-no_strat2]

NOTE : case is not significant (-q and -Q are equivalent), and '-' as well as '/' can be used as a command line switch on the ext2-os2.ifs command line.

ext2flt.flt command line in CONFIG.SYS :

BASEDEV = EXT2FLT.FLT [/Q]
                      [/V]
                      [/W]
                      [/A]
                      [/M mount list]

Usage instructions

This chapter describes some imortant usage instructions.

  1. Lazy writes considerations
  2. Automatic check disk
  3. Fatal ext2-os2 errors
  4. Case sensitivity considerations
  5. Note to "System Commander" Users
  6. Dynamic disk cache considerations

Lazy writes considerations

This release uses only lazy writes : it means that data are not committed to the disk immediately. YOU *MUST ALWAYS* SHUTDOWN YOUR SYSTEM PROPERLY so that data can be written to disk. IF YOU DON'T FOLLOW THIS RULE, YOUR EXT2FS PARTITION WILL BE PROBABLY DAMAGED, AND YOUR DATA LOST.

I included a sync.exe utility that flushes the cache to disk if you need to be sure that data are committed without shutting down the system.

If you use ex2fs formatted removable media (floppy, ...) data should be commited to disk before the media is removed. You MUST run sync.exe BEFORE removing the media from its drive.

There is an automatic flush during system shutdown. At that time the removable media (if you used one) MUST be present in the drive.

Note : You'll notice that the shutdown process is slightly longer : this is absolutely normal.

Automatic check disk

When ext2-os2 mounts an ext2fs partition and when read writes are enabled, it will set the mount count in the superblock to its maximum value in order to force a disk check when Linux mounts the drive.

This is a safety precaution to ensure that ext2-os2.ifs didn't corrupt the file systems. I do NOT recommend to disable this automatic check ; I only included the -no_auto_fsck switch for those who have very large drives.

Fatal ext2-os2 errors

ext2-os2 fatal errors can appear in several forms :

  1. A system halt with a register dump : this is a fatal exception trapped by the OS/2 kernel, due for example to a NULL pointer assignment. In this case the kernel debugger or a system dump is needed to track down the problem.
  2. A system halt with a cryptic message or a message like "Ext2-fs panic". It's a system halt initiated by ext2-os2 due to an unexpected error.
  3. A beep can occur and you'll see a message like "Ext2-fs error ..." in the ext2-os2 output : An unrecoverable error occured and ext2-os2 blocked the calling thread, making the calling process unkillable. This is less rough than a system halt, but the system is in a dangerous state. In such case the system should have been halted but it's just to give a chance to run sync.exe and shut down the system properly.
  4. The whole system can freeze tightly : it is probably because an infinite loop was entered. Here also the kernel debugger is the only solution.
  5. One or more app seem to be frozen : it is probably a deadlock.

In either case, your ext2fs partition is in great danger ; To minimize the risk of data loss, please do the following :

  1. Write down the output of ext2-os2.exe if any
  2. Run sync.exe if possible.
  3. If possible, IMMEDIATELY shut down thesystem properly , don't do anything else on the partition.
  4. Reboot Linux and run e2fsck -fv
  5. If you can reproduce the problem please send me a test case, as well as ext2-os2.exe's output.

Case sensitivity considerations

ext2fs is a case sensitive file system ; ext2-os2.ifs by default does case sensitive comparisions, but even if OS/2 supports case sensitive file systems, all the apps that uppercase or lowercase file names are broken. Some parts of OS/2 are also broken : for instance the OS/2 program loader itself will uppercase executable names, and so will fail loading programs or DLL if they reside in a path with low case components.

As a workaround, I introduced a command line switch (-case_retensive) to make ext2-os2.ifs behave like HPFS : once set, it will ignore case when comparing file names, but it will retain the case within the file system. It means that FILE, File, FiLe and file will be treated as the same file if they reside in the same directory ; but if you create FiLe, it will keep the case in the file system.

There's a dangerous drawback to this case retensive mode : if 2 files created from Linux in the same directory exist with the same name but different case (FILE and File for instance), and you run ext2-os2.ifs in case retensive mode, RESULTS WILL BE UNPREDICTABLE AND YOU CAN TRASH ONE OR EVEN BOTH FILES ! In fact only the first entry in the "." file of the parent directory will be used by ext2-os2.ifs ; This "first" entry is not necessarily the first entry displayed by the 'DIR' command, nor is it the first one created. EXT2-OS2.IFS DOES NOTHING TO SOLVE SUCH FILE NAME CONFLICT IN CASE RETENSIVE MODE.

If you want to use this case retensive mode, please make sure from Linux that there are never several files with the same name but different case in ANY directory on ANY ext2fs partitions on your system BEFORE trying case retensive mode. If there are some, then rename these files from Linux so that they have have different names.

Note to "System Commander" Users

Note that "System Commander" (from V-Communications) may make changes to the partition table at boot time. This may affect which partitions are visible, or what drive letters are assigned by OS/2 when booting from System Commander. In particular, by default System Commander will make primary partitions on the second hard drive invisible to OS/2. If one of these other primary paritions contains a Linux partition, it will not be visible to OS/2 or EXT2-FS, (even though you are using the /V /A /M options with EXT2FLT.FLT). To make a primary partition on a second hard drive visible when booting OS/2 from System Commander, do the following:

  1. From the main System Commander screen, move to the OS/2 boot selection, and press Alt-S for the setup screen.
  2. Select "Local special options" from the setup screen.
  3. Select "YES" for the "Make primary partitions visible on drive 1".
  4. That's all

This has been reported by Steve Enns (ennss@eris.nhrc.sk.doe.ca)

Dynamic disk cache considerations

ext2-os2.ifs now has a dynamic disk cache. The disk cache code is in fact a port of the Linux disk cache, but with a few important differences.

In Linux, the dynamic cache code is coupled to the virtual memory manager code, so that all free physical memory can be used as cache : when there's some free physical memory, the cache can grow, and when there's not enough free physical memory, the virtual memory manager asks the disk cache to free some pages (this can range from "Could you please give me some free pages" ... to "I URGENTLY need some memory so make whatever you can to free some pages"). On OS/2 I couldn't make things work that way, simply because I can't hack the OS/2 kernel code !! On OS/2, you MUST specify an upper limit for the amount of physical memory the disk cache can allocate. When needed, ext2-os2.ifs will allocate this memory as disk cache, but to simulate VMM calls to shrink the cache, a daemon (ext2_lw.exe) periodically tries to shrink the cache. While it is not a perfect solution, it seems to be a good compromise, at least if the max cache size is reasonable (small enough so that it doesn't cause physical memory starvation to the kernel).

Some important points :

Features, limitations and known bugs for this release.

  1. Features and limitations
  2. Known bugs

Features and limitations

Known bugs

There are still too many of them. This list is not complete but I'll try to keep it as much complete as possible, if you give me your feedback...

History of changes

This chapter describes the changes between each release of ext2-os2

  1. From 0.1 to 0.2
  2. From 0.2 to 0.3
  3. From 0.3 to 0.4
  4. From 0.4 to 0.5

From 0.1 to 0.2

From 0.2 to 0.3

From 0.3 to 0.4

From 0.4 to 0.5

How to build ext2-os2.ifs

This chapter describes how to build the IFS.

  1. Tools needed
  2. The build tree - How to build

Tools needed

To build the IFS you will need these tools or their equivalent. As the IFS interface is still 16 bits, gcc can't be used for the IFS itself ; I'm using MS Visual C++ 1.51 in a DOS box. For the utilities a 32 bits compiler is required, I used IBM Visualage C++ but gcc should do the job.

The build tree - How to build

First unzip the file src_02a.zip somewhere on your disk, for instance in the root directory, it will create a tree .\ext2-os2. Then modify the file makefile.inc according to your own configuration :


 EXT2OS2_BASE       The root path of ext2-os2 (usually \ext2-os2)

 DDKPATH            The path where is installed your DDK (usually
                    \DDKx86)

 IFSTKTPATH         The path where you put the "IFS toolkit" (fsd
                    .h, fsh.h and fshelper.lib)

The build tree looks like :


 .\                   files containing the main makefile and all
                      IFS FS_xxx entry points It contains also the
                      sources of the utilities (ext2_lw.exe and
                      sync.exe).

 .\vfs                Linux kernel services and VFS interfaces.

 .\ext2               ext2fs routines (/usr/src/linux-1.2.1/fs/ext2
                      )

 .\include\os2        OS/2 specific include files

 .\include\linux      Linux include files (/usr/src/linux-1.2.1/
                      include/linux)

 .\include\asm        Linux include files (/usr/src/linux-1.2.1/
                      include/asm)

 .\console            ext2-os2.exe monitoring tool sources

 .\doc                The ext2-os2 documentation

 .\distrib            The directory in which is built the ZIP file.

 .\vfsapi             The VFSAPI library sources.

 .\ext2flt            contains Deon van der Westhuysen's ext2flt.
                      flt sources, patched to compile with MS
                      Visual C++ as well as Borland C++.

First configure a DOS box session with DPMI_DOS_API enabled and have it open on your desktop. Then open also an OS/2 session, go to the base directory and type "nmake". It should build the IFS and the utilities. Normally you should be prompted to switch between the DOS box and the OS/2 box to complete the build...I know this is an awful hack, but it's the cheapest thing I could do to build the IFS with both DOS and OS/2 tools !

The VFSAPI library

The purpose of the VFSAPI library is to provide an extension of the standard OS/2 standard file system oriented calls to access Linux VFS specific features like I-nodes, UNIX file modes, file ownership and so on. For the moment the library is quite limited, but with the time I'll include some more calls !

To be able to do what they are designed for, these routines talk directly to the ext2-os2.ifs file system driver, through the DosFsCtl call. DosFsCtl (almost) directly calls the IFS's FS_FSCTL entry point. Most of the work is done in kernel mode inside ext2-os2.ifs. DosFsCtl is the IFS equivalent of DosDevIOCtl : an extended interface to the IFS.

The library is compiled using IBM Visualage C++ 3.0, but it should also compile without problem with emx/gcc. The precompiled vfsapi.dll should work with emx/gcc (and other compilers) without recompilation.

The entry points follow the standard OS/2 32 bits API linkage convention (_System for IBM Visualage C++, _syscall for Borland C++).

Note : The funtion names, as well as data structure names, have been prefixed with "vfs_" in order to prevent name collisions with existing C/C++ runtime libraries.

vfs_fstat

int vfs_fstat(int fd, struct new_stat *s);

This is the ext2-os2 implementation of the Unix fstat() system call. It returns a "true" stat structure containing the "true" Unix file mode, the "true" file ownership... This stat structure is the same as the Linux stat structure defined in /usr/include/sys/stat.h. All the macros and definitions for file modes and file ownership are also the same as in Linux.


 Parameter type       Input      Description
                      Output

 int fd               input      must be a valid OS/2 file handle (for example
                                 returned by DosOpen, or DosDupHandle).

 struct vfs_stat *s   in/out     On input  must point to a vfs_stat structure.
                                 On output  contains the I-node information.

vfs_stat

int vfs_stat(const char *pathname, struct new_stat *s);

This is the ext2-os2 implementation of the Unix stat() system call. It returns a "true" stat structure containing the "true" Unix file mode, the "true" file ownership... This stat structure is the same as the Linux stat structure defined in /usr/include/sys/stat.h. All the macros and definitions for file modes and file ownership are also the same as in Linux.


 Parameter type       Input      Description
                      Output

 const char *pathname input      Must be a valid OS/2 file name (a file name
                                 acceptable by DosOpen).

 struct vfs_stat *s   in/out     On input  must point to a vfs_stat structure.
                                 On output  contains the I-node information.

vfs_sync

int vfs_sync(void);

This is the ext2-os2 implementation of the Unix sync() system call. It commits all data to the disk.

Note : WARNING : vfs_sync will ONLY work on ext2fs partitions, not on other partitions (FAT, HPFS).

FootNote 1

                    GNU GENERAL PUBLIC LICENSE
                       Version 2, June 1991
 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
                          675 Mass Ave, Cambridge, MA 02139, USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.
                            Preamble
  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.
  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.
  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
  The precise terms and conditions for copying, distribution and
modification follow.

                    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
  1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
  2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.
    b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.
    c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
  3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of Sections
    1 and 2 above on a medium customarily used for software interchange; or,
    b) Accompany it with a written offer, valid for at least three
    years, to give any third party, for a charge no more than your
    cost of physically performing source distribution, a complete
    machine-readable copy of the corresponding source code, to be
    distributed under the terms of Sections 1 and 2 above on a medium
    customarily used for software interchange; or,
    c) Accompany it with the information you received as to the offer
    to distribute corresponding source code.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form with such
    an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

  4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
  5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
  7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.
  9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
  10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
                            NO WARRANTY
  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs
  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  name of author
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19yy name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  `Gnomovision' (which makes passes at compilers) written by James Hacker.
  signature of Ty Coon, 1 April 1989
  Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License.

FootNote 2

This is an example where drive letters won't be changed when you toggle the ext2fs partition ID from 0x83 to 0x7. ext2flt gives the same result without having to alter the partition table.

Before

Physical  Description  Partition  Drive   Type             Status
  drive                     ID    letter
  1       Boot mgr          0a      -     -                Startable
  1       OS/2              07      C:    Extended         Bootable
  1       Linux ext2fs      83      -     Extended         Bootable   <=== We toggle it from 0x83 ...

If we toggle the ext2fs partition type

Physical  Description  Partition  Drive   Type             Status
  drive                     ID    letter
  1       Boot mgr          0a      -     -                Startable
  1       OS/2              07      C:    Extended         Bootable
  1       Linux ext2fs      07      D:    Extended         Bootable   === ... to 0x07

If we use ext2flt.flt

Physical  Description  Partition  Drive   Type             Status
  drive                     ID    letter
  1       Boot mgr          0a      -     -                Startable
  1       OS/2              07      C:    Extended         Bootable
  1       Linux ext2fs      07      D:    Extended

The pink partition is the one as shown by ext2flt.flt to OS/2.

FootNote 3

In this case, the OS/2 drive letter is changed from C: to D: when you change the Linux partition ID. If you want to use the ext2 IFS driver you'll have to use ext2flt.flt so that the ext2fs partition appears after the OS/2 partition.

Before

Physical  Description  Partition  Drive   Type             Status
  drive                     ID    letter
  1       Boot mgr          0a      -     -                Startable
  1       Linux ext2        83      -     Primary          Bootable   <=== We toggle it from 0x83 ...
  1       OS/2 System       07      C:    Extended         Bootable

If we toggle the partiton ID, the drive letters change :

Physical  Description  Partition  Drive   Type             Status
  drive                     ID    letter
  1       Boot mgr          0a      -     -                Startable
  1       Linux ext2        07      C:    Primary          Bootable   === ... to 0x07
  1       OS/2 System       07      D:    Extended         Bootable

The solution is to use ext2flt.flt :

Physical  Description  Partition  Drive   Type             Status
  drive                     ID    letter
  1       Boot mgr          0a      -     -                Startable
  1       OS/2 System       07      C:    Extended         Bootable
  1       Linux ext2        07      D:    Extended

The pink partition is the one as shown by ext2flt.flt to OS/2.

FootNote 4

In this case, you cannot use the ext2 IFS driver alone and you are a good candidate for using ext2flt.flt. This is because only ONE primary partition can be active. ext2flt.flt will make your ext2fs partition appear as an extended volume located after your OS/2 partition.

Physical  Description  Partition  Drive   Type             Status
  drive                     ID    letter
  1       Boot mgr          0a      -     -                Startable
  1       Linux ext2        83      -     Primary          Bootable
  1       OS/2 System       07      C:    Primary (active) Bootable

If we use ext2flt.flt :

Physical  Description  Partition  Drive   Type             Status
  drive                     ID    letter
  1       Boot mgr          0a      -     -                Startable
  1       OS/2 System       07      C:    Primary (active) Bootable
  1       Linux ext2        07      D:    extended

FootNote 5

[-q] : quiet initialization of ext2-os2.ifs (no banner during boot). Default is verbose initialization.

FootNote 6

[-cache:<max. disk cache size>] Specifies the MAXIMUM disk cache size. This value is the maximum amount of physical memory ext2-os2.ifs can dynamically allocate for disk cache buffers. Default is 256 Kb.

Note : Please read the chapter "Dynamic disk cache considerations"

FootNote 7

[rw] : enable write access. Default is write disabled.

Note : If you use ext2flt, don't forget to enable write access on the ext2flt.flt command line. (/W switch)

WARNING - DON'T FORGET TO BACKUP ALL YOUR DATA PRIOR TO ENABLE WRITE ACCESS !!!

FootNote 8

[-no_auto_fsck] : prevents ext2-os2 from forcing Linux to run e2fsck on partitions "touched" by OS/2 Default is to force Linux to run e2fsck.

Note : Please read the chapter "Automatic check disk"

FootNote 9

[-case_retensive] : makes ext2-os2.ifs behave like HPFS. If this option is set, case will not be significant but will be retained within the file system. For instance File and FILE are considered to be the same file. Default is case sensitive.

WARNING - PLEASE READ "Case sensitivity considerations" BEFORE USING THIS OPTION !!!

FootNote 10

[-<IFS entry point to trace>] : traces a specific IFS entry point. Using this option makes ext2-os2.ifs produce an output in ext2-os2.exe whenever the specified IFS entry point is entered. You can specify several IFS entry points to trace for instance "IFS=ext2-os2.ifs -FS_MKDIR -FS_RMDIR".

Note : Please notice that tracing will have a performance hit (can be important).

Currently supported IFS entry points for tracing are :

FootNote 11

[-no_strat2] : disable use of extended I/O operations (strategy 2 calls). Default is to use them when they are supported by the block device driver. Normally it works well with OS2DASD.DMD, but if you encounter problems with extended I/O with other drivers, you can disable them.

Note : Using extended I/O results in HUGE performance improvements ; disabling them with have a tremendous performance hit.

FootNote 12

/Q : Quiet install. Prevents the filter from displaying messages.

FootNote 13

/V : Verbose install. Displays some diagnostic messages.

FootNote 14

/W : Allows the virtual partitions to be written to.

FootNote 15

/A : Virtualize all partitions found. The only good reason to use this is along with the /M option when you want to control the mounting order of all the partitions. You must use the /W option if you use the /A option; otherwise OS/2 may crash when it tries to write to the partition.

Note : Using the /A option may change your drive letters causing the your system to be unbootable. Use the /M option together with /A. (This may change in the future.

FootNote 16

/M <mount list> : Mounts the partitions in the order specified in the mount list, which should be a list of numbers separated by commas. The partitions are numbered 0 on a first come basis. (Not the OS/2 uses.)

FootNote 17

sync.exe does exactly what its Unix counterpart (sync) does : it commits all buffered data to disks.

Invocation :

sync

Note : Please ensure that all ext2fs formatted removable media are in their drives when you invoke sync.exe.