KERNEL FUNCTION REALIZING MECHANISM, ENTERTAINMENT APPARATUS HAVING SAME, AND PERIPHERAL DEVICE CONTROL METHOD BY SAME

Abstract: An entertainment apparatus includes a storage unit which stores a device driver for a peripheral device outside a kernel. In order to make the peripheral device operable, a CPU causes an I/O processor to execute the device driver based on a remote procedure call. Data transfer between the peripheral device and the CPU is performed by a direct memory access according to a communication protocol which is commonly used at least in the apparatus.

Description: DESCRIPTION KERNEL FUNCTION REALIZING MECHANISM, ENTERTAINMENT APPARATUS HAVING SAME, AND PERIPHERAL DEVICE CONTROL METHOD BY SAME BACKGROUND OF THE INVENTION FIELD OF THE INVENTION The present invention relates to an entertainment apparatus capable of carrying out entertainment processing including reproduction of sounds and images based on digital information recorded on a secondary storage medium, such as a CD-ROM or DVD-ROM, and in particular, to a technique for controlling a peripheral device connected to the entertainment apparatus. DESCRIPTION OF THE RELATED ART An entertainment apparatus realized as an entertainment-dedicated computer for a game or the like, performs given entertainment processing cooperatively with peripheral devices, such as a controller and an external storage medium, connected thereto. Specifically, an entertainment apparatus carries out given entertainment processing based on inputs from peripheral devices such as a controller and an external storage medium, and outputs its results to a display unit such as a television receiver, and a speaker. Thus, it is very important for the entertainment apparatus how to control the peripheral devices connected thereto. In general, the control of the peripheral devices is realized by part of a kernel which is a main function of an OS (operating system). In recent years, a technique called "microkernel" has been available, wherein device drivers being program codes for controlling peripheral devices are put outside a kernel so as to enhance generality or compatibility for the peripheral devices. This technique of microkernel is suitable for being applied to an entertainment apparatus which is required to receive diversified peripheral devices depending on a kind of entertainment. However, due to the high generality, the microkernel has difficulty in dealing with each of the peripheral devices on a high level. As a result, its processing tends to become insufficient when an entertainment apparatus is used as a game apparatus which requires realtime processing. On the other hand, such a technique has also been available, wherein a dedicated processor for controlling peripheral devices is provided in addition to a CPU which creates a kernel. Entertainment apparatuses normally have no primary mass storage mediums. In such an entertainment apparatus, reading of program codes from a secondary storage medium such as a CD-ROM is essential. In this case, in order to reduce a load imposed on a CPU, the entertainment apparatus is provided with, for example, an I/O (input/ output) processor for performing such reading of the program codes, decoding and expansion of the read program codes, and others. In the entertainment apparatus having such an I/O processor, the I/O processor can be used as the foregoing dedicated processor for controlling peripheral devices. In this case, however, exchange of information including program codes and necessary data is essential between the I/O processor and the CPU. As a result, the number of times of copying and transferring the information in the entertainment apparatus tends to increase, which is not preferable for the entertainment apparatus requiring the high-speed processing. Further, a time for the CPU to await the processing of the I/O processor tends to be prolonged, which also impedes the high-speed processing. SUMMARY OF THE INVENTION Therefore, it is an object of the present invention to provide an improved technique which can eliminate one or more of the disadvantages inherent in the prior art. According to one aspect of the present invention, there is provided an entertainment apparatus comprising storing means for storing program codes outside a kernel, the program codes making a peripheral device operable when executed; device connecting means for connecting the peripheral device; and a kernel creator for executing entertainment processing which uses the peripheral device connected to the device connecting means and made operable, wherein the kernel creator causes control means to execute the program codes based on a remote procedure call so that the peripheral device is made operable. The remote procedure call is a technique wherein execution of part of an entertainment processing program, i.e. execution of a certain procedure included in the program, is entrusted to other execution means and a result of the execution is returned as return values like in a normal procedure call. In the present invention, the program codes for controlling the peripheral device are stored outside the kernel, and the control means (for example, a peripheral device control dedicated processor which is provided separately from a CPU) is caused to execute a certain procedure while the entertainment processing program is executed by the kernel creator. The control means reads the program codes and executes them to make the peripheral device operable. With this arrangement, the program codes for the peripheral device can be put not only outside the kernel, but also outside hardware resources (e.g. CPU and memory) managed by the kernel. This can improve the working efficiency of the hardware resources to increase the processing speed of the whole apparatus. Thus, the apparatus can even achieve the high-speed processing which temporarily requires realtime processing. It may be arranged that the kernel creator causes, based on the remote procedure call, the control means to read the program codes from the storing means and transfer a result of execution of the program codes through a direct memory access. Various manners may be adoptable for carrying out the direct memory access. Preferably, a queue is provided between the kernel creator and the peripheral device, and the control means performs data exchange between the peripheral device and the queue based on a first direct memory access, and performs data exchange between the kernel creator and the queue based on a second direct memory access which is asynchronous with the first direct memory access. With this arrangement, it is possible to store information into the queue even during execution of the entertainment processing. Further, by performing the remote procedure call based on the direct memory access, it is possible to directly transfer information addressed to the kernel creator from the peripheral device. This can reduce the number of times of copying and transferring information, which would otherwise have been a problem in the prior art. It may be arranged that the data exchange by the first direct memory access and the data exchange by the second direct memory access are executed according to a communication protocol which is commonly used at least in the apparatus. With this arrangement, the realtime processing is further ensured. As the communication protocol, a general purpose protocol used in the Ethernet, for example, may be used. Accordingly, a control of the apparatus free of a kind of peripheral device can be realized. Further, compatibility of program codes for peripheral devices can be ensured. It may be arranged that the peripheral device is detachably connected to the device connecting means and includes a secondary storage medium, wherein data to be used upon execution of the program codes is stored in the secondary storage medium, and wherein the data stored in the secondary storage medium is transferred to the kernel creator through a direct memory access upon the execution of the program codes. According to another aspect of the present invention, there is provided a kernel function realizing mechanism provided in an entertainment apparatus for controlling a peripheral device connected to the entertainment apparatus, the entertainment apparatus comprising a kernel creator for executing entertainment processing which uses the peripheral device being made operable through execution of program codes, wherein the program codes are stored outside a kernel, and the kernel creator causes control means to execute the program codes based on a remote procedure call so that the peripheral device is made operable. It may be arranged that at least data transfer addressed to the kernel creator from the peripheral device is performed by a direct memory access. It may be arranged that the data transfer is performed according to a communication protocol commonly used in the apparatus. According to another aspect of the present invention, there is provided a control method for controlling a peripheral device connected to an entertainment apparatus, the entertainment apparatus comprising a kernel creator for executing entertainment processing which uses the peripheral device being made operable through execution of program codes, wherein the program codes are stored outside a kernel, and the kernel creator causes control means to execute the program codes based on a remote procedure call so that the peripheral device is made operable. It may be arranged that at least data transfer addressed to the kernel creator from the peripheral device is performed by a direct memory access. It may be arranged that the data transfer is performed according to a communication protocol commonly used in the apparatus. According to another aspect of the present invention, there is provided, in an entertainment apparatus comprising control means for executing program codes stored outside a kernel, and device connecting means for connecting a peripheral device which is made operable through execution of the program codes, a semiconductor device comprising a kernel creator which causes the control means to execute the program codes based on a remote procedure call so that the peripheral device is made operable, and executes entertainment processing which uses the peripheral device being made operable. According to another aspect of the present invention, there is provided a computer program for operating, as an entertainment apparatus, a computer comprising control means for executing program codes stored outside a kernel, and device connecting means for connecting a peripheral device which is made operable through execution of the program codes, the computer program causing the entertainment apparatus to execute the steps of causing the control means to execute the program codes based on a remote procedure call so that the peripheral device is made operable; and executing entertainment processing which uses the peripheral device being made operable. BRIEF DESCRIPTION OF THE DRAWINGS The present invention will be understood more fully from the detailed description given hereinbelow, taken in conjunction with the accompanying drawings. In the drawings: Fig. 1 is a diagram showing a hardware structure of an entertainment apparatus according to a preferred embodiment of the present invention; Fig. 2 is a diagram for explaining a structure of a kernel according to the preferred embodiment; Fig. 3 is a diagram for explaining a processing procedure when an action occurs from an application to a controller; Fig. 4 is a diagram for explaining a processing procedure about data exchange via a queue; and Fig. 5 is a diagram for explaining a processing procedure when data generated in the controller is transferred to the application. DESCRIPTION OF THE PREFERRED EMBODIMENT Now, a preferred embodiment of an entertainment apparatus according to the present invention will be described hereinbelow with reference to the accompanying drawings. < Structure of Entertainment Apparatus> Fig. 1 shows a structure of the entertainment apparatus according to this embodiment. The entertainment apparatus is a kind of computer which can be used as a game apparatus, for example. The entertainment apparatus comprises a main bus MB and a sub-bus SB connected via a center bus CB provided with a queue 1. The entertainment apparatus further comprises various function realizing elements connected to the main bus MB and the sub-bus SB. The main bus MB is connected with a CPU 2, a memory 3, an image processor 4 and a second DMAC (direct memory access controller) 5. The sub-bus SB is connected with a disk drive 6, an I/O processor 7, a sound processor 8, a security module 9, a first DMAC 10, a controller 11, a memory card 12 and a ROM 13. The CPU 2 is a semiconductor device comprising a microprocessor. The microprocessor controls the whole operation of the entertainment apparatus and enables execution of game processing as an example of entertainment processing, including sound and image reproduction based on various data which are necessary upon the execution of the game processing. Further, upon starting up the entertainment apparatus, the microprocessor reads a boot program from the ROM 13 connected to the sub-bus SB and executes it to start an OS for creating a kernel. The memory 3 comprises a RAM and provides a working area for the CPU 2. Digital information, such as program codes and data for the game processing, read from a secondary storage medium M is written into the memory 3. In this embodiment, program codes and data necessary for controlling a peripheral device are not written into the memory 3, which will be described later. In the following description, if it is necessary to distinguish between the program codes for the game processing and the program codes for controlling the peripheral device, the former will be referred to as "application" and the latter will be referred to as "device driver" . Based on the digital information stored in the memory 3, the image processor 4 produces, cooperatively with the CPU 2, image data necessary for displaying images on a display unit (not shown), such as polygon data for expressing game characters and others and texture data including color information for the polygon data. Specifically, the image processor 4 comprises a geometry processing unit for performing a coordinate conversion of data read in the course of the game processing from among the digital information stored in the memory 3, a decoder for decoding the contents of the geometry processing, a rendering unit for producing the foregoing image data per frame based on graphic or drawing data obtained through the geometry processing, and a mechanism for displaying the produced image data on the display unit. The queue 1 temporarily stores information exchanged between the main bus MB and the sub-bus SB, that is, various commands and data which are used in the control of the peripheral device executed by the I/O processor 7 based on an RPC (remote procedure call). In this embodiment, the queue 1 temporarily stores, for example, information which is exchanged between the memory 3 and the I/O processor 7, between the memory 3 and the controller 11 or the memory card 12, or between these devices and other devices. The disk drive 6 receives therein the secondary storage medium M such as a CD-ROM or DVD-ROM, and reads the digital information, i.e. the application and data, from the secondary storage medium M. The application represents program codes for controlling the development of the game and reproducing sounds and images following the development of the game, while the data represent data which are used upon reproducing the sounds and images. In this embodiment, the application and data are recorded in the secondary storage medium M after they have been compressed and partly encrypted. Alternatively, encryption may be applied to all the compressed application and data. The I/O processor 7 is a semiconductor device which controls the disk drive 6 to read the application and data from the secondary storage medium M and further carries out decoding and expansion of the read digital information cooperatively with the security module 9. A program (control program) which realizes these functions of the I/O processor 7 is stored, for example, in the ROM 13, and the I/O processor 7 executes it upon the start of the entertainment apparatus. The security module 9 is in the form of a single semiconductor chip having a dedicated processor and a memory, the dedicated processor functioning to ensure security of the entertainment apparatus. The security module 9 holds decoding keys which are necessary for the I/O processor 7 to decode the digital information. The security module 9 sends a necessary decoding key to the I/O processor 7 when the I/O processor 7 performs decoding of the digital information. In this embodiment, it is arranged that the security module 9 can also perform decoding of encrypted digital information even independently. The sound processor 8 is connected to a speaker (not shown) . The sound processor 8 reads data corresponding to a sound command sent from the I/O processor 7 or the first DMAC 10, from a sound memory (not shown) provided in the sound processor 8 to produce sound data, and outputs the produced sound data to the speaker. In response thereto, the speaker generates sound effects for the game or BGM sounds or the like for the image under the control of the sound processor 8. The controller 11 and the memory card 12 are examples of peripheral devices connected to the entertainment apparatus. Specifically, the controller 11 and the memory card 12 are connected to the sub-bus SB via respective input terminals (not shown). Each of the controller 11 and the memory card 12 is made operable through execution of a corresponding device driver. In this embodiment, the sub-bus SB forms device connecting means cooperatively with the foregoing input terminal and a control mechanism (not shown) for the sub-bus SB. The controller 11 is an input device for inputting an intention of a game player into the entertainment apparatus. For example, the controller 11 is operated for inputting a request for moving a cursor in an upward, downward, rightward or leftward direction or inputting a request for execution of a certain process. The memory card 12 comprises a flash memory (flash ROM) encased in a card of a given size. When a game is of a type which produces recordable game data during the progress of the game, a game player uses the memory card 12 to record the game data therein upon interruption of the game or at the end of the game. Instead of the memory card 12 or in addition to the memory card 12, a flash memory may be incorporated in the controller 11. The first DMAC 10 and the second DMAC 5 cooperatively work to allow the I/O processor 7 to perform the RPC by a DMA (direct memory access). The first DMAC 10 controls at least reading and writing of information exchanged between the controller 11 and /or the memory card 12 and the queue 1. The second DMAC 5 controls at least reading and writing of information exchanged between the memory 3 and the queue 1. In this embodiment, two DMACs are provided for agreement with the number of buses. However, the first DMAC 10 and the second DMAC 5 may be realized by one control module. <Kernel Function Realizing Mechanism> In this embodiment, all requests from the executed application to the controller 11 are carried out based on the RPC through the DMA. For this purpose, a device driver necessary for operating the controller 11 is stored in storing means outside the kernel, such as the secondary storage medium M, the flash memory of the memory card 12 or the ROM 13, and is allowed to be executed by the I/O processor 7 during the execution of the application. In this embodiment, the device driver is stored in the ROM 13. Fig. 2 shows a structure of the kernel according to this embodiment. Specifically, the kernel is formed therein with a function of performing a task management and a function of performing an interrupt control. The kernel (excluding microkernel) in the conventional entertainment apparatus of this type is also provided therein with device drivers for peripheral devices. On the other hand, in this embodiment, device drivers for peripheral devices are stored in the storing means outside the kernel, i.e. in the ROM 13. When a control of the peripheral device such as the controller 11 becomes necessary, the CPU 2 causes the I/O processor 7 to read the corresponding device driver from the ROM 13 and execute it through the RPC. This renders the controller 11 operable. When the peripheral device is controlled based on the RPC, a result of the control is transferred to the kernel as so-called return values. In this embodiment, since this transfer is performed by the DMA, the high-speed control of the peripheral device can be achieved. <Peripheral Device Control Method by Kernel> Now, a peripheral device control method in the entertainment apparatus having the foregoing kernel function realizing mechanism will be described with reference to Figs. 3 to 5. Hereinbelow, among various functions of the kernel, the function of controlling the operation of the peripheral device will be explained. In the following explanation, the peripheral device is assumed to be the controller 11. However, the following explanation may also be applicable to other peripheral devices. The RPC is executed not using a dedicated communication protocol therefor, but using a communication protocol which is used commonly in the entertainment apparatus. (Application→Controiler 11: Figs. 3 and 4) As shown in Fig. 3, while the CPU 2 executes the application based on the program codes and data stored in the memory 3 (step SlOl), if some action to the controller 11 is required, the application makes a RPC request therefore (step SI 02). For example, if the controller 11 is provided with a vibration generating mechanism and it is required to operate this vibration generating mechanism to enhance the entertainment effect in a given scene of the game, the application provides information necessary for operating the vibration generating mechanism. This information is transferred from the memory 3 to the queue 1 by the second DMAC 5 through a DMA and temporarily stored in the queue 1 (steps SI 03 and SI 04). Referring now to Fig. 4, the I/O processor 7 seeks the device driver of the controller 11 from the ROM 13 based on the information stored in the queue 1 and executes it (steps S105 and SI 06). Accordingly, the request from the application is transferred to the controller 11 without passing through the CPU 2 (step SI 07). (Controller l l→Application: Figs. 4 and 5) In Fig. 4, data generated in the controller 11 is temporarily stored in the queue 1 via the first DMAC 10 (steps S201 and S202). The data includes, for example, such data inputted by a game player using the controller 11, or such data about which of analog and digital inputs is used in the controller 11 when both inputs can be used. Referring now to Fig. 5, the data stored in the queue 1 is read by the second DMAC 5 at a given timing and transferred to the memory 3 (step S203). The second DMAC 5 notifies the CPU 2 that the data has been stored in the memory 3 (steps S204 and S205). The CPU 2 uses the data stored in the memory 3 as data for subsequent execution of the application (step S206). For example, when a key input for rightward movement has occurred in the controller 11, a given character displayed on the display unit is moved rightward. In the foregoing fashion, the transfer of the request from the application to the controller 11 and the transfer of the data from the controller 11 to the application can be easily realized using the DMA. In this case, the request and data are transferred and stored in the memory 3 without being directly processed by the CPU 2. The RPC is a mechanism having a high affinity with parallel programming. Thus, the CPU 2 does not need to await a response from the I/O processor 7 for a long time. This can reduce the number of times of copying and transferring information, which would otherwise have been a problem in many systems having an I/O processor, so that the high working rate of the CPU 2 can be achieved. As described above, in the entertainment apparatus according to this embodiment, when the entertainment processing using the controller 11 is performed, the device driver for the controller 11 is executed through the RPC. This makes it possible to place the device driver not only outside the kernel, but also outside the resources (CPU 2 and memory 3) managed by the kernel, so that the execution efficiency of the entertainment processing can be improved. Further, since the RPC is executed through the DMA, the direct data transfer from the controller 11 to the memory 3 can be achieved to reduce the number of times of data copying and transfer in the CPU 2. Further, since data exchange between the controller 11 and the queue 1 and data exchange between the queue 1 and the CPU 2 (kernel) are executed through the mutually asynchronous DMAs, even if some time-lag is caused between an occurrence of a request from the application and an occurrence of data generation in the controller 11, data exchange can be stably carried out therebetween. Further, since the data exchange is performed based on a communication protocol commonly used in the apparatus, a control of the apparatus free of a kind of device driver can be realized. While the present invention has been described in terms of the preferred embodiment, the invention is not to be limited thereto, but can be embodied in various ways without departing from the principle of the invention as defined in the appended claims. In the foregoing description, the explanation has been made to the characteristic kernel function realizing mechanism achieved by the entertainment apparatus as shown in Fig. 1 and the peripheral device control method using this kernel function realizing mechanism. On the other hand, the present invention is also applicable to a case wherein a computer program (excluding an application and device drivers) is read into a general purpose computer installed with an OS and executed by the computer so that the foregoing kernel function realizing mechanism and peripheral device control method are achieved. Further, the foregoing kernel function realizing mechanism and peripheral device control method can also be achieved with cooperation of a general purpose computer installed with an OS and one or more semiconductor devices. The semiconductor device includes a processor and is installed with a program for providing required functions to the processor.

Claims: CLAIMS 1. An entertainment apparatus comprising: storing means for storing program codes outside a kernel, said program codes making a peripheral device operable when executed; device connecting means for connecting the peripheral device; and a kernel creator for executing entertainment processing which uses the peripheral device connected to the device connecting means and made operable, wherein said kernel creator causes control means to execute the program codes based on a remote procedure call so that the peripheral device is made operable. 2. The entertainment apparatus according to claim 1, wherein said kernel creator causes, based on the remote procedure call, the control means to read the program codes from the storing means and transfer a result of execution of the program codes through a direct memory access. 3. The entertainment apparatus according to claim 2, further comprising a queue provided between the kernel creator and the peripheral device, wherein said control means performs data exchange between the peripheral device and the queue based on a first direct memory access, and performs data exchange between the kernel creator and the queue based on a second direct memory access which is asynchronous with the first direct memory access. 4. The entertainment apparatus according to claim 3, wherein the data exchange by the first direct memory access and the data exchange by the second direct memory access are executed according to a communication protocol which is commonly used at least in the apparatus. 5. The entertainment apparatus according to claim 1, wherein said peripheral device is detachably connected to the device connecting means and includes a secondary storage medium, wherein data to be used upon execution of the program codes is stored in the secondary storage medium, and wherein the data stored in the secondary storage medium is transferred to the kernel creator through a direct memory access upon the execution of the program codes. 6. A kernel function realizing mechanism provided in an entertainment apparatus for controlling a peripheral device connected to the entertainment apparatus, said entertainment apparatus comprising a kernel creator for executing entertainment processing which uses the peripheral device being made operable through execution of program codes, wherein said program codes are stored outside a kernel, and said kernel creator causes control means to execute said program codes based on a remote procedure call so that the peripheral device is made operable. 7. The kernel function realizing mechanism according to claim 6, wherein at least data transfer addressed to the kernel creator from the peripheral device is performed by a direct memory access. 8. The kernel function realizing mechanism according to claim 7, wherein said data transfer is performed according to a communication protocol commonly used in the apparatus. 9. A control method for controlling a peripheral device connected to an entertainment apparatus, said entertainment apparatus comprising a kernel creator for executing entertainment processing which uses the peripheral device being made operable through execution of program codes, wherein said program codes are stored outside a kernel, and said kernel creator causes control means to execute said program codes based on a remote procedure call so that the peripheral device is made operable. 10. The control method according to claim 9, wherein at least data transfer addressed to the kernel creator from the peripheral device is performed by a direct memory access. 11. The control method according to claim 10, wherein said data transfer is performed according to a communication protocol commonly used in the apparatus. 12. In an entertainment apparatus comprising control means for executing program codes stored outside a kernel, and device connecting means for connecting a peripheral device which is made operable through execution of the program codes, a semiconductor device comprising: a kernel creator which causes the control means to execute said program codes based on a remote procedure call so that the peripheral device is made operable, and executes entertainment processing which uses the peripheral device being made operable. 13. A computer program for operating, as an entertainment apparatus, a computer comprising control means for executing program codes stored outside a kernel, and device connecting means for connecting a peripheral device which is made operable through execution of the program codes, said computer program causing the entertainment apparatus to execute the steps of: causing the control means to execute said program codes based on a remote procedure call so that the peripheral device is made operable; and executing entertainment processing which uses the peripheral device being made operable.

Inventors: HAKAMATANI TADAYASU, HORIKAWA TSUTOMU, HAKAMATANI, TADAYASU, HORIKAWA, TSUTOMU
Applicants: SONY COMP ENTERTAINMENT INC, SONY COMPUTER ENTERTAINMENT INC.
Application year: 2001
Main classification: G06F9
IPC codes: G06F9, G06F13