UnderGround Information







      UNIX CONVERSIONS
     (By David Johnson)
     -----------------
          Welcome to the second issue of ModemNews featuring UNIX
     CONVERSIONS. In the last issue we discussed the Unix "kernel" and
     related it to the DOS operating system (if you generalize a lot!)
     Also we talked a little about the size differences between UNIX
     and DOS. I left off just as we started talking about devices in
     DOS and UNIX. Lets return to this discussion where we left off.
          
          In the DOS operating system devices are handled through
     special drivers and a combination of special address locations
     and port locations. Before I get into the workings of memory and
     port addressing let me explain what a bus is. Computer systems
     are made up of hundreds of small electronic chips called
     Integrated Circuits (IC's). The most important IC in the system
     is the CPU which is also in most cases the largest (physically).
     One of the reasons the CPU is so large is that it has to have
     electrical connections for other IC's such as RAM, ROM, and I/O
     devices. In the case where several leads are grouped together to
     form a binary address it is called a bus. Memory addressing is
     done by setting the status of a special address bus in a computer
     to the desired address and then reading or writing to the data
     bus to examine or change its contents. A port is similar to
     memory addressing but uses special pins on the CPU and can't be
     shared. The CPU usually has three special buses called Address,
     Data, and Port.
          
          By now your are probably asking what does this have to do
     with connecting devices to the computer? Well, in order to
     installed a serial port in your computer you must have an
     available address space for the card and a way to talk to that
     card. In DOS this is done by using a group of pre-defined port
     and address location as well as an interrupt number. Everything
     we have discussed so far is the same in both UNIX and DOS systems
     but here comes the difference. In order to talk to this card in
     the DOS system you must use one of those special pre-defined and
     limited sets of address/port/interrupt sets. For example if you
     choose to install a serial card as COM1: in DOS what does that
     mean? By setting the switches on the card to be installed for
     COM1: you are saying that the card will be at port addresses 280
     using interrupt number 4. The DOS system only has two groups of
     address/port/interrupt assignments for serial ports and two for
     parallel ports. The specialty of this assignment allows you to
     communicate with the serial port by referencing the special
     device driver disguised as a file called COM1:.
          
          In the UNIX operating system as I mentioned in the last
     column there is a table that you setup containing all the devices
     in the system like the Video display, a Mouse, Serial cards,
     Parallel cards, the Keyboard, even the BIOS ROMs on a hard disk
     controller. This tells the UNIX kernel where to find the card
     when reference by the file names assigned to them. To assign a
     file name to a card you use what's called a Major and Minor
     number in creating special files. We will talk more on this in a
     future article but for now its just important that you understand
     that in UNIX there are 3 types of files. A standard file such as
     a Binary or Text file (same as in DOS), second is a special file
     used to talk to peripherals, and third is a PIPE to be covered
     later. The creation of a special file tells the UNIX kernel how
     to find the specified hardware card because the UNIX version of
     the File Allocation Table (FAT) can contain more information then
     just file names and sizes. A perfect example is when a special
     file is created with Major and Minor numbers indexing into the
     Device Table. These two numbers are used first the major number
     tells the kernel which device in the table to talk to, while the
     second or Minor number indicated which port on multi port cards
     to refer to.
          
          So now we have learned that by using major and minor numbers
     (basically just indexes to a device table) allow you to have user
     definable devices in the system and not depend on the planning of
     the originating company like Microsoft or IBM with DOS. In the
     next issue I plan to talk ore about how the Minor number is used
     to communicate with Multiport Serial cards as well as talk a
     little more about interrupts. If you have any suggestions on what
     you would like me to concentrate on or cover a little more in
     depth please leave a message or comment on my BBS by calling 516-
     486-4705 at 1200 or 2400 Baud. Please note that the phone number
     listed in the first column was for subscribers only and the
     number listed above is the free node for all users.