Background of the Invention
1. Field of the Invention
The present invention relates to an input and output control system which can control peripheral devices having the same category but different control procedures without providing special-purpose BIOSs (basic input and output system programs).
2. Description of the Related Art
In recent years, along with the development of semiconductor techniques, very inexpensive LSIs such as microprocessors, memories, peripheral controllers, and the like are available. These LSIs are combined according to applications, and a standard OS (Operating System Program) or a commercially available application program is loaded, thus constituting a relatively high-performance computer system. A typical computer system of this type is a personal computer.
In the field of personal computers, hard disk devices (HDDs) are increasingly adapted as standard equipment. For a hard disk controller (HDC) for controlling the HDD, two international standard architectures are known. The first type of HDC has a 16-bit data bus width (to be referred to as a 16-bit interface HDC hereinafter). The second type of HDC has an 8-bit data bus width (to be referred to as an 8-bit interface HDC hereinafter).
Since these two HDCs do not simultaneously exist on a single system, a basic input and output system program (BIOS) is programmed to control one of these HDCs.
However, it is not preferable from a general purpose viewpoint that two types of BIOSs exist for controlling two different types of HDCs. Therefore, a demand has arisen for a general purpose input and output control system which can control a plurality of peripheral devices having the same category but different control procedures without providing special-purpose BIOSs.
Summary of the Invention
It is an object of the present invention to provide an input and output control system which can control peripheral controllers having the same category but different control procedures without providing special-purpose BIOSs.
In order to achieve the above object, an input and output control system of the present invention is adapted for a computer system to which one of at least first and second input and output (I/O) devices are selectively connected, where said first and second I/O devices have the same category but different control, procedure. The structure comprises a memory means for storing a basic input and output system program, including a first input and output (I/O) control routine for said first device, and a second input and output (I/O) control routine for said second I/O device; input and output (I/O) port means connected to one of said first and second I/O devices; means for writing specified data to said I/O port means; means for reading data from said I/O port means; means, coupled to said writing means and said reading means, for comparing the read-out data with said specified data; means, coupled to said comparing means, for determining that said I/O device connected to said I/O port, is connected to said computer system, when a coincidence is obtained by said comparing means; and means, coupled to said determining means, for setting up the I/O control routine for said I/O device connected to said I/O port.
According to the input and output control system of the present invention, a 16-bit interface HDC control routine and an 8-bit interface HDC control routine are programmed in one BIOS, so that a plurality of types of BIOS need not be provided for different types of HDCs. As a result, the BIOS can have versatility, and the HDC type can be changed to improve flexibility of the system.
Brief Description of the Drawings
Other objects and features of the present invention will be apparent from the following description taken in connection with the accompanied drawings in which:
FIG. 1 is a block diagram showing an embodiment of an input and output control system of the present invention; and
FIG. 2 is a flow chart of an automatic HDC type determination routine in a BIOS used in the embodiment shown in FIG. 1.
Detailed Description of the Preferred Embodiments
An embodiment of the present invention will now be described.
FIG. 1 is a block diagram showing an embodiment of an input and output control system of the present invention. CPU 1 comprises, e.g., a 32-bit microprocessor i80386 available from Intel Corp., U.S.A. CPU 1 is connected to system RAM 2, storing an operation system program (OS) and processing data, and ROM 3, storing a BIOS through system bus 10 consisting of address lines, data lines, and control lines. CPU 1 is also connected to keyboard controller (KBC) 4, visual display controller (VDC) 5, and hard disk controller (HDC) 6. KBC 4 is connected to keyboard (KB) 7 for inputting data. VDC 5 is connected to display (DISP) 8 for displaying data. HDC 6 is connected to hard disk device (HDD) 9 as an external storage for storing data. HDC 6 is one of 8- and 16-bit interface HDCs. HDC 6, VDC 5, and KBC 4 are controlled by the BIOS stored in ROM 3.
The operation of the embodiment of the present invention with the above arrangement will be described below with reference to the flow chart shown in FIG. 2.
When the system is started, the BIOS performs tests of I/O devices 4, 5, and 6, and initialization (switching of a BIOS vector, resetting of the HDC, and the like). Upon initialization of the HDC, the HDC type is determined as follows.
Automatic determination of 16- and 8-bit interface HDCs can be made because the 16-bit interface HDC, as the international standard architecture, has an inherent I/O port (I/O address), and the 8-bit interface HDC has no inherent I/O port (I/O address). First, in step 21, CPU 1 writes specified data in an I/O port (at an I/O address) inherent to the 16-bit interface HDC under the control of the BIOS stored in ROM 3. If the 16-bit interface HDC is used, the specified data (e.g., "1") can be written at the I/O address. On the other hand, if the 8-bit interface HDC is used, since the designated I/O address is not present, CPU 1 writes no data, and completes the write access. In step 23, CPU 1 designates the I/O address, and reads the data. In this case, if the 16-bit interface HDC is used, the read data is "1", while if the 8-bit interface HDC is used, the read data is indefinite data, e.g., "FF".
In step 25, CPU 1 compares the written data and read data. As a result of comparison, if a coincidence is obtained, CPU 1 determines that the 16-bit interface HDC is used, and sets up a 16-bit interface HDC control routine in step 27.
On the other hand, if no coincidence is obtained between the written data and read data in step 25, CPU 1 determines that the 8-bit interface HDC is used, and sets up an 8-bit interface HDC control routine in step 29.
Note that the present invention is not limited to the above embodiment. In the above embodiment, the input and output control system of the present invention is applied to automatic determination of the 8- and 16-bit interface HDCs. However, the input and output control system of the present invention can be applied to peripheral devices which have the same category but different command architectures, peripheral devices having the same category, one of which has an I/O port and the other of which has no I/O port, or peripheral devices having the same category but different control procedures.