32 bits Linux ext2 file system driver for OS/2
EXT2-OS2 VERSION 2.40
Copyright (C) Matthieu WILLM 1995, 1996, 1997 (willm@ibm.net)
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). Here are the main features of ext2-os2 :
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
Note : English is not my native language (I'm french) ... so this document isn't certainly perfect.
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.
From experience, ext2-os2 is now stable for normal use, and it is unlikely that a disaster will occur. But as any piece of software, it cannot be bulletproof. Doing regular backups is still the best method to protect against disasters of any kinds ...
Copyright notice for the ext2fs IFS driver Copyright notice for the ext2fs partition filter Authors of the original Linux ext2 file system
32 bits Linux ext2fs file system driver for OS/2 WARP - Allows OS/2 to access your Linux ext2fs partitions as normal drive letters. Copyright (C) 1995, 1996, 1997 Matthieu WILLMThis 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.
/************************************************************************/ /* 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. */ /* */ /************************************************************************/
Parts of the ext2-os2 package are based on GNU GPL copyrighted code whose owners are :
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
Here are things you must do before installing this version of ext2-os2 :
This chapter describes how to make OS/2 see your Linux ext2fs partitions
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
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
ext2flt installation
BASEDEV=EXT2FLT.FLT
ext2-os2 installation
BASEDEV=MWDD32.SYS
IFS=path\ext2-os2.ifs -cache:256 -errors=continue RUN=path\ext2_lw.exe
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.
ext2-os2.exe is a monitoring tool to retrieve data from ext2-os2.ifs. It is a PM notebook containing :
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]
This chapter describes some imortant usage instructions.
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.
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.
ext2-os2 fatal errors can appear in several forms :
In either case, your ext2fs partition is in great danger ; To minimize the risk of data loss, please do the following :
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 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:
This has been reported by Steve Enns (ennss@eris.nhrc.sk.doe.ca)
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 :
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 ?).
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).
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...
This chapter describes how to build the IFS.
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 :
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 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.
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.
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.
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).
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).
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 !
Assume you have an OS/2 system with Boot Manager installed. Here's a simplified HPFS boot sequence :
As you can see, the OS/2 kernel doesn't know anything about HPFS. It even makes no assumption of booting off of disk.
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.
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.
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) :
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)
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
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:\ :
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
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 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.
This program is also available through the standard CHKDSK command, with the same syntax described below.
e2fsck [ -pacnyrdfvstFSV ] [ -b superblock ] [ -B block- size ] [ -l|-L bad_blocks_file ] device
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).
-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.
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
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.
This version of e2fsck is written by Theodore Ts'o <tytso@mit.edu>. It has been ported to OS/2 by Matthieu Willm.
mke2fs(8), tune2fs(8), dumpe2fs(8), debugfs(8)
This program is also available through the standard FORMAT command, with the same syntax described below.
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 ]
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:)
-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. -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.
This version of mke2fs has been written by Theodore Ts'o <tytso@mit.edu>. It has been ported to OS/2 by Matthieu Willm.
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.
mke2fs is available for anonymous ftp from ftp.ibp.fr and tsx-11.mit.edu in /pub/linux/packages/ext2fs.
dumpe2fs(8), e2fsck(8), tune2fs(8)
badblocks [ -b block-size ] [ -o output_file ] [ -v ] [ -w ] device blocks-count
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.
-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.Note : The -w option is not yet implemented on OS/2.
Never use the `-w' option on an device containing an existing file system. This option erases data!
badblocks has been written by Remy Card <card@masi.ibp.fr>, the developer and maintainer of the ext2 fs. It has been rewritten to OS/2 by Matthieu Willm.
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.
badblocks is available for anonymous ftp from ftp.ibp.fr and tsx-11.mit.edu in /pub/linux/packages/ext2fs.
e2fsck(8), mke2fs(8)
debugfs [ -w ] [ -f cmd_file ] [ -R request ] [ device ]
The debugfs program is a file system debugger. It can be used to examine and change the state of an ext2 file sys- tem. device is the special file corresponding to the device containing the ext2 file system (e.g /dev/hdXX).
-w Specify that the file system should be open in read-write mode. Without this option, the file sys- tem is open in read-only mode. -f cmd_file Causes debugfs to read in commands from cmd_file, and execute them. When debugfs is finsihed execut- ing those commands, it will exit. -R request Causes debugfs to execute the single command request, and then exit.
debugfs is an interactive debugger. It understands a num- ber of commands. cat filespec Dump the contents of the inode filespec to stdout. cd filespec Change the current working directory to filespec. chroot filespec Change the root directory to be the directory file- spec. close Close the currently open file system. clri file Clear the contents of the inode file. dump [-p] filspec out_file Dump the contents of the inode filespec to the out- put file out_file. If the -p option is given set the owner, group and permissions information on out_file to match filespec. expand_dir filespec Expand the directory filespec. find_free_block [goal] Find the first free block, starting from goal and allocates it. find_free_inode [dir [mode]] Find a free inode and allocates it. If present, dir specifies the inode number of the directory which the inode is to be located. The second optional argument mode specifies the permissions of the new inode. (If the directory bit is set on the mode, the allocation routine will function differ- ently.) freeb block Mark the block number block as not allocated. freei filespec Free the inode specified by filespec help Print a list of commands understood by debugfs(8). icheck block ... Print a listing of the inodes which use the one or more block specified on the command line. initialize device blocksize Create an ext2 file system on device with device size blocksize. Note that this does not fully ini- tialize all of the data structures; to do this, use the mke2fs(8) program. This is just a call to the low-level library, which sets up the superblock and block descriptors. kill_file filespec Dellocate the inode filespec and its blocks. Note that this does not remove any directory entries (if any) to this inode. See the rm command if you wish to unlink a file. ln filespec dest_file Create a link named dest_file which is a link to filespec. Note this does not adjust the inode ref- erence counts. ls [-l] filespec Print a listing of the files in the directory file- spec. modify_inode filespec Modify the contents of the inode structure in the inode filespec. mkdir filespec Make a directory. mknod filespec [p|[[c|b] major minor]] Create a special device file (a named pipe, charac- ter or block device). If a character or block device is to be made, the major and minor device numbers must be specified. ncheck inode_num ... Take the requested list of inode numbers, and print a listing of pathnams to those inodes. open [-w] device Open a file system for editing. pwd Print the current working directory. quit Quit debugfs rm pathname Unlink pathname. If this cuases the inode pointed to by pathname to have no other references, deallo- cate the file. This command functions as the unlink() system call. rmdir filespec Remove the directory filespec. This function is currently not implemented. setb block Mark the block number block as allocated. seti filespec Mark inode filespec as in use in the inode bitmap. show_super_stats List the contents of the super block. stat filespec Display the contents of the inode structure of the inode filespec. testb block Test if the block number block is marked as allo- cated in the block bitmap. testi filespec Test if the inode filespec is marked as allocated in the inode bitmap. unlink pathname Remove the link specified by pathname to an inode. Note this does not adjust the inode reference counts. write source_file out_file Create a file in the filesystem named out_file, and copy the contents of source_file into the destina- tion file.
Many debugfs commands take a filespec as an argument to specify an inode (as opposed to a pathname) in the filesystem which is currently opened by debugfs. The file- spec argument may be specified in two forms. The first form is an inode number surrounded by angle brackets, e.g., <2>. The second form is a pathname; if the pathname is prefixed by a forward slash ('/'), then it is inter- preted relative to the root of the filesystem which is currently opened by debugfs. If not, the pathname is interpreted relative to the current working directory as maintained by debugfs. This may be modified by using the debugfs command cd.
debugfs was written by Theodore Ts'o <tytso@mit.edu>.
dumpe2fs(8), e2fsck(8), mke2fs(8)
chattr [ -RV ] [ -v version ] [ mode ] files...
chattr changes the files attributes on an second extended file system. The format of a symbolic mode is +-=[ASacdisu]. The operator `+' causes the selected attributes to be added to the existing attributes of the files; `-' causes them to be removed; and `=' causes them to be the only attributes that the files have. The letters `ASacdisu' select the new attributes for the files: don't update atime (A), synchronous updates (S), append only (a), compressed (c), immutable (i), no dump (d), secure deletion (s), and undeletable (u).
-R Recursively change attributes of directories and their contents. -V Verbosely describe changed attributes. -v version Set the files version.
When a file with the 'A' attribute set is modified, its atime record is not modified. This avoid a certain amount of disk I/O for laptop systems. A file with the `a' attribute set can only be open in append mode for writing. A file with the `c' attribute set is automatically com- pressed on the disk by the kernel. A read from this file returns uncompressed data. A write to this file compresses data before storing them on the disk. A file with the `d' attribute set is not candidate for backup when the dump(8) program is run. A file with the `i' attribute cannot be modified: it can- not be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser can set or clear this attribute. When a file with the `s' attribute set is deleted, its blocks are zeroed and written back to the disk. When a file with the `S' attribute set is modified, the changes are written synchronously on the disk; this is equivalent to the `sync' mount option applied to a subset of the files. When a file with the `u' attribute set is deleted, its contents is saved. This allows the user to ask for its undeletion.
chattr has been written by Remy Card <card@masi.ibp.fr>, the developer and maintainer of the ext2 fs. It has been ported to OS/2 by Matthieu Willm willm@ibm.net.
As of ext2 fs 0.5a, the `c' and `u' attribute are not hon- oured by the kernel code. As of the Linux 2.0 kernel, the 'A' attribute is not yet supported by the kernel code. (The noatime code is still in testing.) These attributes will be implemented in a future ext2 fs version.
chattr is available for anonymous ftp from ftp.ibp.fr and tsx-11.mit.edu in /pub/linux/packages/ext2fs.
lsattr(1)
lsattr [ -Radv ] [ files... ]
lsattr lists the file attributes on a second extended file system.
-R Recursively list attributes of directories and their contents. -a List all files in directories, including files that start with `.'. -d List directories like other files, rather than listing their contents. -v List the files version.
lsattr has been written by Remy Card <card@masi.ibp.fr>, the developer and maintainer of the ext2 fs. It has been ported to OS/2 by Matthieu Willm willm@ibm.net
There are none :-).
lsattr is available for anonymous ftp from ftp.ibp.fr and tsx-11.mit.edu in /pub/linux/packages/ext2fs.
chattr(1)
tune2fs [ -l ] [ -c max-mount-counts ] [ -e errors-behav- ior ] [ -i interval-between-checks ] [ -m reserved-blocks- percentage ] [ -r reserved-blocks-count ] [ -s sparse- super-flag ] [ -u user ] [ -g group ] [ -C mount-count ] [ -L volume-name ] [ -M last-mounted-directory ] [ -U UUID ] device
tune2fs adjusts tunable filesystem parameters on a Linux second extended filesystem. Never use tune2fs on a read/write mounted filesystem to change parameters!
-c max-mount-counts adjust the maximal mounts count between two filesystem checks. -e errors-behavior change the behavior of the kernel code when errors are detected. errors-behavior can be one of the followings: continue Continue normal execution. remount-ro Remount the filesystem read- only. panic Causes a kernel panic. -g group set the user group which can benefit from the reserved blocks. group can be a numerical gid or a group name. -i interval-between-checks[d|m|w] adjust the maximal time between two filesystem checks. No postfix or `d' result in days, `m' in months, and `w' in weeks. A value of zero will disable the timedependent checking. -l list the contents of the filesystem superblock. -m reserved-blocks-percentage adjust the reserved blocks percentage on the given device. -r reserved-blocks-count adjust the reserved blocks count on the given device. -s sparse_super_flag sets and resets the sparse_superblock flag. The sparse_superblock feature saves space on really big filesystems. Warning: The Linux 2.0 kernel does not properly support this feature. Neither do all Linux 2.1 kernels; please don't use this unless you know what you're doing! -u user set the user who can benefit from the reserved blocks. user can be a numerical uid or a user name. -C mount-count set the number of times the filesys- tem has been mounted. -L volume-label set the volume label of the filesystem. -M last-mounted-directory set the last-mounted direcctory for the filesystem. -U UUID set the UUID of the filesystem. A sample UUID looks like this: "c1b9d5a2-f162-11cf-9ece-0020afc76f16". The uuid may also be "null", which will set the filesystem UUID to the null UUID. The uuid may also be "ran- dom", which will generate a new random UUID for the filesystem.
We didn't find any bugs yet. Perhaps there are bugs but it's unlikely.
Use this utility on your own risk. You're modifying filesystems.
tune2fs has been written by Remy Card <card@masi.ibp.fr>, the developer and maintainer of the ext2 fs. tune2fs uses the ext2fs library written by Theodore Ts'o tytso@mit.edu. This manual page was written by Christian Kuhtz chk@data- hh.Hanse.DE. Timedependent checking was added by Uwe Ohse uwe@tirka.gun.de. tune2fs has been ported to OS/2 by Matthieu Willm willm@ibm.net
tune2fs is available for anonymous ftp from ftp.ibp.fr and tsx-11.mit.edu in /pub/linux/packages/ext2fs.
dumpe2fs(8), e2fsck(8), mke2fs(8)
Note : These utilities require the EMX runtime library (it can be found at ftp://ftp-os2.nmsu.edu/os2/unix/emx09c/emxrt.zip).
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.
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.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 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.
Write access must be enabled for BOTH ext2flt.flt (/W switch) AND ext2-os2.ifs (-rw switch) in CONFIG.SYS.
ext2-os2 requires the MWDD32.SYS driver to be loaded. Ensure that you CONFIG.SYS contains a line like :
basedev=mwdd32.sys
You can try to turn on quiet mode on the following drivers :
ext2-os2.ifs (-q switch) mwdd32.sys (-q switch) ext2flt.flt (/Q switch)
The Linux ext2 file system is a case sensitive file system, and this breaks many OS/2 or DOS programs which uppercase or lowercase file names (because FAT and HPFS are NOT case sensitive). The OS/2 program loader itself uppercase file names. To run OS/2 programs from a Linux partition, you must use the -case_retensive switch on the ext2-os2.ifs command line (see Case sensitivity considerations).
There seems to be a problem between EXT2FLT.FLT, and drivers that makes removable devices appear as fixed, like Syquest's SYQLOCK.FLT, IBM's LOCKDRV.FLT and so on. If you have removable media like MO drives, ZIP drives, Syquest drives and so on, try to put EXT2FLT.FLT as the FIRST .FLT driver in config.sys, AHEAD of your vendor's filter driver.
Unfortunately you won't be able to backup a full Linux system from OS/2. This is not a ext2-os2 limitation : your OS/2 XYZ backup software knows NOTHING about UNIX permissions or UNIX special files (symbolic links, fifos, sockets, drivers in /dev), it will not save them and naturally not restore them (your restored system will probably not work).
However, if you intend to backup only data files (for instance a development source tree), and the tree you plan to backup doesn't contain special files, then you can backup them from OS/2. But when you restore, you will have to manually reset UNIX ownership and file permissions using the UNIX commands chown and chmod.
This chapter describes the changes between each release of ext2-os2
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.
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.
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.
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
[-q] : quiet initialization of ext2-os2.ifs (no banner during boot). Default is verbose initialization.
[-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"
[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 !!!
[-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"
[-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 !!!
[-<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 :
[-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.
[-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.
[-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.
[-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.
[-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.
/Q : Quiet install. Prevents the filter from displaying messages.
/V : Verbose install. Displays some diagnostic messages.
/W : Allows the virtual partitions to be written to.
/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.
/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.)
IBM Visualage C++ version 3.0 for OS/2.
Note : The CSD CTC305 is highly recommended.
IBM Assembly Language Processor (ALP) version 4.00.
Note : Earlier versions of ALP will NOT work.
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.
Borland C++ version 4
Microsoft Assembler (MASM) 5.10A.15
Note : This is the version of MASM included in the DevCon DDK.
Borland Turbo Assembler (available with Borland C++ 4)
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).
Microsoft Linker (LINK) version 5.6.
Note : This is the version of LINK included in the Microsoft Visual C++ version 2.0 package.
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
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
# # 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
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) :
Locate a line of the form
"PM_InstallObject" "Desktop;WPDesktop;?:\" "OBJECTID=<WP_DESKTOP>"
"PM_InstallObject" "Desktop;WPDesktop;D:\tmp\desktop" "OBJECTID=WP_DESKTOP"
Locate a line of the form
"PM_InstallObject" "Nowhere;WPFolder;?:\" "OBJECTID=WP_NOWHERE"
"PM_InstallObject" "Nowhere;WPFolder;D:\tmp\nowhere" "OBJECTID=WP_NOWHERE"
MAKEINI BOS2U300.INI TEST.RC
BOOTOS2 TARGET=F TYPE=WPS