Smart card operating systems
Software for smart card operating systems and applications based on these operating systems must be written using either assembly language or the C language, due to the small memory capacities of the microcontrollers. Using these languages, which are relatively close to the hardware level, naturally tends to disproportionately prolong the duration of the entire software development process, and thus significantly increases its cost. The tests for the software, most of which is located in the ROM of the microcontroller, are very thorough and comprehensive, since it is almost impossible to correct any residual errors in this software after the chips have been manufactured.4 Chip production always involves generating ROM masks, which essentially represent the software that will later be located in the ROM of the microcontroller, where it cannot be subsequently modified. If any software error is detected in the following production steps, it can only be corrected by repeating all of the preceding steps. In order to make the best possible use of the available memory space in the microcontroller, the program code must be adapted to the specific type of chip that is used. Porting the software to another type of chip is thus only possible at additional effort and expense. Consequently, the time required to generate a complete ROM mask is around nine months. This can be significantly reduced if it is possible to use program code that is already on hand (in the form of software libraries). Once the development of the ROM mask has been completed, it can be formally handed over to a semiconductor manufacturer.

ROM masks and fabrication of the semiconductor chips
From the software that it receives in an EEPROM, on a diskette or via data telecommunications, the semiconductor manufacturer generates an exposure mask for the ROM of the microcontroller. This mask, which contains the program code, is called the ‘ROM mask’ by operating system designers, or often simply ‘the mask’. If the structures are reduced in size when the mask is imaged onto the wafer, it is instead called a ‘reticule’. The ROMmask is only one of approximately 20 masks needed to produce the microcontroller. The structures of the microcontroller chips are produced on suitably prepared high-purity silicon disks calledwafers. The diameter of wafers used for smart card microcontrollers is presently usually 6 to 8 inches (15.2–20.4 cm).With 0.8-μmtechnology, around 700 microcontrollers will fit on a 6-inchwafer. In the semiconductor industry, the trend for fabrication processes in the coming years is towards larger wafers and smaller structures. It can be assumed that in a few years, 12-inch (30.6-cm) wafers and 0.13-μm technology will become the prevailing standard for producing smart card microcontrollers. The cost of a fabrication plant at this level of technology is on the order of one billion euros. Up until only a few years ago, full-wafer masks were used, with all 700 microcontrollers being exposed at once. Contact exposure was normally used with such masks. As the dimensions of the chip structures became increasingly smaller, this was no longer possible, since the yield was not acceptable. In all new production methods, the set of photomasks represents only a single chip, instead of an entire wafer. These very delicate masks are made from plates of quartz glass, which is transparent to ultraviolet light. These plates hold the patterns for a chip in the form of chrome-metal tracks. The track patterns are transferred to the glass plates by first coating the plates with a photosensitive layer and then using an electron-beam writer to expose the patterns. Following this, the sensitive layer is developed and the unexposed regions are removed by etching. The photomask is produced at a scale that is 5 or 10 times greater than the actual scale of the chip, which allows image-enhancing reduction to be used when the wafer is exposed. The machines that are used to expose the wafers, which are called ‘steppers’ in the trade, are high-precision optical devices that can focus the image of the mask on the wafer with an accuracy of a fraction of a micrometer. They can also reposition the wafer with an equal level of precision. After the ultraviolet light exposure process for one chip has been completed, the wafer is moved by one step to the position of the next chip, and the exposure process is repeated at this position. The entire wafer is thus exposed one step at a time, until all the microcontrollers that it will contain have been exposed. The entire wafer is coated with a light-sensitive lacquer called the photoresist. Where the photoresist has been exposed to light, the lacquer is removed by etching, and the underlying wafer surface is then doped with impurity atoms. After the wafer has been cleaned several times and recoated with a new layer of photoresist, it is ready to be exposed using the next of the approximately 20 masks. Depending on the particular manufacturer and the fabrication process used, producing a finished wafer involves around 400 processing steps and takes six to 12 weeks, although the The actual processing time is less than a week. The very long lead times encountered in practice are primarily due to the queuing technique commonly used in the mass production of semiconductor devices. In order to make the production process more economical, a group of several wafers (a batch) is always passed through the semiconductor fabrication machine each time. A typical batch consists of 12 wafers, which is commonly the minimum production quantity. This corresponds to approximately 10,000 chips for almost all semiconductor manufacturers. It takes a considerable amount of extra effort to process less than a full batch, so the production costs would be just as high as for a full batch. However, some fabrication equipment allows shared batches or multi-project wafers, in which different types of microcontroller chips with different ROM masks are produced on a single wafer. This allows smaller lots than the otherwise obligatory 10,000 pieces. However, by no means all types of microcontrollers can be produced in this manner, and not every fabrication machine can handle shared batches. The overall yield from the fabrication process is around 80% with a well-tuned process. This means that only around 560 of the original 700 chips on the wafer can be used in the following production steps.With a relatively new production process, the long-term yield can easily be as low as 60 %. This has a very negative effect on production volume and profitability.

Chip testing on the wafer
In the next production step, the microcontrollers on the wafer are contacted using metal probes and individually tested. This requires making contact with each of the 700 microcontrollers on the wafer, either individually or in groups of up to eight, and then performing an electrical function test. Since there are usually not any supplementary contacts for the microcontrollers, even at this production stage only the five contacts that will later be used in the smart card can be used for testing. The functional elements are tested on the wafer significantly more intensively and extensively than later on, since the microcontrollers are still in the test mode at this stage. In the test
mode, all of the memories (RAM, ROM and EEPROM) can be read and/or written without any restrictions. Any microcontrollers that fail this test are marked with a small colored dot. This allows non-functional chips to be optically identified in the following steps, so that they can be discarded after the wafer has been sawn into individual dice. In addition, the ability to freely access the memory in the test mode is exploited to write chip-specific data to the EEPROM. This includes a serial number that must be used only once, so that it is unique for each chip. This individualizes each chip, and thereby each smart card. The benefit of this, in addition to certain security aspects, is that traceability as defined by the ISO 9000 family of standards is guaranteed by the unique chip number.

Sawing the wafer
After the chips have been tested on the wafer, the next step is to separate them. A thin selfadhesive film is applied to the back of the silicon disk, so that the individual chips will remain in position after the wafer has been cut. Special saws with blades that are around 25 μm thick and spin at more than 30,000 rpm are used to cut the wafer into pieces. The wafer is sawn such that each resulting piece holds a single microcontroller. These small pieces of silicon, with a maximum area of 25 mm2, are called dice (‘die’ in the singular). Each die holds a microcontroller that will ultimately be incorporated into a smart card. Once the wafer has been separated into dice, the defective dice, which are marked with colored dots, are separated from the good dice and destroyed. Up to this point, it is not possible to tell whether the ROMsoftware has been copied without any errors. For this reason, around 10 dice are removed from the batch at this stage and mounted in ceramic DIL packages. The software producer receives these first sample devices and uses his test facilities to determine whether the software in the ROM functions correctly. The entire chip can also be tested. If an error in the software or hardware is detected at this point, the production process must be stopped, and the entire batch has only scrap value. After the error has been corrected, the production process must be started again from the beginning, with the generation of a new ROM mask by the semiconductor manufacturer. The lost time cannot be recovered, even with accelerated handling in the other production phases.

Attaching chips to modules
The next step in the production process, after the dice have been sawn from the wafer, is to mount them into modules. The modules increase the resilience of these very fragile bits of quartz crystal, and the electrical contacts on their top surfaces will later be used to make the connections between the card and the terminal. Chip modules are usually supplied on rolls of 35-mm plastic tape with perforated edges, which carry modules in adjacent pairs. Depending on the size of the module, a single roll can hold from 10,000 to 20,000 modules. The 35-mm plastic tape is simply called ‘tape’ by insiders, and this type of packaging is called ‘chip on tape’ (COT). Incidentally, the width of the tape is the same as that of 35-mm photographic film, which is commonly used in still and motion-picture cameras. The reason for using this format originates from the early days of smart card manufacturing. At that time, the 35-mm film format was chosen for the module carrier to allow inexpensive transport and packaging methods to be used with a minimum of new development, since it allowed existing commercial spools and winding equipment for film to be used for module tapes. Since changing to a different format was no longer feasible after this format had reached a certain level of general use, it is still employed today. The bottoms of the dice (the silicon base material) are permanently bonded to the bottoms of the modules. The dice can then be electrically connected to the contact surfaces of the modules in subsequent production steps.

Electrically bonding the chips
After the dice have been glued into the modules, the next step is to make the electrical connections to the rear surfaces of the contacts. This is done using very fine gold wire, which is welded to the aluminum contact pads on the die and the corresponding contact surfaces on the rear of the module. To prevent the bonding wires from being broken by temperature variations, each wire is formed into a loop. However, the loops must not be too large, since otherwise the bonding wires would not be fully covered by the plastic resin that is later poured over the chip. This would increase the risk of corrosion of the wires.

Encapsulating the chips in the modules
After the chip has been bonded, a black epoxy resin is poured over the chip and the rear surface of the module. This resin protects the fragile crystal against environmental influences such as humidity, twisting and bending. An opaque resin is used, because semiconductor devices are normally very sensitive to light and electromagnetic energy in the near-visible part of the spectrum. After the chips have been encapsulated, the carrier tapes with the modules are wound onto large spools and packed into cardboard boxes. For small production runs, it is also possible to package the modules individually in plastic containers. However, this is avoided when there are large piece counts, since it makes it difficult for the module implanter to use automated processing equipment. If a newmicrocontroller is to be introduced into the market or modified chip hardware has to be tested, the production process is often complete when the modules have been encapsulated. In this case, the modules are then passed through suitable testing and qualification stages. Only after these have been completed with no errors is it OK to start a new batch, with suitably modified software, for mass production. A similar situation exists when there is a new version of an operating system, in which case the production process also ends at this point. This is followed by the necessary qualification testing, which can take weeks or even months. If necessary, another pass through the revision loop with an improved version of the operating system may then take place.

Module testing
As a consequence of the production steps up to now – sawing the wafer, attaching and bonding the chips and encapsulating the chips in the modules – 3 to 7% of the dice will have become unusable. An additional test is therefore usually performed before the modules are packaged and delivered. For this test, each module must be connected to the tester via the contacts on the front of the module. The first thing the tester does is to switch the microcontroller from the test mode to the user mode by blowing the polysilicon fuse and writing a special byte value to a specific location in the EEPROM. After this, it is no longer possible to externally access the memory for reading or writing without first satisfying specific security conditions. The test computer next carries out an ISO activation sequence and attempts to detect a valid ATR. If this is possible, it then tests the chip hardware using the commands integrated in the mask-programmed software. If all these tests are successful, the module has not been damaged by any of the previous production steps, so it can be built into a smart card.

Smart Card Operating Systems
It may seem presumptuous to refer to the few thousand or ten thousand bytes of program code in a smart card microprocessor as an operating system, but the name is fully justified. According to the German DIN 44300 standard, an operating system is no more and no less than ‘the programs of a digital computer system that together with the properties of the computing system form the basis for the possible operating modes of the digital computing system, and which in particular control and monitor program execution’. The term ‘operating system’ is thus not automatically limited to enormous programs and data volumes. Instead, it is completely independent of size, since it only refers to functionality. You should not automatically associate the term ‘operating system’ exclusively with multimegabyte programs for PCs and Unix computers. These operating systems are designed just as specifically for a particular man–machine interface, which uses a monitor, keyboard and mouse, as smart card operating systems are designed to work with the bidirectional serial interface to the terminal.

Ultimately, the decisive factor for an operating system is its functionality, which results from the interaction of mutually compatible and interdependent library routines. The fact that an operating system provides an interface between the computer hardware and the actual application software is also important, since it makes it unnecessary for the application software to directly address the hardware. This is a significant benefit, since it provides the application software with a certain amount of portability, even though this is often very limited. At the beginning of the 1990s, there were very few true smart card operating systems. This was in part due to the very limited memory capacity of smart card microcontrollers at the time. The usual situation then was not so much an operating system as a well-structured collection of library routines inROM,which were used as necessary for a particular application when the card was completed. The structures of these systems were largely monolithic and could be modified only at considerable expense. The next generation was already built in the form of a layered operating system, and present-day systems still have this structure, with innumerable refinements. One of the first true smart card operating systems was STARCOS, which was developed by Giesecke & Devrient [GD] and the Gesellschaft f¨ur Mathematik und Datanverarbeitung. This operating system, whose development began in 1990, allowed several applications to be stored, used and managed independently in a single smart card, even at that relatively early date. In the course of time, the term COS (card operating system) has become accepted throughout the world as a designation for a smart card operating system. It often forms part of the name of the operating system, as with ‘STARCOS’ and ‘MPCOS’. Presently, there are more than a thousand companies that produce general-purpose and application-specific smart card operating systems. It is conceivable that a consolidation of smart card operating systems, with their various features and functions, could occur in the next fewyears. Thiswould have the same effect as with PCs, which nowadays all use a ‘uniform’ operating system. Whether this will actually happen with smart card operating systems remains to be seen, since in this case the external conditions are less favorable to a uniform solution. Extremely severe requirements with regard to security and software quality, a shortage of memory capacity and the demand for confidentiality of the operating system software, taken together, certainly have the potential to make it impossible to produce a universal smart card operating system that satisfies everyone’s wishes, at least in the foreseeable future. In this chapter, we attempt to shed some light on the features and varieties of modern smart card operating systems, based on various specifications, standards and descriptions of software for smart cards.