Title page

Linux ext2fs file system driver for OS/2
EXT2-OS2 VERSION 2.30 (32 BITS EDITION)
Copyright (C) Matthieu WILLM 1995, 1996 (willm@ibm.net)

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 (version 0.1 alpha back in June 1995), it was more a quick and dirty rewrite than a clean and full port of the Linux ext2fs file system kernel code.

I've improved it to reuse as much original ext2fs code as possible in order to get an almost full featured ext2fs driver on OS/2. I wrote a kind of IFS to VFS translation layer, and ported some Linux kernel services in order to minimize the changes required into the ext2fs sources. Now that ext2-os2 is 32 bits, these changes are minimal.

This version is almost full featured : the main restriction is that ext2-os2 does not support extended attributes (EAS).

Ext2-os2 from experience is now stable for normal use, but as any piece of software, it cannot be bulletproof. Before using ext2-os2, please read the following : "***** 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 is really not supported.

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. Success stories do also interest me, and disasters too !

Matthieu WILLM

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

Note : English is not my native language (I'm french) ... so this document isn't certainly perfect.

Copyright information

Copyright notice for the ext2fs IFS driver 
Copyright notice for the ext2fs partition filter 
Authors of the original Linux ext2 file system 

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.
    Copyright (C) 1995, 1996  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.

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.      */
/*                                                                      */
/************************************************************************/

Authors of the original Linux ext2 file system

Parts of the ext2-os2 package are based on GNU GPL copyrighted code whose owners are :

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

ext2-os2 is a FILE SYSTEM DRIVER. 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.

Installation instructions

This chapter describes the installation and setup instructions

Step 1 - Things to do BEFORE installing ext2-os2 
Step 2 - Make OS/2 see your Linux ext2fs partitions 
Step 3 - Copying the files to your hard drive 
Step 4 - Using the ext2-os2 monitoring tool 
Step 5 - Specifying command line parameters 

Step 1 - Things to do BEFORE installing ext2-os2

Here are things you must do before installing this version of ext2-os2 :

  1. Please run e2fsck from Linux on ALL your ext2fs partitions BEFORE installing ext2-os2. (You might have to boot Linux from floppy to do this, especially to run e2fsck on your root partition).
  2. I STRONGLY suggest you to first backup any data you don't want to loose BEFORE trying this driver.
  3. Make a backup copy of your CONFIG.SYS
  4. Have the two OS/2 kicker diskettes handy , with a full screen editor, so that you can restore your CONFIG.SYS if the system crashed at boot time. (This is not needed with WARP : Alt+F1 C at boot time will do the trick)
  5. Prepare a Linux boot diskette, with e2fsck on it.
  6. If you installed a previous version of ext2-os2, then comment out the following CONFIG.SYS statements and reboot your system to ensure that no ext2-os2 file is locked while installing the new version.

Step 2 - 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 3 - Copying the files to your hard drive

Installation using the "Device Driver Install" object

  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 2.30 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

Manual installation

ext2flt installation

  1. copy ext2flt.flt and ext2flt.sym in <boot drive>\OS2 or in boot drive\OS2\BOOT (WARP only)
  2. add the following line in CONFIG.SYS
    BASEDEV=EXT2FLT.FLT
    
  3. if necessary, adjust ext2flt command line parameters (for instance /W if you want write access)

ext2-os2 installation

  1. copy mwdd32.sys and mwdd32.sym in boot drive\OS2 or in boot drive\OS2\BOOT (WARP only)
  2. add the following line in CONFIG.SYS
    BASEDEV=MWDD32.SYS
    
  3. make a directory to hold ext2-os2 files somewhere but NOT on a Linux partition.
  4. add this directory at the end of the PATH and LIBPATH statements in CONFIG.SYS
  5. copy the following files to that directory :
  6. add the following lines in your CONFIG.SYS
    IFS=path\ext2-os2.ifs -cache:256 -errors=continue
    RUN=path\ext2_lw.exe
    
  7. if necessary, adjust ext2-os2.ifs command line parameters (for instance -rw if you want write access)

Note : In CONFIG.SYS, ext2-os2.ifs MUST be located AFTER the IFS managing the boot drive (HPFS.IFS usually). ext2-os2.ifs can appear at the head of CONFIG.SYS only if you boot OS/2 from a Linux partition.

Step 4 - Using the ext2-os2 monitoring tool

ext2-os2.exe is a monitoring tool to retrieve data from ext2-os2.ifs. It is a PM notebook containing :

Step 5 - 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]
                                  [-errors=[panic|continue]]
                                  [-output=[com1|com2]]
                                  [-tz:time zone in minutes from UTC]
                                  [-force_strat2:removable drive number to be forced to use strat 2 I/O]

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
  7. Time zone considerations
  8. Important removable media considerations

Lazy writes considerations

This file system driver makes heavy use of lazy writes : it means that data are not committed to the disk immediately for performance purposes. This means that 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.

If you need to commit data to disk without shutting down the system, you can use the sync.exe utility. This utility behaves exactly like its UNIX equivalent (but only on Linux ext2fs file systems).

There is an automatic flush during system shutdown., so running sync.exe prior system shutdown is not necessary.

Note : You will notice that the shutdown process is slightly longer, especially if you used a huge cache size : this is a normal behaviour.

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, where e2fsck takes ages to complete.

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 message like "> EXT2-OS2 FATAL ERROR <". This is a system halt initiated by ext2-os2.ifs due to an unexpected error. Normally there should be a few lines with a cryptic message. Please write it down, as it will tell me where the error occured.
  3. The whole system is frozen : it is probably because an infinite loop was entered. Here also the kernel debugger is the only solution.
  4. One or more applications are 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. In case of a system halt, write down the error message.
  2. In case of a system hang, try to press CTRL+ALT+DEL : this will commit dirty buffers to disk and thus minimise the damages on the partitions (ext2fs as well as FAT or HPFS). If it didn't work, the big red button is the only solution.
  3. Reboot Linux and run e2fsck ON ALL YOUR LINUX EXT2FS PARTITIONS to check and repair them if needed. DO NOT RESTART OS/2 WITH EXT2-OS2.IFS WITHOUT HAVING RUN E2FSCK ON ALL YOUR PARTITIONS, THIS COULD SPREAD FILE SYSTEM ERRORS AND MAKE THINGS EVEN WORSE !
  4. Please e-mail me the error, as well as a test case if possible, and please join your partition scheme (FDISK /QUERY from OS/2 or fdisk -l from Linux) and your CONFIG.SYS.

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.

Note : If you plan to run OS/2 programs from a Linux partition, this option is necessary because the OS/2 program loader uppercase executable names.

There's a 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 :

Time zone considerations

ext2-os2 can now take your local time zone into account. File times should match Linux file times (local time) instead of being relative to UTC . The time zone can be set in CONFIG.SYS on the ext2-os2.ifs command line through the -tz switch . It should be set to the minute shift from UTC (-1440 to +1440). 0 means GMT, 60 means GMT+1, 120 means GMT+2, -60 means GMT-1 and so on.

This option is rather experimental and can't be perfect because OS/2 does not natively support time zones. Please tell me if you find it useful and if it works correctly, otherwise simply remove the -tz switch and tell me the problems you encountered.

Note : The OS/2 system time is not affected by this variable, so when you use -tz, you make ext2-os2.ifs consistent with Linux, but you introduce a shift between OS/2 system time, and file times. In some cases this can be a problem. Please tell me if you encountered some problems due to this (makefiles ?).

Important removable media considerations

ext2-os2 does support removable media formatted with the Linux ext2fs file system. To safely use ext2-os2 on removable media, you MUST FOLLOW THE THE PROCEDURE DESCRIBED BELOW !!! If you don't follow this procedure, you can face data loss or even system halts.

When you insert a new media in its drive, OS/2 will automatically attach the correct file system on it. No special step is required to make OS/2 recognize this new media. If you cannot access the drive, then you can try to run the remount.exe program to make OS/2 redetermine the file system to be attached to the drive. If it still fails, then check that it is actually formatted with the ext2 file system, and if it is the case, try to run e2fsck on that drive.

When you plan to remove a media from its device, YOU MUST RUN THE UMOUNT.EXE PROGRAM ON THAT DRIVE TO COMMIT ALL DATA TO DISK AND MAKE EXT2-OS2 FREE ANY REFERENCES TO THAT PARTICULAR VOLUME. After that, the media can be safely removed from its device. umount.exe actually issues an unmount operation, like on UNIX.

Note : The old method of using sync.exe before removing a media could cause problem in some cases. That's why I strongly recommend to use umount.exe instead each time you need to remove a volume from its device (umount.exe does a lot more work than sync.exe, as it does exactly what the UNIX "umount" call does).

Features, limitations and known bugs for this release.

  1. Features and limitations
  2. Known bugs

Features and limitations

Known bugs

The following list includes some common problems encountered with ext2-os2. There are of several kinds : permanent restrictions, problems due to bugs in the OS/2 operating system itself, or problems I couldn't reproduce yet (for instance because I don't have the related hardware). This list is not complete but I'll try to keep it as much up to date as possible , if you give me your feedback...

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

Table or required compiler, assembler and linker :

                                                                  
                      32 bits C  16 bits C  80x86      Linker     
                      compiler   compiler   assembler             
                                                                  
 ext2-os2.ifs         ?????????? (none)     ?????????? ?????????? 
                      (1)               (2)    (7)    
                                                                  
 mwdd32.sys           ?????????? (none)     ?????????? ?????????? 
                      (1)               (2)    (7)    
                                                                  
 ext2flt.flt          (none)     ?????????? ?????????? ?????????? 
                                 (3) or (5) or (8) or 
                                 ?????????? ?????????? (9)        
                                 (4)    (6)               
                                                                  
 vfsapi.dll           ?????????? (none)     (none)     ?????????? 
                      (1)                          (7)    
                                                                  
 ext2-os2.exe         ?????????? (none)     (none)     ?????????? 
                      (1)                          (7)    
                                                                  
 ext2_lw.exe          ?????????? (none)     (none)     ?????????? 
                      (1)                          (7)    
                                                                  
 sync.exe             ?????????? (none)     (none)     ?????????? 
                      (1)                          (7)    
                                                                  
 uext2.dll            ?????????? (none)     (none)     ?????????? 
                      (1)                          (7)    
                                                                  
 microfsd.fsd         (none)     ?????????? ?????????? ?????????? 
                                 (3)    (5)    (8)    
                                                                  
 minifsd.fsd          (none)     ?????????? ?????????? ?????????? 
                                 (3)    (5)    (8)    
                                                                  

List of required toolkits :

The build tree - How to build

  1. make a directory somewhere on your disk.
  2. in that directory, unzip the file ext2_src.zip
  3. in that directory, unzip the file mwdd_src.zip (included in 32drv130.zip included in this package).
  4. update the file <your directory>\32bits\ext2-os2\makefile.inc, according to the table below.
  5. open a DOS session, and in that session :
  6. exit from the DOS session
  7. change the current directory to your directory\32bits\ext2-os2
  8. type "nmake" to build the whole ext2-os2 package
                                                                  
 EXT2OS2_BASE       The root path of ext2-os2 (usually \ext2-os2) 
                                                                  
 DDKPATH            The path where is installed your DDK (usually 
                    \DDKX86 or \DDK)                              
                                                                  
 IFSTKTPATH         The path where you put the "IFS toolkit" (fsd 
                    .h, fsh.h and fshelper.lib)                   
                                                                  
 MSVCPATH           The path where MS Visual C++ is installed (   
                    usually \MSVC)                                
                                                                  
 VACPATH            The path where IBM Visualage C++ is installed 
                    (usually \IBMCPP)                             
                                                                  

The build tree looks like :

                                                                    
 .\                   contains the main makefile an the files I     
                      couldn't put elsewhere.                       
                                                                    
 .\vfs                Linux kernel services and VFS interfaces.     
                                                                    
 .\ext2               Linux ext2fs sources (from /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++.            
                                                                    
 .\microfsd           The ext2-os2 micro FSD (used to boot OS/2     
                      from a Linux partition)                       
                                                                    
 .\minifsd            The ext2-os2 mini FSD (used to boot OS/2 from 
                      a Linux partition)                            
                                                                    
 .\uext2              The dummy uext2.dll library sources (         
                      necessary to make BOOTOS2 happy)              
                                                                    

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 : vfs_sync will ONLY work on ext2fs partitions, not on other partitions (FAT, HPFS).

vfs_link

int vfs_link(const char *from, const char *to);

This call creates a hard link to an existing file.

                                                                               
 Parameter type       Input      Description                                   
                      Output                                                   
                                                                               
 const char *from     input      File name to be linked. Must be a valid OS/2  
                                 file name (a file name acceptable by DosOpen) 
                                 .                                             
                                                                               
 const char *to       input      New file name. Must be a valid OS/2 file name 
                                 (a file name acceptable by DosOpen).          
                                                                               

Booting OS/2 from a Linux ext2fs partition

Ext2-os2 allows OS/2 to boot from a Linux ext2fs partition. It can even makes OS/2 reside alongside Linux on the same partition (I mean, having vmlinuz and OS2KRNL on the same file system !).

Note : There is only one restriction : you must still have a small FAT or HPFS partition to store the WPS desktop tree (usually <boot drive>:\DESKTOP\*), because the Linux ext2 file system does not support EAS (extended attributes), which are necessary to the WPS.

Anyway, it is not completely useless though : with this feature you can for instance install an OS/2 maintenance partition on a Linux ext2fs drive, and thus save a partition. You can also install a full OS/2 system, if you store the desktop and the swap file on a FAT or HPFS partition.

The following chapters will describe how to setup an OS/2 system on a Linux ext2fs partition. It's not an easy thing to do, because as you will see it's like if we gathered on a single partition the usual problems encountered when installing a Linux+OS/2 system !!

For the moment booting OS/2 from a Linux partition is still quite experimental and is still at beta level stabiliy ! To try this feature, you'll have to be very familiar with OS/2 installation, Linux installation, and LILO + OS/2 Boot Manager configuration. Please make a full backup of your system first !

I'm waiting for your feedback on this new feature, both failures and success stories !

  1. Understanding the normal OS/2 HPFS boot sequence
  2. Understanding the normal Linux ext2fs boot sequence
  3. Understanding the ext2-os2 OS/2 ext2fs boot sequence
  4. Installing and configuring OS/2 on a Linux ext2fs partition

Understanding the normal OS/2 HPFS boot sequence

Assume you have an OS/2 system with Boot Manager installed. Here's a simplified HPFS boot sequence :

  1. Ctrl+Alt+Del or Power on gives control to the power-on-self-test (POST) code. the POST code after hardware initializations issues an INT 19h.
  2. INT 19h load the first sector of the first drive (the MBR), and executes it. This code will load and execute the boot record of the active primary partition.
  3. This active partition is Boot Manager, it will present you a menu of bootable systems.
  4. When you select the OS/2 system, boot manager reads and executes the code in the boot record of the selected partition.
  5. This code is called a "black box". Its role is to load a micro IFS in memory. This micro IFS is a real mode IFS with just enough brain to read a few files.
  6. When the micro IFS receives control, it loads the OS/2 loader (stored in OS2LDR). It also loads a mini IFS : a mini IFS is a protect mode IFS with limited read only capabilities, just a little bit more clever than a micro IFS ! (The HPFS mini IFS is stored in OS2BOOT) It then passes control to OS2LDR, along with the current state of memory.
  7. OS2LDR then loads OS2KRNL from disk, applies required fixups, and gives control to the kernel.
  8. The kernel then loads the mini IFS from its memory image. The mini IFS is used to load the base device drivers, then the normal device drivers and IFSes, then the VDD drivers.
  9. When the normal HPFS IFS is loaded, it replaces the mini IFS.

As you can see, the OS/2 kernel doesn't know anything about HPFS. It even makes no assumption of booting off of disk.

Understanding the normal Linux ext2fs boot sequence

Assume you have a Linux system with OS/2 Boot Manager installed as the main boot loader, and LILO installed in the superblock of the Linux boot partition.

  1. Ctrl+Alt+Del or Power on gives control to the power-on-self-test (POST) code. the POST code after hardware initializations issues an INT 19h.
  2. INT 19h load the first sector of the first drive (the MBR), and executes it. This code will load and execute the boot record of the active primary partition.
  3. This active partition is Boot Manager, it will present you a menu of bootable systems.
  4. When you select the Linux system, boot manager reads and executes the code in the boot record of the selected partition.
  5. This code is actually the LILO first stage loader. its role is to load the LILO second stage loader.
  6. The LILO second stage loader loads the disk map of the boot image, then using this map it loads the Linux kernel, as well as command line parameters. It then gives control to the setup code stored at the beginning of the Linux boot image.
  7. The setup code then explores the hardware configuration, switches to protect mode and passes control to the Linux kernel.
  8. When the Linux kernel receives control, it executes its initialization routines, and initializes the device drivers present in the boot image.
  9. It then executes the init process.

The main difference here is that the Linux kernel does not load dynamically the device drivers, and especially the ext2fs driver. They are all present in the boot image. While it greatly simplifies the boot sequence (no mini IFS, no micro IFS ...) it requires a reconmpilation whenever you want to add or remove a driver.

When you run LILO to install a new kernel, it installs a map of the kernel boot image, and a boot loader in the boot record. LILO's main advantage is to be independant of the file system it uses, and even more : it knows absolutely nothing about ext2fs, FAT and so on. It uses the disk map to load the boot image. This is the reason why you must re-run LILO whenever you touch your kernel file. LILO makes no assumption of booting a Linux kernel image : it can load other systems as well : it loads the specified file in a well known place in memory regardless of its type, and gives it control.

Understanding the ext2-os2 OS/2 ext2fs boot sequence

ext2-os2 uses a mix of these two different sequences to boot OS/2 from a Linux ext2fs partition. In this package there are two new files :

The main difference between the normal OS/2 boot sequence and the ext2-os2 boot sequence is that ext2-os2 uses LILO as the "black box" described above. LILO is actually configured to load MICROFSD.FSD instead of a standard Linux kernel boot image.

Note : LILO is required to boot OS/2 from a Linux partition. I tested it with LILO 0.15 but it should also work with later versions.

The boot sequence will be (assuming you have OS/2 boot manager installed as the main boot loader, and LILO in the superblock of the Linux partition) :

  1. Ctrl+Alt+Del or Power on gives control to the power-on-self-test (POST) code. the POST code after hardware initializations issues an INT 19h.
  2. INT 19h load the first sector of the first drive (the MBR), and executes it. This code will load and execute the boot record of the active primary partition.
  3. This active partition is Boot Manager, it will present you a menu of bootable systems.
  4. When you select the OS/2 system, boot manager reads and executes the code in the boot record of the selected partition.
  5. This code is actually the LILO first stage loader. its role is to load the LILO second stage loader.
  6. The LILO second stage loader loads the disk map of the boot image (which is actually a map of MICROFSD.FSD), then using this map it loads the micro FSD as well as as command line parameters. It then gives control to the micro FSD.
  7. When the micro IFS receives control, it loads the OS/2 loader (stored in OS2LDR). It also loads the ext2fs mini IFS (MINIFSD.FSD). It then passes control to OS2LDR, along with the current state of memory.
  8. OS2LDR then loads OS2KRNL from disk, applies required fixups, and gives control to the kernel.
  9. The kernel then loads the mini IFS from its memory image. The mini IFS is used to load the base device drivers, then the normal device drivers and IFSes, then the VDD drivers.
  10. When the normal ext2-os2 IFS is loaded, it replaces the mini IFS.

Installing and configuring OS/2 on a Linux ext2fs partition

  1. Sample initial situation
  2. Copying OS/2 a Linux ext2fs partition
  3. Copying the required ext2-os2 files on the ext2fs partition
  4. Updating CONFIG.SYS
  5. Configuring and running LILO to boot OS/2 from your ext2fs partition
  6. Now time to reboot ...

Sample initial situation

hard disk 1 (100 Mb IDE drive) :

                                                                                 
 OS/2 drive      OS/2 BM name    Linux device    Linux mount     Description     
 letter                          name            point                           
                                                                                 
                                 /dev/hda2                       OS/2 boot       
                                                                 manager         
                                                                 partition       
                                                                                 
 C               test            /dev/hda3       /disk_c         Linux ext2fs    
                                                                 test (type 0x07 
                                                                 ) partition (   
                                                                 ext2flt not     
                                                                 used to mount   
                                                                 it)             
                                                                                 
 F               linux           /dev/hda1       /               Linux ext2fs    
                                                                 root (type 0x83 
                                                                 ) partition (   
                                                                 ext2flt used to 
                                                                 mount it)       
                                                                                 

((See also linux and OS/2 fdisk output for drive 1)

hard disk 2 (1.2 Gb SCSI drive) :

                                                                                 
 OS/2 drive      OS/2 BM name    Linux device    Linux mount     Description     
 letter                          name            point                           
                                                                                 
 D               WARP            /dev/sda1                       primary OS/2    
                                                                 HPFS with OS/2  
                                                                 WARP installed  
                                                                 (normal use)    
                                                                                 
 D               EXT2-OS2        /dev/sda2                       primary OS/2    
                                                                 HPFS with OS/2  
                                                                 and kernel      
                                                                 debugger (to    
                                                                 test ext2-os2)  
                                                                                 
 E                               /dev/sda5                       extended OS/2   
                                                                 HPFS data       
                                                                 partition.      
                                                                                 

((See also linux and OS/2 fdisk output for drive 2)

LILO is installed in the superblock of /dev/hda1, and is configured to load /vmlinuz from this partition. (lilo.conf used to configure LILO)

Copying OS/2 a Linux ext2fs partition

To install OS/2, the easiest way will be to use the IBM EWS bootos2.zip package (available on usual OS/2 ftp sites). This package can create a bootable system from an existing installed system. It can install a system on either floppies or hard disks. Moreover it can create a minimal system (single text mode session), a PM enabled system, a WPS enabled system ...

Here's how I installed a PM enabled system on drive F:. To do this, I booted my normal OS/2 system, went to the bootos2 directory and typed :

BOOTOS2 TARGET=F: TYPE=PM

Note on how to install a WPS enabled system

Copying the required ext2-os2 files on the ext2fs partition

Make a directory on the ext2fs partition to store ext2-os2 files (for instance F:\os2\fs\ext2) and copy the following files in it :

Copy the following files in F:\OS2 : or in F:\OS2\BOOT

Copy the following files in F:\ :

Updating CONFIG.SYS

Then add the following statements at the beginning of F:\CONFIG.SYS :

REM
REM this should be the beginning of CONFIG.SYS
REM
IFS=F:\OS2\FS\EXT2\EXT2-OS2.IFS -cache:256 -rw -case_retensive <add other options if necessary>
RUN=F:\OS2\FS\EXT2\EXT2_LW.EXE
BASEDEV=MWDD32.SYS
BASEDEV=EXT2FLT.FLT /W add other options if necessary

Configuring and running LILO to boot OS/2 from your ext2fs partition

Now reboot under Linux. In this step we'll need to know several things :

Then edit the /etc/lilo.conf to add /microfsd.fsd as a new boot image :

#
# Start LILO global section
#
boot = /dev/hda1                # installs LILO in the superblock of /dev/hda1
vga = normal                    # force sane state
ramdisk = 0                     # paranoia setting
prompt
#
# End LILO global section
#
# Linux bootable partition config begins
#
image = /vmlinuz                # normal Linux kernel image
  root = /dev/hda1
  label = linux                 # name to enter at LILO prompt
  read-only                     # Non-UMSDOS filesystems should be mounted read-only for checking
#
# Linux bootable partition config ends
#
# OS/2 bootable partition config begins
#
image = /microfsd.fsd           # ext2-os2 micro-fsd file (OS2LDR loader).
  label = test_os2              # name to enter at LILO prompt
  append = "os2_bios_device=0x80 os2_bootdrive=5 os2_hidden_sectors=0x19884 os2_sect=35 os2_head=6 os2_total_sectors=100800 os2_bytes_per_sector=512"
#
# OS/2 bootable partition config ends
#

In the "append=" we've passed mandatory informations to the ext2-os2 micro FSD so that it can boot OS/2 properly. Below is a description of these parameters.

Note : All these parameters are required. A wrong value in one of them will prevent OS/2 from booting normally.

                                                                    
 os2_bootdrive        this is the OS/2 drive letter of the boot     
                      drive. It MUST REFLECT the drive letter as    
                      seen in a normal situation (in our case F).   
                      You CANNOT REORDER drive letters with this    
                      option ; use ext2flt's /M option instead and  
                      update this value accordingly.                
                                                                    
 os2_bios_device      this is the physical drive BIOS device code.  
                      Floppy drives are 0 (A) and 1 (). Hard drives 
                      are numbered starting at 0x80, so physical    
                      hard drive 1 is 0x80, drive 2 is 0x81.        
                                                                    
 os2_hidden_sectors   this is sector number (512 bytes) of the      
                      first sector of the boot partition. Use fdisk 
                      -uS -l under Linux to know it.                
                                                                    
 os2_total_sectors    this is the size of the boot partition in 512 
                      bytes sectors. Use fdisk -uS -l to know it.   
                                                                    
 os2_sect             this is the number of sectors per track       
                                                                    
 os2_bytes_per_sector this is the hardware sector size in bytes (   
                      normally 512 bytes).                          
                                                                    
 os2_head             this is the number of heads                   
                                                                    

Then run the map installer to update LILO configuration as follows :

lilo -v

Now time to reboot ...

Now we can shutdown the system and reboot. Once in OS/2 boot manager menu, select "linux". This will start LILO. Once LILO is up - it should prompt "lilo:" at the top left corner of the screen - type "test_os2", then <ENTER> then let's prey ! Here are some checkpoints :

                                                                    
 ext2-os2 MICROFSD    microfsd.fsd has been successfuly loaded by   
 banner appears on    LILO, and has been successfuly started.       
 top of the screen                                                  
                                                                    
 a little white box   it means that microfsd.fsd has successfuly    
 followed by the word loaded OS2LDR and minifsd.fsd, and that       
 "OS2" appears at the OS2LDR has been successfuly started.          
 top left corner of                                                 
 the screen.                                                        
                                                                    
 the OS/2 logo bitmap it means that OS2LDR has successfuly loaded   
 appears              OS2KRNL, successfuly started the kernel, that 
                      microfsd.fsd's job is over, and that minifsd. 
                      fsd's job is starting. From this point CONFIG 
                      .SYS base device drivers begin to be loaded.  
                                                                    
 the normal ext2-os2  ext2-os2.ifs has just been loaded.            
 banner appears.                                                    
                                                                    
 PM appears (if a PM  OS/2 boot process is successful !             
 system), or the OS/2                                               
 command prompt                                                     
 appears.                                                           
                                                                    
The boot process will be probably slightly longer than a normal boot. This is absolutely normal. 
You can press ALT+F2 when the little white box appears : it will make OS/2 tell what driver it is currently loading. 
You can hook an ASCII terminal on the COM2 port (for instance a PC with a terminal emulator, and a null-modem cable), ext2-os2 will write debug information on COM2 port during the boot process. 

Linux ext2 file system utilities

e2fsck - check a Linux second extended file system

This program is also available through the standard CHKDSK command, with the same syntax described below.

synopsis

       e2fsck  [  -pacnyrdfvstFSV ] [ -b superblock ] [ -B block-
       size ] [ -l|-L bad_blocks_file ] device

description

       e2fsck is used to check a Linux second extended file  sys-
       tem.
       device is  the  special  file  corresponding to the device
              (e.g /dev/hdXX on Linux, X: on OS/2).

options

       -a     This option does the same thing as the  -p  option.
              It is provided for backwards compatibility only; it
              is suggested that people use -p option whever  pos-
              sible.
       -b superblock
              Instead  of  using  the  normal superblock, use the
              alternative superblock specified by superblock.
       -B blocksize
              Normally, e2fsck will search for the superblock  at
              various different block sizes in an attempt to find
              the appropriate block size.   This  search  can  be
              fooled in some cases.  This option forces e2fsck to
              only try locating the superblock  at  a  particular
              blocksize.   If the superblock is not found, e2fsck
              will terminate with a fatal error.
       -c     This option causes e2fsck to run  the  badblocks(8)
              program  to  find  any  blocks which are bad on the
              filesystem, and then marks them as  bad  by  adding
              them to the bad block inode.
       -d     Print  debugging  output  (useless  unless  you are
              debugging e2fsck ).
       -f     Force checking even if the file system seems clean.
       -F     Flush  the filesystem device's buffer caches before
              beginning.  Only really  useful  for  doing  e2fsck
              time trials.
       -l filename
              Add  the  blocks  listed  in  the file specified by
              filename to the list of bad blocks.
       -L filename
              Set the bad blocks list to be the  list  of  blocks
              specified by filename.  (This option is the same as
              the -l  option,  except  the  bad  blocks  list  is
              cleared  before  the  blocks listed in the file are
              added to the bad blocks list.)
       -n     Open the filesystem read-only, and assume an answer
              of  ``no''  to  all questions.  Allows e2fsck to be
              used non-interactively.  (Note: if the -c,  -l,  or
              -L  options  are  specified  in  addition to the -n
              option, then the filesystem will  be  opened  read-
              write, to permit the bad-blocks list to be updated.
              However, no other  changes  will  be  made  to  the
              filesystem.)
       -p     Automatically  repair  ("preen")  the  file  system
              without any questions.
       -r     This option does nothing at  all;  it  is  provided
              only for backwards compatibility.
              -s  This  option  will  byte-swap the filesystem so
              that it is using  the  normalized,  standard  byte-
              order  (which  is  i386  or little endian).  If the
              filesystem is already in the  standard  byte-order,
              e2fsck will take no action.
       -S     This  option will byte-swap the filesystem, regard-
              less of its current byte-order.
       -t     Print timing statistics for e2fsck.  If this option
              is  used  twice,  additional  timing statistics are
              printed on a pass by pass basis.
       -v     Verbose mode.
       -V     Print version information and exit.
       -y     Assume an  answer  of  ``yes''  to  all  questions;
              allows e2fsck to be used non-interactively.

exit code

       The exit code returned by e2fsck is the sum of the follow-
       ing conditions:
            0    - No errors
            1    - File system errors corrected
            2    - File system errors corrected, system should
                   be rebooted if file system was mounted
            4    - File system errors left uncorrected
            8    - Operational error
            16   - Usage or syntax error
            128  - Shared library error

reporting bugs

       Almost any piece of software will have bugs.  If you  man-
       age  to find a filesystem which causes e2fsck to crash, or
       which e2fsck is unable to repair, please report it to  the
       author.
       Please include as much information as possible in your bug
       report.  Ideally, include a  complete  transcript  of  the
       e2fsck  run,  so I can see exactly what error messages are
       displayed.  If you have a writeable filesystem  where  the
       transcript can be stored, the script(1) program is a handy
       way to save the output of to a file.
       It is also useful to send the output of dumpe2fs(8).  If a
       specific  inode  or inodes seems to be giving e2fsck trou-
       ble, try running the debugfs(8) command and send the  out-
       put  of the stat command run on the relevant inode(s).  If
       the inode is a directory, the debugfs  dump  command  will
       allow  you to extract the contents of the directory inode,
       which can sent to me after being first run  through  uuen-
       code(1).
       Always  include  the full version string which e2fsck dis-
       plays when it is run, so I know which version you are run-
       ning.

author

       This  version  of  e2fsck  is  written  by  Theodore  Ts'o
       <tytso@mit.edu>.

see also

       mke2fs(8), tune2fs(8), dumpe2fs(8), debugfs(8)

mke2fs - create a Linux second extended file system

This program is also available through the standard FORMAT command, with the same syntax described below.

synopsis

       mke2fs  [  -c | -l filename ] [ -b block-size ] [ -f frag-
       ment-size ] [ -i bytes-per-inode ] [  -m  reserved-blocks-
       percentage  ]  [ -o creator-os ] [ -q ] [ -v ] [ -F ] [ -L
       volume-label ] [ -M last-mounted-directory ] [ -S ] device
       [ blocks-count ]

description

mke2fs is used to create a Linux second extended file system on a device (usually a disk partition).

device is the special file corresponding to the device (e.g /dev/hdXX).

blocks-count is the number of blocks on the device. If omitted, mke2fs automatically figures the file system size.

Note : On OS/2, device is actually the drive letter of the partition to be formatted (e.g X:)

options

       -b block-size
              Specify the size of blocks in bytes.
       -c     Check the device for bad blocks before creating the
              file system, using a fast read-only test.

Warning : On OS/2 this option is invalid : badblocks must be run separately

Warning : and its ouput must be passed to mke2fs through the -l switch. -f fragment-size Specify the size of fragments in bytes. -i bytes-per-inode Specify the bytes/inode ratio. mke2fs creates an inode for every bytes-per-inode bytes of space on the disk. This value defaults to 4096 bytes. bytes-per-inode must be at least 1024. -l filename Read the bad blocks list from filename -m reserved-blocks-percentage Specify the percentage of reserved blocks for the super-user. This value defaults to 5%. -o Manually override the default value of the "creator os" field of the filesystem. Normally the creator field is set by default to the native OS of the mke2fs executable. -q Quiet execution. Useful if mke2fs is run in a script. -v Verbose execution. -F Force mke2fs to run, even if the specified device is not a block special device. -L Set the volume label for the filesystem. -M Set the last mounted directory for the filesystem. This might be useful for the sake of utilities that key off of the last mounted directory to determine where the filesytem should be mounted. -S Write superblock and group descriptors only. This is useful if all of the superblock and backup superblocks are corrupted, and a last-ditch recov- ery method is desired. It causes mke2fs to reini- tialize the superblock and group descriptors, while not touching the inode table and the block and inode bitmaps. The e2fsck program should be run immediately after this option is used, and there is no guarantee that any data will be salvageable.

author

       This version of mke2fs has been written by  Theodore  Ts'o
       <tytso@mit.edu>.

bugs

       mke2fs  accepts  the  -f  option  but currently ignores it
       because the second extended file system does  not  support
       fragments yet.
       There  may be some other ones.  Please, report them to the
       author.

availability

       mke2fs is available for anonymous ftp from ftp.ibp.fr  and
       tsx-11.mit.edu in /pub/linux/packages/ext2fs.

see also

       dumpe2fs(8), e2fsck(8), tune2fs(8)

badblocks - search a device for bad blocks

synopsis

       badblocks [ -b block-size ] [ -o output_file ] [ -v ] [ -w
       ] device blocks-count

description

       badblocks is used to search for bad  blocks  on  a  device
       (usually a disk partition).
       device  is  the  special  file corresponding to the device
       (e.g /dev/hdXX).
       blocks-count is the number of blocks on the device.

options

       -b block-size
              Specify the size of blocks in bytes.
       -o output_file
              Write the list of bad blocks to the specified file.
              Without this option, badblocks displays the list on
              its standard output.
       -v     Verbose mode.
       -w     Use write-mode test. With  this  option,  badblocks
              scans  for  bad  blocks  by  writing  some patterns
              (0xaa, 0x55, 0xff, 0x00)  on  every  block  of  the
              device,  reading every block and comparing the con-
              tents.

warning

       Never use the `-w'  option  on  an  device  containing  an
       existing file system.  This option erases data!

author

       badblocks     has    been    written    by    Remy    Card
       <card@masi.ibp.fr>, the developer and  maintainer  of  the
       ext2 fs.

bugs

       I  had no chance to make reals tests of this program since
       I use IDE drives which remap bad blocks. I only made  some
       tests on floppies.

availability

       badblocks  is  available for anonymous ftp from ftp.ibp.fr
       and tsx-11.mit.edu in /pub/linux/packages/ext2fs.

see also

       e2fsck(8), mke2fs(8)

Other useful utilities

Note : These utilities require the EMX runtime library (it can be found at ftp://ftp-os2.nmsu.edu/os2/unix/emx09c/emxrt.zip).

sync - commits data to disk

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

Invocation :

sync

Note : This utility will only commit data located on Linux ext2fs partitions. It does NOT work on other file systems.

umount - detaches the current file system from a disk

unmount.exe will cleanly unmount a drive by committing all data and detaching the file system currently attached to it. After this operation, the OS/2 drive letter is still present, but the drive cannot be accessed. This utility issues a true unmount of the file system from the drive (eg it's a real unmount, not a hack, by calling the IFS's FS_MOUNT entry point).

Invocation :

umount X:

X: is the drive to be unmounted. If successful, the drive X: can no longer be accessed. Fo instance typing "dir X:" should give the following message : "SYS0026: The specified disk or diskette cannot be accessed.". If the media is removable, it can be safely removed or ejected.

Warning : *** NEVER *** run any programs that directly access drives on a drive previously unmounted with unmount.exe. Most of these programs blindly assume the drive is formatted as FAT and thus can cause massive loss of data. These programs include :

Remember the main purpose of unmount.exe is to remove the media right after !

remount - attaches a file system to a disk

remount.exe will force OS/2 to reattach a file system to the specified drive. If a file system was already attached, it will be detached first. remount.exe can be called to be able to gain access to a drive previously unmounted with unmount.exe.

Invocation :

remount X:

X: is the drive to be remounted. If successful, the drive X: can then be accessed normally.

hardlink - creates a hard link to an existing file

hardlink is a small replacement of the UNIX "ln" command. Its purpose is to create a hard link to an existing file.

Invocation :

hardlink <oldname> newname

This will creates newname linked to the file oldname.

Frequently Asked Questions (FAQ)

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
  5. From 0.5 to 0.6
  6. From 0.6 to 0.7
  7. From 0.7 to 0.8
  8. From 0.8 to 0.9
  9. From 0.9 to 2.0
  10. From 2.0 to 2.1
  11. From 2.1 to 2.2
  12. From 2.2 to 2.3

From 0.1 to 0.2

From 0.2 to 0.3

From 0.3 to 0.4

From 0.4 to 0.5

From 0.5 to 0.6

From 0.6 to 0.7

From 0.7 to 0.8

From 0.8 to 0.9

From 0.9 to 2.0

From 2.0 to 2.1

From 2.1 to 2.2

From 2.2 to 2.3

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
  2       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
  2       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
  2       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. The default value is 240 Kb. The minimum value is 240Kb. The maximum value depends on system resources (free physical memory).

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 - BEFORE ENABLING WRITE ACCESS, REMEMBER THAT DOING REGULAR BACKUPS IS NEVER A BAD PRACTICE !!!

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 on fixed disks 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

[-errors=[panic|continue]] : specifies the behaviour to adopt when the ext2fs file system code detects an error within the file system. "panic" halts the system, "continue" makes ext2-os2 only output a message in ext2-os2.exe and continue. Default is "continue" (like Linux).

Note : If a system halt occurs with a message beginning with "ext2-os2 detected a file system error on drive %c", it means that the ext2fs file system code found a file system corruption. You MUST run e2fsck from Linux to repair your file system. This type of error is generally not specific to ext2-os2, but the error would also have occured on Linux. "-errors=continue" will avoid a system halt and just mark the file system as bad (forcing e2fsck on next Linux boot) ; but if you continue to work intensively after a file system error, you are likely to spread the error and make things even worse.

FootNote 13

[-output=[com1|com2]] : Makes ext2-os2 write its messages on COM1 or COM2 port in addition to the ext2-os2 monitor.

Note : Output to COM ports has a performance hit, but can be necessary for tracing or debugging in some cases.

FootNote 14

[-tz:<time zone in minutes from UTC>] : Sets the time zone to be taken into account for file dates and times. Please read Time zone considerations.

FootNote 15

[-force_strat2:<removable drive number to be forced to use strat 2 I/O>]

Force a removable media to use strategy 2 I/O (if available). Normally ext2-os2 uses strategy 2 I/O only for fixed disks. For certain large removable media like MO drives or PCMCIA hard drives which are seen by OS/2 as large floppies (and thus cannot be formatted as HPFS, nor use lazy writes), using strategy 2 I/O can DRAMATICALLY improve performance. But you MUST leave the drive in its media and NEVER remove it while running. If you want to remove the drive anyway, you MUST unmount it first using the unmount.exe utility. This option can make sense for a PCMCIA drive (for instance I have a Thinkpad with a 260 Mb PCMCIA hard disk. I use this option to speed up access to this drive).

Note : The drive number on the command line is 0 based : 0 means 'A', 1 means 'B' and so on.

FootNote 16

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

FootNote 17

/V : Verbose install. Displays some diagnostic messages.

FootNote 18

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

FootNote 19

/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 20

/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 21

IBM Visualage C++ version 3.0 for OS/2.

Note : The CSD CTC305 is highly recommended.

FootNote 22

IBM Assembly Language Processor (ALP) version 4.00.

Note : Earlier versions of ALP will NOT work.

FootNote 23

Microsoft Visual C++ 1.51.

Note : This is actually MSC version 8.0c and is available as the 16 bits compiler in the MS Visual C++ 2.0 package.

FootNote 24

Borland C++ version 4

FootNote 25

Microsoft Assembler (MASM) 5.10A.15

Note : This is the version of MASM included in the DevCon DDK.

FootNote 26

Borland Turbo Assembler (available with Borland C++ 4)

FootNote 27

IBM Linker for OS/2 (ILink) version 1.

Note : This is the version of ILINK included in the IBM Visualage C++ package, with CSD CTC305 installed (ILINK version 01.04.r1a_CTC305A).

FootNote 28

Microsoft Linker (LINK) version 5.6.

Note : This is the version of LINK included in the Microsoft Visual C++ version 2.0 package.

FootNote 29

linux fdisk 3.04 output for disk 1 (this is actually an OS/2 port of fdisk : 1:1 means /dev/hda1 and so on) :

fdisk -uS -l 1:
Disk 1:: 6 heads, 35 sectors, 978 cylinders
Units = sectors of 512 bytes, counting from 0
   Device Boot    Start       End  #sectors  Id  System
      1:1          2100    104579    102480  83  Linux native
      1:2   *        35      2099      2065   a  OS/2 Boot Manager or Coherent swap
      1:3        104580    205379    100800   7  OS/2 IFS (e.g., HPFS) or NTFS or QNX2 or Advanced UNIX
      1:4             0         -         0   0  Empty

OS/2 fdisk output for disk 1 :

FDISK /QUERY /DISK:1
Drive Name  Partition Vtype FStype Status   Start     Size
    1              :    1    0a      2          0        1
    1 Linux        :    1    83      1          1       50
    1 test        C:    1    07      5         51       49
                                             **BIOS:1024MB

FootNote 30

linux fdisk 3.04 output for disk 2 (this is actually an OS/2 port of fdisk : 1:1 means /dev/sda1 and so on) :

fdisk -uS -l 2:
Disk 2:: 64 heads, 32 sectors, 1169 cylinders
Units = sectors of 512 bytes, counting from 0
   Device Boot    Start       End  #sectors  Id  System
      2:1        163840   2095103   1931264   7  OS/2 IFS (e.g., HPFS) or NTFS or QNX2 or Advanced UNIX
      2:2   *        32    163839    163808  17  OS/2 BM: hidden IFS
      2:3       2095104   2394111    299008   5  DOS Extended
      2:4             0         -         0   0  Empty
      2:5   *   2095136   2394111    298976   7  OS/2 IFS (e.g., HPFS) or NTFS or QNX2 or Advanced UNIX

OS/2 fdisk output for disk 2 :

FDISK /QUERY /DISK:2
Drive Name  Partition Vtype FStype Status   Start     Size
    2 ext2-os2     :    1    17      3          0       80
    2 Warp        D:    1    07      1         80      943
    2 001ff820    E:    2    07      0       1023      146
                                             **BIOS:1024MB

FootNote 31

#
# Start LILO global section
#
boot = /dev/hda1       # install LILO in the superblock of /dev/hda1.
vga = normal           # force sane state
ramdisk = 0            # paranoia setting
prompt
#
# End LILO global section
#
# Linux bootable partition config begins
image = /vmlinuz
  root = /dev/hda1
  label = linux
  read-only            # Non-UMSDOS filesystems should be mounted read-only for checking
# Linux bootable partition config ends

FootNote 32

Here's a brief description of what to do to install a WPS enabled system with BOOTOS2 on a LInux ext2fs partition, and put the WPS desktop tree on a HPFS or FAT partition (assume we want to store the WPS tree in D:\tmp\desktop) :

  1. Go to the OS2 directory of your boot drive and make a copy of the file named INI.RC (for instance TEST.RC)
  2. Edit TEST.RC as follows :

    Locate a line of the form

      "PM_InstallObject" "Desktop;WPDesktop;?:\" "OBJECTID=<WP_DESKTOP>"
    
  3. and replace it with
      "PM_InstallObject" "Desktop;WPDesktop;D:\tmp\desktop" "OBJECTID=WP_DESKTOP"
    

    Locate a line of the form

      "PM_InstallObject" "Nowhere;WPFolder;?:\"  "OBJECTID=WP_NOWHERE"
    
  4. and replace it with
      "PM_InstallObject" "Nowhere;WPFolder;D:\tmp\nowhere"  "OBJECTID=WP_NOWHERE"
    
  5. Reboot OS/2 FROM FLOPPIES
  6. Press F3 to go to a command prompt. At the command prompt, go to the OS2 directory of your hard drive and type :
    MAKEINI BOS2U300.INI TEST.RC
    
  7. Reboot OS/2 normally
  8. Go to your BOOTOS2 directory and replace BOS2U300.INI with the one we've created.
  9. To install a WPS enabled system type the following command :
    BOOTOS2 TARGET=F TYPE=WPS