•  Back 
  •  GEMDOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FileBconmap()
Fcntl()
Dcntl()                                                              GEMDOS

Syntax

LONG Dcntl( cmd, name, arg )
WORD cmd;
char *name;
LONG arg;

Function      Dcntl() performs file system specific operations on
              directories or files.

Opcode        304 (0x130)

Availability  Available when a 'MiNT' cookie with a version of at least
              0.90 exists.

Parameters    The only two built-in file systems that support Dcntl()
              calls are 'U:\' and 'U:\DEV.' cmd specifies what operation
              to perform and affects the meaning of name and arg. Valid
              cmd arguments for 'U:\' are

              cmd             Meaning

              FS_INSTALL      This mode installs a new file system. name
              (0xF001)        must be 'U:\' and arg should point to
                              a fs_descr structure as follows:

                              struct fs_descr
                              {
                               FILESYS *file_system;
                               WORD    dev_no;
                               LONG    flags;
                               LONG    reserved[4];
                              };

                              If this call is successful, a pointer to
                              a kerinfo structure is returned, otherwise
                              the return value is NULL. The file system
                              itself is not accessible until this call is
                              made and it is mounted with FS_MOUNT.

              FS_MOUNT        This mode mounts an instance of an installed
              (0xF002)        file system. name should be in the format
                              'U:\???' where '???' is the name which the
                              file system will be accessed by. arg should
                              point to the fs_descr structure as above. If
                              the file system is mounted correctly, the
                              dev_no field will be updated to reflect the
                              instance number of the mount (file systems
                              may be mounted multiple times).

              FS_UNMOUNT      This mode unmounts an instance of a file
              (0xF003)        system. name is the name of the file system
                              in the form 'U:\???' where '???' is the name
                              of the file system instance. arg should
                              point to the file system fs_descr structure.

              FS_UNINSTALL    This mode uninstalls a file system
              (0xF004)        identified by the fs_descr structure passed
                              in arg. A file system can only be
                              sucessfully uninstalled after all instances
                              of it have been unmounted. name should be
                              'U:\'.

              Valid cmd arguments for 'U:\DEV' are:

              cmd             Meaning

              DEV_INSTALL     This command attempts to install a device
              (0xDE02)        driver. name should be in the format
                              'U:\DEV\???' where '???' is the name of the
                              device to install. arg is a pointer to
                              a dev_descr structure as follows:

                              struct dev_descr
                              {
                               /* Pointer to a device driver structure */
                               DEVDRV *driver;
                               /* Placed in aux field of file cookies */
                               WORD dinfo;
                               /* 0 or O_TTY (0x2000) for TTY */
                               WORD flags;
                               /* If O_TTY is set, points to tty struct */
                               struct tty *tty;
                               /* Reserved for future expansion */
                               LONG reserved[4];
                              }

                              If the device is successfully installed,
                              Dcntl() will return a pointer to a kerinfo
                              structure which contains information about
                              the kernel. On failure, Dcntl() will return
                              NULL. See the section on loadable file
                              systems earlier in this chapter for more
                              information.

              DEV_NEWTTY      This command identifies a BIOS terminal
              (0xDE00)        device whose name is name (in the form
                              'U:\DEV\DEVNAME' and whose device number is
                              arg. This call simply makes the MiNT kernel
                              aware of the device. It should have been
                              previously installed by Bconmap(). Any
                              attempt to access the device prior to
                              installing it with the BIOS will result in
                              an EUNDEV (-15) unknown device error. If
                              the device is installed, Dcntl() returns a 0
                              or positive value. A negative return code
                              signifies failure.

              DEV_NEWBIOS     This command is the same as DEV_NEWTTY
              (0xDE01)        except that it is designed for devices which
                              must have their data transmitted raw (SCSI
                              devices, for example).

Binding       move.l   arg,-(sp)
              pea      name
              move.w   cmd,-(sp)
              move.w   #$130,-(sp)
              trap     #1
              lea      12(sp),sp

Version       The FS_ group of cmd arguments are only available as of MiNT
Notes         version 1.08. Due to a bug in MiNT versions 1.08 and below,
              calling this function with a parameter of DEV_NEWBIOS will
              not have any effect.

Return Value  See above.

See Also      Bconmap(), Fcntl()