<<

^ ^ ^ ^ I ^ ^ ^ ^ ^ ^ II ^ ^ ^ II ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I ^ European Patent Office Office europeen des brevets EP 0 867 806 A2

EUROPEAN PATENT APPLICATION

(43) Date of publication: (51) |nt CI.6: G 06 F 9/445 30.09.1998 Bulletin 1998/40

(21) Application number: 98301425.9

(22) Date of filing: 26.02.1998

(84) Designated Contracting States: (72) Inventors: AT BE CH DE DK ES Fl FR GB GR IE IT LI LU MC • Mealey, Bruce Gerard NL PT SE Austin, Texas 78759 (US) Designated Extension States: • Swanberg, Randal Craig AL LT LV MK RO SI Round Rock, Texas 78664 (US) • Williams, Michael Stephen (30) Priority: 17.03.1997 US 820471 Austin, Texas 78759-4530 (US)

(71) Applicant: International Business Machines (74) Representative: Moss, Robert Douglas Corporation IBM United Kingdom Limited Armonk, N.Y. 10504 (US) Intellectual Property Department Hursley Park Winchester Hampshire S021 2JN (GB)

(54) provision for system

(57) An improved operating system for a computer provides support for specific hardware components. The operating system is loaded by first loading a base 30 portion which initializes the operating system and deter- 2 mines the particular type of hardware components FIRMWARE present. Then, appropriate software components are SEEKS OPERATING loaded that are specifically associated with the hard- SYSTEM ware components. The hardware components can be detected by leaving a trace in the device that 32 memory 1 is associated with the software component and later re- trieving the trace, or by testing the computer for the hard- OPERATING SYSTEM ware component. The hardware component may be a INITIALIZES bus architecture selected from a group of bus architec- 34 tures, and bus-independent interfaces are defined 1 which are mapped to addresses in the kernel. Alterna- tively, the software component can include a PAL which OPERATING SYSTEM contains specific instructions for communicating with DETERMINES the hardware component. The PAL is constructed from HARDWARE PRESENT a plurality of files each associated with the hardware 36 component. 2 HARDWARE-SPECIFIC COMPONENTS LOADED CM 38 < 2 CO o USER PROGRAMS 00 EXECUTED Is- CO 00 o a. LU

Printed by Jouve, 75001 PARIS (FR) 1 EP 0 867 806 A2 2

Description order to allow it to function on the target platforms. One approach to this problem is to include support Technical Field of the Invention for a large number of hardware platforms in a single ver- sion of the operating system, such as is provided by the The present invention generally relates to computer 5 hardware abstraction layer ("HAL") of Microsoft Corp. systems, and more particularly to a method of providing With HAL, code is written to the abstracted interfaces, software support for different hardware platforms, in- then bound into the primary memory (kernel) to produce cluding different bus configurations. a single loadable image. This image is targeted for a single platform or group of platforms where minute dif- Background of the Invention 10 ferences in hardware can be handled with runtime checks. Significant changes in the hardware platform, The basic structure of a conventional computer sys- however, require an entirely new image which will not tem 1 0 is shown in Figure 1 . The heart of computer sys- run on the old platforms. This approach also increases tem 10 is a central processing unit (CPU) or processor implementation time, complicates media creation by 12 which is connected to several peripheral devices, in- is adding to the number of different install media, and also cluding input/output (I/O) devices 14 (such as a display increases test time. monitor and keyboard) for the , a perma- One manner in which hardware platforms can differ nent memory device 16 (such as a hard disk or floppy relates to the many different types of input/output (I/O) diskette) for storing the computer's operating system bus lines which can be used for bus 20. Conventional and user programs, and a temporary memory device 18 20 bus designs include, for example, PCI (Peripheral Com- (such as random-access memory or RAM) that is used ponent Interface) and ISA (Industry Standard Architec- by processor 12 to carry out program instructions. Proc- ture) created by IBM. A single machine can use more essor 12 communicates with the peripheral devices by than one bus architecture, e.g., have a system bus from various means, including a bus 20 or a direct channel the processor that connects to other I/O busses via 22. Computer system 10 also includes firmware 24 25 bridges. As new computer systems are developed with whose primary purpose is to seek out and load an op- different I/O busses, the operating system must be erating system from one of the peripherals (usually per- changed and re-released to support each new bus or manent memory device 16) whenever the computer is each new combination. This requirement becomes ex- first turned on. Computer system 1 0 may have many ad- pensive due to packaging and testing of each system. ditional components which are not shown, such as serial 30 Also, since the code to support a bus is an integral part and parallel ports for connection to, e.g., modems or of the operating system, it takes up valuable memory printers. Those skilled in the art will further appreciate resources even though the bus may not be present on that there are other components that might be used in the system. In other words, the operating system, when conjunction with those shown in the block diagram of running, may include software components for support- Figure 1; for example, a display adapter connected to 35 ing many different bus designs even though it needs on- processor 12 might be used to control a video display ly one to run on any particular machine. monitor. The foregoing generally applies to any type of op- In today's computer architectures, great flexibility is erating system, but the present invention has particular available to hardware designers, allowing differentiation application to UNIX (UNIX is a trademark licensed ex- between computer platforms among various vendors 40 clusively through X/Open Company Ltd.). UNIXisamul- that still meet an industry-defined architecture (stand- ti-user, multi-tasking operating system which is availa- ard). These differences in the computer platforms must ble from a variety of sources with different versions. be accommodated by operating systems that run on These include, among others, System V from A T and them. In a software OEM (original equipment manufac- T, AIX from IBM (AIX is a trademark of International turer) environment, this means that a hardware vendor 45 Business Machines Corporation) and Mach from NeXT must have access to all the source code for each oper- Computer. It is a problem for manufacturers of UNIX- ating system that is going to run on the system. These type (and their vendors) to add bus support hardware vendors then modify the operating system for busses not supported by that manufacturer. For ex- source code to run in their computer platform. This ap- ample, Motorola manufactures with its VME proach has several problems. First of all, an operating so bus, and so must add support for the VME bus to AIX system source code license is needed and is very ex- (licensed by IBM) so that they can use AIX on their plat- pensive. Second, much of the operating system has no forms. This procedure becomes very expensive for eve- dependency on the hardware that is different. Third, the ry manufacturer as it must be done for each release of vendor must dedicate assets to building the operating the particular operating system. It would, therefore, be system and repackaging it for the target platforms. Fi- 55 desirable to provide an operating system that allows for nally, as each new version of the operating system is hardware-specific support without requiring the operat- released by the OEM, the vendor must repeat any mod- ing system to include support for multiple hardware plat- ifications done to the prior version on the new one in forms. It would be further advantageous if the operating

2 3 EP 0 867 806 A2 4 system were designed for one release medium that constructed from a plurality of files each associated with would work across all platforms, and still be easily the hardware component. adapted for new hardware platforms. Brief Description of the Drawings Disclosure of the Invention 5 The invention will now be described with reference Accordingly, the present invention provides a meth- to preferred embodiment thereof as illustrated in the ac- od of providing an operating system for a computer hav- companying drawings, wherein: ing a processor for carrying out program instructions, a memory device connected to the processor, and a hard- 10 Figure 1 is a block diagram depicting typical hard- ware component connected to the processor, the meth- ware for a conventional computer system; and od being characterised by the steps of: loading into the memory device a base portion of an operating system, Figure 2 is a flow chart depicting how, according to the base portion having instructions for detecting the the present invention, hardware-specific compo- hardware component; detecting the hardware compo- 15 nents are loaded in the operating system during the nent; and loading a software component that is specifi- boot sequence. cally associated with the hardware component into the memory device. Detailed Description of the Invention According to another aspect, the invention also pro- vides a computer system having a processor for carry- 20 The present invention is directed to a method of ing out program instructions, a memory device connect- loading an operating system on a computer which has ed to the processor, and a hardware component con- a particular hardware platform that requires specific nected to the processor, characterised in that the sys- software support to be provided by the operating sys- tem further comprises: means for loading into the mem- tem. The computer hardware may include the various ory device a base portion of an operating system, the 25 components shown in Figure 1, but the computer sys- base portion having instructions for detecting the hard- tem is not necessarily conventional, i.e., it could include ware component; means for detecting the hardware new hardware components as well, or have a novel in- component; and means for loading a software compo- terconnection architecture for existing components. nent that is specifically associated with the hardware With reference to Figure 2, as with prior-art oper- component into the memory device. 30 ating systems, the operating system of the present in- Computer operating systems according to the in- vention is loaded as part of a "boot" sequence that be- vention do not unnecessarily use resources by including gins (when the computer is first turned on or in response support for hardware platforms that are not present in to a "soft" boot command) with the firmware seeking an the particular machine that is running the operating sys- operating system on one of the storage devices, e.g., a tem. 35 floppy diskette, magnetic hard drive, or CD-ROM disk Methods of providing such an operating system ac- (30). In the present invention, however, the operating cording to the invention simplify repackaging of the me- system does not load in an uninterrupted manner. Rath- dia for new hardware platforms. er, the operating system is first initialized by loading only The preferred method of providing an operating a base portion of the software components (32). These system for a computer generally comprises the steps of 40 base components provide functionality which allows the loading a base portion of an operating system into the operating system to determine the particular hardware memory of the computer, the base portion having in- platform that is present (34) and to load appropriate, structions for detecting the hardware component, de- hardware-specific components (36) to complete the tecting the hardware component using those instruc- boot sequence. The base functionality may, for in- tions, and then loading a software component that is 45 stance, construct linked lists of free buffers and inodes, specifically associated with the hardware component hash queues, region structures, etc. After the operating once the hardware component has been detected. The system is fully loaded with the hardware-specific com- hardware component can be detected by leaving a trace ponents, user applications maybe executed (38), or oth- in the memory device that is associated with the soft- er software components may be loaded, such as dy- ware component and later retrieving the trace, or by test- 50 namic device drivers. ing the computer for the hardware component. The The foregoing method may be implemented in var- hardware component may be a bus architecture select- ious ways, two of which are described below. In a first ed from a group of bus architectures, and the detecting implementation, each computer platform vendor pro- step defines a set of bus-independent interfaces vides a special firmware or ROS code that initially runs mapped to addresses in the kernel. Alternatively, the 55 on the computer. This code not only initializes the hard- software component can include a program abstraction ware and loads the operating system, but also leaves layer (PAL) which contains specific instructions for com- various information (e.g., in the computer's RAM) about municating with the hardware component. The PAL is the hardware configuration for the operating system to

3 5 EP 0 867 806 A2 6

later retrieve. Some of this information is unique to the created as a loadable extension. The code module can hardware vendor or computer platform. Using this infor- be packaged into the boot RAM filesystem on the instal- mation, unique names can be created for each compu- lation media. Early in the configuration of the system, ter system. These names can then be used as filena- each I/O bus present on the machine is detected and, mes, and the filenames are associated with different 5 for each bus that is identified, its bus support code is modules that can be loaded to provide the support for loaded and set up. This approach again allows vendors the differentiating hardware. Although the names can be to add their bus support code to the media which then pre-assigned based on a table, it is preferable to dynam- is loaded by the operating system, and so does not re- ically generate the name, according to a known formula, quire any source license. Code for busses that do not based on the firmware trace; this approach allows the 10 exist on the computer system are not loaded, thereby operating system to more easily adapt to completely saving memory resources. new hardware platforms, in addition to supporting those Detection of the type of busses present can be ac- platforms existing at the time of the original release of complished by defining a set of common (and bus-inde- the operating system, by simply generating the filename pendent) interfaces. For each bus found in the system, of a new file that is added to the release media. is software is loaded that supports these interfaces with For example, an operating system for a UNIX-type address mappings to the kernel, for example, via a new includes a PAL (Portability Assist Layer, or "bus_register/unregister" interface. Direct memory ac- Platform Abstraction Layer), which contains the specific cess (DMA) services can be added through a well-de- instructions for communicating with the particular hard- fined interface such as the "d_map_init()" interface. ware devices of a given manufacturer. The PAL, which 20 These services are added by the newly loaded bus ex- is loaded into the kernel of the workstation, is selected tension^) at configuration time. In addition, each differ- from among a variety of available PALs on the installa- ent bus type is assigned a unique identifier and, as each tion media, based on the firmware trace. If the particular bus is detected during the configuration of the system, machine on which the operating system is being loaded it is assigned a unique number within the type. These is a RISC System Personal Computer, the manufacturer 25 assignments allow for dynamic creation of a unique bus may have encoded information in the firmware trace identifier (BID) for each bus in the system. The BID al- which is equivalent to the letters "rspc." The operating lows the bus to be abstracted from device drivers (it is system detects this, and then looks for a PAL which in- part of the configuration information given to the device cludes the files "planar_upal_rspc," "librarycfg_rspc," driver during its configuration). This BID can then be "mkboot_rspc," "bootinfo_rspc," etc. These files togeth- 30 passed to kernel services used by device drivers, like er constitute one of many sets of PAL files provided for "iomem_att()" or "iomem_det()," and the DMA support the different hardware platforms. The hardware-specific functions. The BID indicates the bus number, type, and components are not just kernel extensions but, e.g., can region, I/O space, or MEM space; this information can further provide machine specific commands. be used to look up address information for the bus that In this manner, a vendor does not need to load a 35 was provided when the bus was registered via customized operating system, and so no operating sys- bus_register(). Mappings to various bus hardware can tem source license is needed. This approach also now be set up for the device driver without the device makes it easy for the vendor to build one medium for all driver knowing how the system address map is parti- computer platforms that conform to a given architecture, tioned for I/O bus access. and a much smaller set of assets must be maintained 40 Both of the foregoing implementations differ from to build release media. As new versions of the operating conventional device drivers since the present invention system are released, no new modifications are required, provides the ability to abstract and load in system-level since the release medium can be rebuilt with the new support code which cannot be done with prior-art meth- system and the PAL modules. This approach also saves ods. RAM space since unneeded code is not loaded. The in- 45 vention differs greatly from the prior-art HAL in that the present invention provides the ability to dynamically Claims load a set of interfaces at boot time, with the present invention, a new kernel is not required on each release 1. A method of providing an operating system for a medium, just an addition-loadable image to support the 50 computer having a processor (12) for carrying out new platform. Once the new image is added to the me- program instructions, a memory device (16) con- dium, the configuration code will load the correct PAL nected to the processor, and a hardware compo- module for the platform being configured, saving in in- nent (14) connected to the processor, the method stallation time, medium creation, number of different in- being characterised by the steps of: stall media, and test time. In a second implementation, a UNIX-type worksta- loading (32) into the memory device a base por- tion is provided with loadable bus support. The code tion of an operating system, the base portion needed to support a particular input/output (I/O) bus is having instructions for detecting the hardware

4 7 EP 0 867 806 A2 8

component; (16) connected to the processor, and a hardware component (14) connected to the processor, char- detecting (34) the hardware component; and acterised in that the system further comprises:

loading (36) a software component that is spe- s means (32) for loading into the memory device cifically associated with the hardware compo- a base portion of an operating system, the base nent into the memory device. portion having instructions for detecting the hardware component; 2. A method as claimed in Claim 1 wherein said load- ing step includes 10 means (34) for detecting the hardware compo- nent; and leaving a trace in the memory device, the trace being associated with the software component; means (36) for loading a software component and said detecting step includes that is specifically associated with the hardware 15 component into the memory device. the base portion retrieving the trace. 10. A system as claimed in Claim 9 in which the means 3. A method as claimed in Claim 2 wherein: for loading is arranged in operation to leave a trace in the memory device, the trace being associated the computer has firmware for seeking and 20 with the software component, the base portion be- loading an operating system; and ing arranged in operation to retrieve the trace.

the trace is left by the firmware.

4. A method as claimed in Claim 1 wherein said de- 25 tecting step includes the step of the base portion testing the computer for the hardware component.

5. A method as claimed in Claim 1 or Claim 4 wherein: 30 the hardware component is a bus architecture selected from a group of bus architectures; and

said detecting step includes the step of defining a set of bus-independent interfaces. 35

6. A method as claimed in Claim 5 wherein:

the computer is a UNIX-type workstation hav- ing a kernel; and 40

the interfaces are mapped to addresses in the kernel.

7. A method as claimed in Claim 1 or Claim 2 wherein: 45

the computer is a UNIX-type workstation; and

the software component includes a PAL which contains specific instructions for communicat- so ing with the hardware component.

8. A method as claimed in Claim 7 wherein the PAL is constructed from a plurality of files each associated with the hardware component. 55

9. A computer system having a processor (12) for car- rying out program instructions, a memory device

5 EP 0 867 806 A2

1 2- L 2 2- PROCESSOR 20-

24-

PERMANENT TEMPORARY FIRMWARE 10 DEVICES MEMORY MEMORY (ROS) (HARD DISK) (RAM) 13 14- 16- 18-

(Prior ybt

30

FIRMWARE SEEKS OPERATING SYSTEM

3 2- 1 OPERATING SYSTEM INITIALIZES

34 1 OPERATING SYSTEM DETERMINES HARDWARE PRESENT

3 6 1 HARDWARE-SPECIFIC COMPONENTS LOADED

3 8 1 USER PROGRAMS EXECUTED