IFS - FSD Initialization
Installable File Systems for OS/2 |
---|
Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation
FSD initialization occurs at system initialization time. FSDs are loaded through the IFS= configuration command in CONFIG.SYS. Once the FSD has been loaded, the FSD's initialization entry point is called to initialize it.
FSDs are structured the same as dynamic link library modules. Once an FSD is loaded, the initialization routine FS_INIT is called. This gives the FSD the ability to process any parameters that may appear on the CONFIG.SYS command line, which are passed as a parameter to the FS_INIT routine. A LIBINIT routine in an FSD will be ignored.
OS/2 FSDs initialize in protect mode. Because of the special state of the system, an FSD may make dynamic link system calls at init-time.
The list of systems calls that an FSD may make are as follows:
- DosBeep
- DosChgFilePtr
- DosClose
- DosDelete
- DosDevConfig
- DosDevIOCtl
- DosFindClose
- DosFindFirst
- DosFindNext
- DosGetEnv
- DosGetInfoSeg
- DosGetMessage
- DosOpen
- DosPutMessage
- DosQCurDir
- DosQCurDisk
- DosQFileInfo
- DosQFileMode
- DosQSysInfo
- DosRead
- DosWrite
The FSD may not call ANY FS helper routines at initialization time.
Note that multiple code and data segments are not discarded by the loader as in the case of device drivers.
The FSD may call DosGetInfoSeg to obtain access to the global and process local information segments. The local segment may be used in the context of all processes without further effort to make it accessible and has the same selector. The local infoseg is not valid in real mode or at
OS/2 and DOS Extended Boot Structure and BIOS Parameter Block
The Extended Boot structure is as follows:
struct Extended_Boot { unsigned char Boot_jmp[3]; unsigned char Boot_OEM[8]; struct Extended_BPB Boot_BPB; unsigned char Boot_DriveNumber; unsigned char Boot_CurrentHead; unsigned char Boot_Sig = 41; /* Indicate Extended Boot */ unsigned char Boot_Serial[4]; unsigned char Boot_Vol_Label[11]; unsigned char Boot_System_ID[8]; };
Where
Boot_Serial is the 32-bit binary volume serial number for the media.
Boot_System_ID is an 8-byte name written when the media is formatted. It is used by FSDs to identify their media but need not be the same as the name the FSD exports via FS_NAME and is NOT the name users employ to refer to the FSD. ( They may, however, be the same names).
Boot_Vol_Label is the 11-byte ASCII label of the disk/diskette volume. FAT file systems must ALWAYS use the volume label in the root directory for compatibility reasons. An FSD may use the one in the boot sector.
The extended BPB structure is a super-set of the conventional BPB structure, as follows:
struct Extended_BPB { unsigned short BytePerSector; unsigned char SectorPerCluster; unsigned short ReservedSectors; unsigned char NumberOfFats; unsigned short RootEntries; unsigned short TotalSectors; unsigned char MediaDescriptor; unsigned short SectorsPerFat; unsigned short SectorsPerTrack; unsigned short Heads; unsigned long HiddenSectors; unsigned long Ext_TotalSectors; };