I$Detach

From NitrOS-9
Jump to: navigation, search
Detach Device Removes a device from the system device table
OS9 I$Detach 103F 81

Entry Conditions

U address of the device table entry

Error Output

CC carry set on error

B error code, if any

Additional Information

  • The Detach Device call removes a device from both the system and the system device table, assuming the device is not being used by another process. You must use this call to detach devices attached using the Attach system call. Attach and Detach are both used mainly by the I/O manager. SCF also uses Attach and Detach to set up its second device (echo device).
  • This is the sequence of the operation of Detach Device:
    1. Detach Device calls the device driver’s termination routine. Then, NitrOS-9 deallocates any memory assigned to the driver.
    2. NitrOS-9 unlinks the associated device driver and file manager modules.
    3. NitrOS-9 then removes the driver, as long as no other module is using that driver.

IOMan