Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!kuhub.cc.ukans.edu!markv From: markv@kuhub.cc.ukans.edu Newsgroups: comp.sys.amiga.tech Subject: Re: "Device" vs. "Handler"?? Message-ID: <25339.26d3ba57@kuhub.cc.ukans.edu> Date: 23 Aug 90 16:13:27 GMT References: <082090.120745@ckctpa.UUCP> Organization: University of Kansas Academic Computing Services Lines: 73 In article <082090.120745@ckctpa.UUCP>, crash@ckctpa.UUCP (Frank J. Edwards) writes: > The Subject/Summary lines say it all: what's the difference? I've noticed > that most of the PD-type stuff are handlers, with the notable exception of > the MSH: software. Actually the difference is quite simple. A "device" is an Exec device, like trackdisk.device. It typically is the lowest level of driver above the hardware. In the case of a floppy, the trackdisk.device handles commands like read a block, write a block, etc. It has no knowledge of a file system etc. You have to do I/O to a device at the programming level, via Do/Begin/SendIO and messages. A "handler" is a DOS level driver, like DF0:. It understands the concept of a file, and can be opened, closed, checked for EOF, etc. It can be "block structured" (ie: understand a file system, like DF0:, RAD:, etc.), or stream oriented (like SER:, PAR:, AUX: etc). A handler can be accessed at the use level like "COPY FOO RAM:FOO" or "DIR >PRT:". Most but not all handlers are layered/paired with a device driver, like: DFX: -> trackdisk.device SER: -> serial.device PAR: -> parallel.device PRT: -> printer.device SPEAK: -> narrator.device But not all handlers have a device driver, mainly those that dont use any hardware other than memory like PIPE:, NULL:, RAM:, etc. And of course not all devices have handlers like timer.device and audio.device. At a the programmed level handlers and devices are different. Devices resemble libraries and take messages and function calls. I/O is done via messages with (somewhat) standardized commands like CMD_WRITE, CMD_READ, etc. But there is quite a bit of difference between devices. Devices are free to vary the interface and behavior of these commands quite a bit since they are only accessed at the programming levels. Handlers on the other hand respond to DOS packets (which are messages, but different than exec I/O messages) and dont look much like a library. They also must respond to the packets in a consistant and defined way since the packet actions are things like Lock()/Open()/Close()/Read()/Write() at file, etc. Hope this somewhat long explanation helps. Devices and handlers are different and perform different functions. "PD" handlers are generally more common since they tend to perform software only functions, or provide new interfaces to existing hardware. On the other hand devices tend to be to interface to specific hardware, and most Amiga hardware (standard or addon) has a device driver provided. Finally the example of MSH: is BOTH a device and a handler. The MSH: part is a handler that provides a AmigaDOS interface to a MS-DOS file system. In practice this would be all that is needed. MSH also provides a device driver to access the floppy hardware because of bugs in trackdisk.device, so messydisk.device is a device. > ----- > Frank J. Edwards, | "Be different! Join the American > 2677 Arjay Court | Non-Conformist Society TODAY!" > Palm Harbor, FL 34684-4505 | -- the above message is a public service > Phone: (813) 786-3675 | -- bulletin brought to you by this station -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mark Gooderum Only... \ Good Cheer !!! Academic Computing Services /// \___________________________ University of Kansas /// /| __ _ Bix: markgood \\\ /// /__| |\/| | | _ /_\ makes it Bitnet: MARKV@UKANVAX \/\/ / | | | | |__| / \ possible... Internet: markv@kuhub.cc.ukans.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~