•  Back 
  •  MagiC's XFS-concept 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File11.5.16.17  xfs_drv_open                                           TOS

 Name:        »xfs_drv_open« - Test/initialize the DMD (Mediach).

 Parameters:

               a0 =     DMD *
               -> d0 =  long errcode

 Description: MagiC supports exactly 26 simultaneously active 
              filesystems that are assigned letters 'A'..'Z'. 
              xfs_drv_open has two tasks:

                1. At the first access to a drive (say D:), the kernel 
                   creates a DMD (drive medium descriptor) and 
                   'offers' this to the XFSs. The entry d_dfs is still 
                   a NULL-pointer, d_drive is initialized (between 0 
                   and 25, corresponding to 'A'..'Z').

                   The DFS drivers now attempt to recognize 'their' 
                   filesystem on the drive. If this succeeds, then 
                   d_xfs and d_root have to be initialized, in which 
                   case the return value is then E_OK. Else EDRIVE is 
                   reported, and the DOS_XFS tries the next DFS.

                   Warning: The root may not be released during the 
                   lifetime of a mounted filesystem. The reference 
                   counter of the root should be preloaded with 1 to 
                   prevent it being released with xfs_freeDD. In the 
                   MagiC versions before 4.01 this was not necessary 
                   because the reference counter (in a 'dirty' way) 
                   was not incremented before the xfs_path2DD call, 
                   nor decremented afterwards.

                2. On subsequent access d_xfs is already initialized, 
                   and the DFS has the opportunity to test for a 
                   medium change. If everything is in order, E_OK has 
                   to be returned. Else the disk medium change routine 
                   of the kernel has to be called and E_CHNG returned. 
                   For this one obtains the pointer to the medium 
                   change routine of the kernel with Dcntl.

              The internal DOS_XFS passes on the call to the DFS 
              function of the same name, i.e. all DFS drivers are 
              tried in turn.

 Group:       Make-up of an XFS

 See also:    MagiC's XFS-concept