WO2006070939A1 - Program executed under control of operating system providing kernel mode and user mode - Google Patents
Program executed under control of operating system providing kernel mode and user mode Download PDFInfo
- Publication number
- WO2006070939A1 WO2006070939A1 PCT/JP2005/024271 JP2005024271W WO2006070939A1 WO 2006070939 A1 WO2006070939 A1 WO 2006070939A1 JP 2005024271 W JP2005024271 W JP 2005024271W WO 2006070939 A1 WO2006070939 A1 WO 2006070939A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- computer
- program
- mode
- under control
- script
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
Definitions
- the present invention relates to a program, etc. executed under the control of an operating system which provides a kernel mode and a user mode, and particularly relates to a program, a data processing apparatus, and a data processing method for realizing a plurality of functions.
- OS operating system
- an OS that has become commonplace provides, as its operation modes, a plurality of privileged modes which can execute different ranges of processes from each other.
- the computer developer has to create a plurality of programs to be executed under each of a plurality of privileged modes.
- an OS has a kernel mode as one privileged mode that cannot provide a user interface but can provide a function for controlling hardware and a user mode as another privileged mode that cannot provide a function for controlling hardware but can provide a user interface
- a function for controlling hardware under the instructions from the user requires creation of an application program operating in the user mode and a device driver as a program operating in the kernel mode.
- the present invention was made in view of the above-described circumstances, and an object of the present invention is to provide a program, a data processing apparatus, and a data processing method capable of facilitating unspecified or many functions to be easily realized under the control of an operating system having a plurality of privileged modes.
- a program according to a first aspect of the present invention is executed by a computer in a kernel mode under control of an operating system which, by being executed by the computer, controls the computer to realize the kernel mode as a first privileged mode and a user mode as a second privileged mode, and controls the computer to execute in the kernel mode: a function of specifying a process which should be executed in the kernel mode by interpreting a script describing the process, when the computer creates the script by executing an application program in the user mode under control of the operating system; and a function of executing the specified process.
- a computer executing the present program can execute a process in the kernel mode, because the script is passed from the process in the user mode to the process in the kernel mode. Furthermore, in a case where unspecified or many functions are desired to be realized under control of the operating system, the present program needs not be updated. Accordingly, it becomes easier to realize the unspecified or many functions, if the present program executed in the kernel mode is used.
- the program may control the computer to execute a function of specifying a process for controlling the device, and executing the specified process in the kernel mode.
- a computer-readable recording medium stores a program executed by a computer in a kernel mode under control of an operating system which, by being executed by the computer, controls the computer to realize the kernel mode as a first privileged mode and a user mode as a second privileged mode, and the program controls the computer to execute in the kernel mode: a function of specifying a process which should be executed in the kernel mode by interpreting a script describing the process, when the computer creates the script by executing an application program in the user mode under control of the operating system; and a function of executing the specified process.
- the program stored in the recording medium may control the computer to execute a function of specifying a process for controlling the device, and executing the specified process in the kernel mode.
- a data processing apparatus is constituted by a computer executing an operating system controlling the computer to realize a kernel mode as a first privileged mode and a user mode as a second privileged mode, and the computer: executes a driver program in the kernel mode under control of the operating system; executes an application program in the user mode under control of the operating system; creates a script describing a process which should be executed under control of the driver program, under control of the application program; and specifies the process by interpreting the script under control of the driver program, and executes the specified process under control of the driver program.
- the present data processing apparatus can execute a process in the kernel mode, because the script is passed from the process in the user mode to the process in the kernel mode. Furthermore, in a case where unspecified or many functions are desired to be realized under control of the operating system, the driver program needs not be updated. Accordingly, it becomes easier to realize the unspecified or many functions, with the use of the driver program.
- the driver program may comprise a program for controlling a processor included in the computer to execute a process for controlling a device connected to the processor.
- the application program may comprise a program for controlling the computer to create the script, which describes a procedure of a control on the device which should be executed under control of the driver program.
- a data processing method is a method for a computer operating under an operating system providing a kernel mode as a first privileged mode and a user mode as a second privileged mode, and comprises: a step of creating, under control of an application program operating in the user mode, a script describing a process which should be executed under control of a driver program operating in the kernel mode, when data exchange between the application program and the driver program becomes necessary during executing the application program; a step of acquiring the script when the process becomes necessary during executing the driver program, and specifying the process by interpreting the acquired script under control of the driver program; and a step of executing the specified process under control of the driver program.
- the driver program may comprise a program for controlling a processor included in the computer to execute a process for controlling a device connected to the processor, hi this case, the application program may comprise a program for controlling the computer to create the script, which describes a procedure of a control on the device which should be executed under control of the driver program.
- FIG. 1 is a block diagram showing the physical structure of a computer system according to an embodiment of the present invention
- FIG. 2 is a diagram exemplarily showing the logical structure of the computer system shown in FIG. 1;
- FIG. 3 is a diagram showing an example of a command set
- FIG. 4 is a diagram showing an example of a script describing a process for responding to an interruption
- FIG. 5 is a diagram showing an example of a script describing a process for controlling DMA (Direct Memory Access); and
- FIG. 6 is a diagram showing a flow of a process executed by the computer system shown in FIG. 1.
- FIG. 1 is a diagram showing the physical structure of a computer system according to the embodiment of the present invention. As shown in FIG. 1, the present computer system comprises a computer 1 and a peripheral device 2.
- the computer 1 comprises a processor 11, a volatile memory 12, a non-volatile memory 13, an input unit 14, an output unit 15, a recording medium drive unit 16, and a peripheral device interface unit 17.
- the volatile memory 12, the non-volatile memory 13, the input unit 14, the output unit 15, the recording medium drive unit 16, and the peripheral device interface unit 17 are connected to the processor 11 via an internal bus.
- the processor 11 is constituted by a CPU (Central Processing Unit), a DSP (Digital Signal Processor) or the like.
- the processor 11 reads later-described programs such as an operating system (OS), a user mode application program (which may hereinafter be abbreviated as "application”), a kernel mode device driver (which may hereinafter be abbreviated as “device driver”), etc., stored in the non- volatile memory 13, and executes these programs, thereby executing later-described processes.
- the volatile memory 12 is constituted by a RAM (Random Access Memory) or the like.
- the volatile memory 12 stores data or supplies data to the processor 11 in response to an access from the processor 11.
- the storage area of the volatile memory 12 serves as the work area of the processor 11.
- the non- volatile memory 13 is constituted by a hard disk device or the like.
- the non- volatile memory 13 pre-stores the aforementioned OS, and supplies the OS to the processor 11 in response to a read access from the processor 11.
- the OS stored in the non- volatile memory 13 provides at least two kinds of privileged modes.
- One of these two kinds of privileged modes is a kernel mode, and the other is a user mode.
- an OS that provides a plurality of privileged modes for example, LinuxTM, WindowsTM from Microsoft, etc. can be listed.
- the processor 11 can execute a process for directly controlling the peripheral device 2, the volatile memory 12, etc. That is, in the kernel mode, the processor 11 can execute a process for controlling the peripheral device 2, the volatile memory 12, etc. without processes in the other privileged mode. Specifically, in the kernel mode, the processor 11 can execute a process for responding to hardware interruption by the peripheral device 2, etc. into the processor 11, a process for controlling DMA (Direct Memory Access) on the volatile memory 12, etc. On the other hand, in the kernel mode, the processor 11 cannot execute a process for providing the function of user interface or a process for providing a function for data processing.
- DMA Direct Memory Access
- the processor 11 cannot execute a process for providing the function of user interface for entering data in accordance with the operator's operations and outputting data so that the operator can view the data, or a process for providing a function for data processing such as receiving data from the peripheral device 2, etc. processing the received data, and outputting it to the peripheral device 2, etc.
- the processor 11 can execute a process for providing the function of user interface, and a process for providing the function for data processing.
- the processor 11 cannot execute a process for directly controlling the peripheral device 2, the volatile memory 12, etc., such as responding to an interruption into the processor 11, controlling DMA, etc.
- the processor 11 Under the control of the OS, the processor 11 acquires the above-described device driver and application from a recording medium set in the recording medium drive unit 16, etc. in accordance with an operation of the user operating the computer system, and rewritably stores the acquired programs in the non- volatile memory 13.
- the non- volatile memory 13 supplies the stored application to the processor 11 in response to a read access from the processor 11.
- the aforementioned device driver stored in the non- volatile memory 13 is a program to be executed by the processor 11 under the control of the OS in the above-described kernel mode, in accordance with a procedure to be described later.
- the device driver causes the processor 11 to directly control the peripheral device 2, the volatile memory 12, etc., thereby causing the processor 11 to execute a process for responding to an interruption and a process for controlling DMA.
- the device driver causes the processor 11 to execute in the kernel mode a function for "acquiring scripts created in a process in the user mode that describe procedures for the process for responding to an interruption and process for controlling
- the scripts consist of a plurality of procedures, and the procedures consist of commands and parameters.
- the processor 11 processes the procedures by using an interpreter and sets parameters which are necessary for controlling the device.
- a specific example of the command set is shown in FIG. 3.
- the above-described application is a program that is executed by the processor 11 under the control of the OS in the above-described user mode, in accordance with a procedure to be described later.
- the processes which the application causes the processor 11 to execute include the above-described process for creating a script.
- a specific example of the script is as shown in FIG. 4, which describes the process for responding to an interruption.
- Another example of the script is as shown in
- the input unit 14 comprises a keyboard, a pointing device, etc.
- the input unit 14 supplies data according to operations of an operator to the processor 11.
- the output unit 15 is constituted by a liquid crystal display device or the like.
- the output unit 15 displays characters and figures according to instructions of the processor
- the recording medium drive unit 16 is constituted by a recording medium drive device (a flexible disk drive, a CD-ROM drive, etc.) for reading data recorded on a recording medium (such as a flexible disk, a CD-R (Compact Disk-Recordable), etc.).
- the recording medium drive unit 16 reads data from a recording medium set therein and supplies it to the processor 11, or writes data in the recording medium, in accordance with instructions from the processor 11.
- the peripheral device interface unit 17 is constituted by a PCI (Personal Computer Interface) circuit or the like, and comprises a slot into which a peripheral device (for example, the peripheral device 2) can detachably be inserted.
- the peripheral device interface circuit 17 intermediates data exchange between the peripheral device inserted in its slot and the component of the computer 1 (specifically, some or all of the processor 11, the volatile memory 12, the non- volatile memory 13, the input unit 14, the output unit 15, and the recording medium drive unit 16).
- the peripheral device 2 is constituted by a microcomputer, other arbitrary electronic circuits, or the like, and is structured to be able to be detachably inserted into the slot of the peripheral device interface unit 17.
- the peripheral device 2 when inserted in the slot of the peripheral device interface unit 17, exchanges data with the components of the computer 1 via the peripheral device interface unit 17.
- FIG. 6 is a diagram showing the flow of the operation of the computer system shown in FIG. 1.
- the processor 11 When the computer system is activated, the processor 11 firstly accesses the non- volatile memory 13, reads the OS from the non- volatile memory 13, and executes it.
- the processor 11 loads the device driver. That is, the processor 11 reads the device driver from the non- volatile memory 13 under the control of the OS, and stores the device driver in a storage area of the volatile memory 12 in order to render it executable in the kernel mode. Then, the processor 11 reads the application from the non- volatile memory 13 under the control of the OS in response to an instruction from the user operating the input unit 14, and stores the application in a storage area of the volatile memory 12 in order to render it executable in the user mode. The processor 11 executes the stored application in the user mode.
- the processor 11 requests opening of the device driver (FIG. 6, step SIl) as such requesting is included in the process of the application.
- the processor 11 executes the device driver stored in the volatile memory 12 in the kernel mode under the control of the OS.
- the processor 11 creates a script describing a process for responding to an interruption as shown in FIG. 4 and a script describing a process for controlling DMA as shown in FIG. 5 under the control of the application, and stores the created scripts in a storage area of the volatile memory 12 (steps S12 and S13).
- the processor 11 creates and stores the script to set parameters (for example, mask interruption, clear interruption factor) for the peripheral device 2 to notify the process of the application that the peripheral device 2 has completed the data transfer. Then, at step S 13, the processor 11 creates and stores the script to set various parameters (for example, source address, destination address, number of bytes that can be transferred, transfer direction) for data transfer by DMA.
- parameters for example, mask interruption, clear interruption factor
- the processor 11 acquires the script describing the process for controlling DMA from the storage area of the volatile memory 12 under the control of the device driver, and interprets the acquired script and sets various parameters (step S21). That is, the processor 11 sets various parameters (for example, source address, destination address, number of bytes that can be transferred, transfer direction) necessary for data transfer by DMA that is to be executed based on the process by the device driver, in accordance with the content of the script created and stored at step S 13.
- various parameters for example, source address, destination address, number of bytes that can be transferred, transfer direction
- the processor 11 keeps the script created and stored at step S 12 unexecuted until the peripheral device 2 starts interruption (i.e., until the later-described process at step S32 is executed).
- the processor 11 instructs the peripheral device 2 to start DMA.
- the peripheral device 2 starts data transfer by DMA to the volatile memory 12 in the computer 1 (steps S22 and S31).
- the peripheral device 2 sends a signal indicating an interruption request to the processor 11 (step S32).
- the peripheral device 2 performs data transfer to the volatile memory 12 plural times, and sends the signal indicating the interruption request after the last transmission is completed.
- the processor 11 being executing the process of the device driver, acquires the script crated and stored at step S 12 in response to the signal indicating the interruption request, and sets various parameters (for example, mask interruption, clear interruption factor) for notifying the application that DMA is completed by an interruption, in accordance with the content of the acquired script (step S23). Then, in a case where the interruption shows that DMA is completed, the processor 11 creates a notification of DMA completion, and passes it to the process of the application (step S24). As the result of step S24, the DMA is completed.
- various parameters for example, mask interruption, clear interruption factor
- the computer system can allow the scripts to be passed from the process in the user mode to the process in the kernel mode, enabling the process that cannot be executed in the user mode to be executed in the kernel mode. Furthermore, in a case where unspecified or many functions are desired to be realized under the control of the OS, the device driver needs not be updated. Accordingly, it becomes easier to realize the unspecified or many functions by using the device driver.
- the present computer system is not limited to the above-described one.
- the computer 1 and the peripheral device 2 need not necessarily be connected to each other via a PCI, but the manners of their connection are arbitrary. Accordingly, the computer 1 and the peripheral device 2 may be directly connected to each other via an internal bus, or may be connected via an ATAPI (AT Attachment Packet Interface), a USB (Universal Serial Bus) interface, an IEEE 1394 interface, a BluetoothTM, or oilier arbitrary interface circuits.
- ATAPI AT Attachment Packet Interface
- USB Universal Serial Bus
- IEEE 1394 IEEE 1394
- BluetoothTM BluetoothTM
- oilier arbitrary interface circuits or oilier arbitrary interface circuits.
- the process the device driver causes the processor 11 to execute is not limited to response to an interruption or DMA control. Accordingly, for example, the device driver may cause the processor 11 to execute arbitrary processes for controlling the units of the computer 1 or arbitrary devices connected to the computer 1. Meanwhile, the computer system may not comprise the peripheral device 2. In this case, the computer 1 may not be so structured as to have the peripheral device 2 insertable.
- the command set provided by the device driver may include a command that macro-wise defines a predetermined series of processes to be executed under the control of the OS.
- the script may not be created by the processor 11 in the process of the application. Accordingly, for example, the script may be created beforehand and stored in a storage area of the non- volatile memory 13 or an arbitrary recording medium that can be read by the recording medium drive unit 16. In this case, the processor 11 may be so arranged as to read the script from the non- volatile memory 13 or the recording medium at an arbitrary timing in accordance with the process of the application.
- the processor 11 may read a fixed file including the script from an external storage device or the like, and store it in a storage area of the non- volatile memory 13, so that it can read and interpret it at a required timing.
- the processor 11 may use a script stored in the non- volatile memory 13 or the like, together with a script which the processor 11 itself will create in accordance with the process of the application.
- the embodiment of the present invention has been explained.
- the computer system of the present invention needs not be a specialized system, but may be an ordinary computer system.
- a computer system that executes the above-described processes can be constituted by installing the above-described device driver and application on, for example, a personal computer from one or a plurality of recording media (flexible disk, CD-ROM, etc.) that store these device driver and application.
- these device driver and application may be uploaded on a BBS (Bulletin Board System) on a communication line so as to be distributed through the communication line, or a carrier wave may be modulated by a signal representing these device driver and application and the obtained modulated wave may be transmitted, so that an apparatus that receives this modulated wave may demodulate the modulated wave and restore the programs.
- BBS Battery Bulletin Board System
- a carrier wave may be modulated by a signal representing these device driver and application and the obtained modulated wave may be transmitted, so that an apparatus that receives this modulated wave may demodulate the modulated wave and restore the programs.
- a program from which such part is excluded may be stored in a recording medium.
- a program for realizing each function or step to be executed by the computer is stored in such a recording medium.
- the present invention is effective in developing a device driver for each device involved, under an OS that puts some restrictions on accesses from an application to hardware.
- the present invention can be effectively utilized for debugging or evaluating plural kinds of devices.
- Various embodiments and changes may be made thereunto without departing from the broad spirit and scope of the invention.
- the above-described embodiment is intended to illustrate the present invention, not to limit the scope of the present invention.
- the scope of the present invention is shown by the attached claims rather than the embodiment.
- Various modifications made within the meaning of an equivalent of the claims of the invention and within the claims are to be regarded to be in the scope of the present invention. This application is based on Japanese Patent Application No. 2004-381196 filed on
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Provided is a program for easily realizing unspecified or many functions under control of an operating system having a plurality of privileged modes. A computer (1) executes an operating system (OS) providing a kernel mode and a user mode, executes a device driver in the kernel mode, and executes an application program in the user mode under control of the OS. Under control of the application program, the computer (1) creates a script describing a process which should be executed under control of the device driver (e.g., a process for controlling a peripheral device (2), etc.). The computer (1) specifies the process described in the script by interpreting the script under control of the device driver, and executers the specified process under control of the device driver.
Description
DESCRIPTION
PROGRAM EXECUTED UNDER CONTROL OF OPERATING SYSTEM PROVIDING KERNEL MODE AND USER MODE
Technical Field
The present invention relates to a program, etc. executed under the control of an operating system which provides a kernel mode and a user mode, and particularly relates to a program, a data processing apparatus, and a data processing method for realizing a plurality of functions.
Background Art
Recently, computers have come to have complicated functions along with their ever-growing operating performance. Thus, computer program developers have to take into consideration various things such as introduction of more and more efficiency into computer processing, improvement of computer operability for users, convenience in program development for program developers, and various other concerns required for various purposes.
Thus, it has become common that a function of a computer to execute a desired process is realized by an operating system (OS) as the underlying basic program, and by another program executed under the control of the OS.
However, lately, the OS itself has become complicated. For example, for the purposes of providing interface between the computer and the user and also between the computer and the computer developer, preventing unauthorized access, etc, an OS that has become commonplace provides, as its operation modes, a plurality of privileged modes which can execute different ranges of processes from each other.
Accordingly, in a case where a function desired to be executed by a computer cannot be realized under one privileged mode, the computer developer has to create a
plurality of programs to be executed under each of a plurality of privileged modes.
For example, in a case where an OS has a kernel mode as one privileged mode that cannot provide a user interface but can provide a function for controlling hardware and a user mode as another privileged mode that cannot provide a function for controlling hardware but can provide a user interface, to enjoy a function for controlling hardware under the instructions from the user requires creation of an application program operating in the user mode and a device driver as a program operating in the kernel mode.
Furthermore, in order to make a plurality of functions to work in cooperation with each other, programs realizing the respective functions need to keep correspondence with each other. Hence, techniques for facilitating such correspondence have been proposed, such as one disclosed in Unexamined Japanese Patent Application KOKAI Publication No. 2001-222412.
However, conventionally a program is prepared for each desired function, and even the use of the technique of Unexamined Japanese Patent Application KOKAI Publication No. 2001-222412 cannot have lessened the complexity of program development in a case where unspecified or many functions are desired, because it is necessary to create many programs that can realize these functions and can keep proper correspondence with each other. For example, in a case where a device driver is to be prepared for each of plural kinds of hardware in order to enable a computer to be used with these plural kinds of hardware connected, programs that can enable the device drivers to keep proper correspondence with each other cannot be created without much complication. Especially, if these programs are to be developed by different developers, problems will arise, such as increase in personnel expenses, difficulty and accompanying confusions in unifying the specs, etc. The present invention was made in view of the above-described circumstances, and an object of the present invention is to provide a program, a data processing apparatus, and a data processing method capable of facilitating unspecified or many functions to be
easily realized under the control of an operating system having a plurality of privileged modes.
Disclosure of Invention
To achieve the above object, a program according to a first aspect of the present invention is executed by a computer in a kernel mode under control of an operating system which, by being executed by the computer, controls the computer to realize the kernel mode as a first privileged mode and a user mode as a second privileged mode, and controls the computer to execute in the kernel mode: a function of specifying a process which should be executed in the kernel mode by interpreting a script describing the process, when the computer creates the script by executing an application program in the user mode under control of the operating system; and a function of executing the specified process.
In spite of being unable to execute a process in the user mode, a computer executing the present program can execute a process in the kernel mode, because the script is passed from the process in the user mode to the process in the kernel mode. Furthermore, in a case where unspecified or many functions are desired to be realized under control of the operating system, the present program needs not be updated. Accordingly, it becomes easier to realize the unspecified or many functions, if the present program executed in the kernel mode is used.
In a case where a device is connected to a processor included in the computer and the script describes a procedure of a control which should be executed by the processor on the device in the kernel mode, the program may control the computer to execute a function of specifying a process for controlling the device, and executing the specified process in the kernel mode.
A computer-readable recording medium according to a second aspect of the present invention stores a program executed by a computer in a kernel mode under control of an
operating system which, by being executed by the computer, controls the computer to realize the kernel mode as a first privileged mode and a user mode as a second privileged mode, and the program controls the computer to execute in the kernel mode: a function of specifying a process which should be executed in the kernel mode by interpreting a script describing the process, when the computer creates the script by executing an application program in the user mode under control of the operating system; and a function of executing the specified process.
In a case where a device is connected to a processor included in the computer and the script describes a procedure of a control which should be executed by the processor on the device in the kernel mode, the program stored in the recording medium may control the computer to execute a function of specifying a process for controlling the device, and executing the specified process in the kernel mode.
A data processing apparatus according to a third aspect of the present invention is constituted by a computer executing an operating system controlling the computer to realize a kernel mode as a first privileged mode and a user mode as a second privileged mode, and the computer: executes a driver program in the kernel mode under control of the operating system; executes an application program in the user mode under control of the operating system; creates a script describing a process which should be executed under control of the driver program, under control of the application program; and specifies the process by interpreting the script under control of the driver program, and executes the specified process under control of the driver program. In spite of being unable to execute a process in the user mode, the present data processing apparatus can execute a process in the kernel mode, because the script is passed from the process in the user mode to the process in the kernel mode.
Furthermore, in a case where unspecified or many functions are desired to be realized under control of the operating system, the driver program needs not be updated. Accordingly, it becomes easier to realize the unspecified or many functions, with the use of the driver program. The driver program may comprise a program for controlling a processor included in the computer to execute a process for controlling a device connected to the processor. In this case, the application program may comprise a program for controlling the computer to create the script, which describes a procedure of a control on the device which should be executed under control of the driver program. A data processing method according to a fourth aspect of the present invention is a method for a computer operating under an operating system providing a kernel mode as a first privileged mode and a user mode as a second privileged mode, and comprises: a step of creating, under control of an application program operating in the user mode, a script describing a process which should be executed under control of a driver program operating in the kernel mode, when data exchange between the application program and the driver program becomes necessary during executing the application program; a step of acquiring the script when the process becomes necessary during executing the driver program, and specifying the process by interpreting the acquired script under control of the driver program; and a step of executing the specified process under control of the driver program. According to the present data processing method, since the script is passed from the process in the user mode to the process in the kernel mode, a process which cannot be executed in the user mode can be executed in the kernel mode. Furthermore, in a case where unspecified or many functions are desired to be realized under control of the operating system, the driver program needs not be updated. Accordingly, it becomes easier to realize the unspecified or many functions, with the use of the driver program.
The driver program may comprise a program for controlling a processor included in the computer to execute a process for controlling a device connected to the processor, hi this case, the application program may comprise a program for controlling the computer to create the script, which describes a procedure of a control on the device which should be executed under control of the driver program.
According to the present invention, it is possible to easily realize unspecified or many functions under control of an operating system having a plurality of privileged modes.
Brief Description of Drawings These objects and other objects and advantages of the present invention will become more apparent upon reading of the following detailed description and the accompanying drawings in which:
FIG. 1 is a block diagram showing the physical structure of a computer system according to an embodiment of the present invention; FIG. 2 is a diagram exemplarily showing the logical structure of the computer system shown in FIG. 1;
FIG. 3 is a diagram showing an example of a command set; FIG. 4 is a diagram showing an example of a script describing a process for responding to an interruption; FIG. 5 is a diagram showing an example of a script describing a process for controlling DMA (Direct Memory Access); and
FIG. 6 is a diagram showing a flow of a process executed by the computer system shown in FIG. 1.
Best Mode for Carrying Out the Invention The embodiment of the present invention will now be explained with reference to the drawings.
FIG. 1 is a diagram showing the physical structure of a computer system according
to the embodiment of the present invention. As shown in FIG. 1, the present computer system comprises a computer 1 and a peripheral device 2.
As shown in FIG. 1, the computer 1 comprises a processor 11, a volatile memory 12, a non-volatile memory 13, an input unit 14, an output unit 15, a recording medium drive unit 16, and a peripheral device interface unit 17. The volatile memory 12, the non-volatile memory 13, the input unit 14, the output unit 15, the recording medium drive unit 16, and the peripheral device interface unit 17 are connected to the processor 11 via an internal bus.
The processor 11 is constituted by a CPU (Central Processing Unit), a DSP (Digital Signal Processor) or the like. The processor 11 reads later-described programs such as an operating system (OS), a user mode application program (which may hereinafter be abbreviated as "application"), a kernel mode device driver (which may hereinafter be abbreviated as "device driver"), etc., stored in the non- volatile memory 13, and executes these programs, thereby executing later-described processes. The volatile memory 12 is constituted by a RAM (Random Access Memory) or the like. The volatile memory 12 stores data or supplies data to the processor 11 in response to an access from the processor 11. The storage area of the volatile memory 12 serves as the work area of the processor 11.
The non- volatile memory 13 is constituted by a hard disk device or the like. The non- volatile memory 13 pre-stores the aforementioned OS, and supplies the OS to the processor 11 in response to a read access from the processor 11.
As shown in FIG. 2, the OS stored in the non- volatile memory 13 provides at least two kinds of privileged modes. One of these two kinds of privileged modes is a kernel mode, and the other is a user mode. As such an OS that provides a plurality of privileged modes, for example, Linux™, Windows™ from Microsoft, etc. can be listed.
In the kernel mode, the processor 11 can execute a process for directly controlling the peripheral device 2, the volatile memory 12, etc. That is, in the kernel mode, the
processor 11 can execute a process for controlling the peripheral device 2, the volatile memory 12, etc. without processes in the other privileged mode. Specifically, in the kernel mode, the processor 11 can execute a process for responding to hardware interruption by the peripheral device 2, etc. into the processor 11, a process for controlling DMA (Direct Memory Access) on the volatile memory 12, etc. On the other hand, in the kernel mode, the processor 11 cannot execute a process for providing the function of user interface or a process for providing a function for data processing. To be more specific, in the kernel mode, the processor 11 cannot execute a process for providing the function of user interface for entering data in accordance with the operator's operations and outputting data so that the operator can view the data, or a process for providing a function for data processing such as receiving data from the peripheral device 2, etc. processing the received data, and outputting it to the peripheral device 2, etc.
In contrast, in the user mode, the processor 11 can execute a process for providing the function of user interface, and a process for providing the function for data processing. On the other hand, in the user mode, the processor 11 cannot execute a process for directly controlling the peripheral device 2, the volatile memory 12, etc., such as responding to an interruption into the processor 11, controlling DMA, etc.
Under the control of the OS, the processor 11 acquires the above-described device driver and application from a recording medium set in the recording medium drive unit 16, etc. in accordance with an operation of the user operating the computer system, and rewritably stores the acquired programs in the non- volatile memory 13. The non- volatile memory 13 supplies the stored application to the processor 11 in response to a read access from the processor 11.
The aforementioned device driver stored in the non- volatile memory 13 is a program to be executed by the processor 11 under the control of the OS in the above-described kernel mode, in accordance with a procedure to be described later.
As shown in FIG. 2, the device driver causes the processor 11 to directly control the
peripheral device 2, the volatile memory 12, etc., thereby causing the processor 11 to execute a process for responding to an interruption and a process for controlling DMA. Specifically, the device driver causes the processor 11 to execute in the kernel mode a function for "acquiring scripts created in a process in the user mode that describe procedures for the process for responding to an interruption and process for controlling
DMA, interpreting the acquired scripts to specify the procedures described in the scripts, and executing the process for responding to an interruption and the process for controlling
DMA in accordance with the specified procedures".
The scripts consist of a plurality of procedures, and the procedures consist of commands and parameters. The processor 11 processes the procedures by using an interpreter and sets parameters which are necessary for controlling the device. A specific example of the command set is shown in FIG. 3.
On the other hand, the above-described application is a program that is executed by the processor 11 under the control of the OS in the above-described user mode, in accordance with a procedure to be described later. The processes which the application causes the processor 11 to execute include the above-described process for creating a script. A specific example of the script is as shown in FIG. 4, which describes the process for responding to an interruption. Another example of the script is as shown in
FIG. 5, which describes the process for controlling DMA. The input unit 14 comprises a keyboard, a pointing device, etc. The input unit 14 supplies data according to operations of an operator to the processor 11.
The output unit 15 is constituted by a liquid crystal display device or the like. The output unit 15 displays characters and figures according to instructions of the processor
11 on the display screen thereof. The recording medium drive unit 16 is constituted by a recording medium drive device (a flexible disk drive, a CD-ROM drive, etc.) for reading data recorded on a recording medium (such as a flexible disk, a CD-R (Compact Disk-Recordable), etc.).
The recording medium drive unit 16 reads data from a recording medium set therein and supplies it to the processor 11, or writes data in the recording medium, in accordance with instructions from the processor 11.
The peripheral device interface unit 17 is constituted by a PCI (Personal Computer Interface) circuit or the like, and comprises a slot into which a peripheral device (for example, the peripheral device 2) can detachably be inserted. The peripheral device interface circuit 17 intermediates data exchange between the peripheral device inserted in its slot and the component of the computer 1 (specifically, some or all of the processor 11, the volatile memory 12, the non- volatile memory 13, the input unit 14, the output unit 15, and the recording medium drive unit 16).
The peripheral device 2 is constituted by a microcomputer, other arbitrary electronic circuits, or the like, and is structured to be able to be detachably inserted into the slot of the peripheral device interface unit 17. The peripheral device 2, when inserted in the slot of the peripheral device interface unit 17, exchanges data with the components of the computer 1 via the peripheral device interface unit 17.
Next, the operation of the present computer system will be explained with reference to FIG. 6. FIG. 6 is a diagram showing the flow of the operation of the computer system shown in FIG. 1.
When the computer system is activated, the processor 11 firstly accesses the non- volatile memory 13, reads the OS from the non- volatile memory 13, and executes it.
When the OS is started, the processor 11 loads the device driver. That is, the processor 11 reads the device driver from the non- volatile memory 13 under the control of the OS, and stores the device driver in a storage area of the volatile memory 12 in order to render it executable in the kernel mode. Then, the processor 11 reads the application from the non- volatile memory 13 under the control of the OS in response to an instruction from the user operating the input unit 14, and stores the application in a storage area of the volatile memory 12 in order to
render it executable in the user mode. The processor 11 executes the stored application in the user mode.
If data exchange with a process by the device driver is necessary during a process by the application under execution, the processor 11 requests opening of the device driver (FIG. 6, step SIl) as such requesting is included in the process of the application.
Making such a request, the processor 11 executes the device driver stored in the volatile memory 12 in the kernel mode under the control of the OS.
Then, the processor 11 creates a script describing a process for responding to an interruption as shown in FIG. 4 and a script describing a process for controlling DMA as shown in FIG. 5 under the control of the application, and stores the created scripts in a storage area of the volatile memory 12 (steps S12 and S13).
That is, for example, for a process for transferring data from the peripheral device 2 to the volatile memory 12 by DMA, at step S 12, the processor 11 creates and stores the script to set parameters (for example, mask interruption, clear interruption factor) for the peripheral device 2 to notify the process of the application that the peripheral device 2 has completed the data transfer. Then, at step S 13, the processor 11 creates and stores the script to set various parameters (for example, source address, destination address, number of bytes that can be transferred, transfer direction) for data transfer by DMA.
When the process for controlling DMA becomes necessary, the processor 11 acquires the script describing the process for controlling DMA from the storage area of the volatile memory 12 under the control of the device driver, and interprets the acquired script and sets various parameters (step S21). That is, the processor 11 sets various parameters (for example, source address, destination address, number of bytes that can be transferred, transfer direction) necessary for data transfer by DMA that is to be executed based on the process by the device driver, in accordance with the content of the script created and stored at step S 13.
In the process by the device driver, the processor 11 keeps the script created and
stored at step S 12 unexecuted until the peripheral device 2 starts interruption (i.e., until the later-described process at step S32 is executed).
When the parameters for DMA have been set and the peripheral device 2 has thus become enabled to transfer data by DMA, the processor 11 instructs the peripheral device 2 to start DMA. In response to this instruction, the peripheral device 2 starts data transfer by DMA to the volatile memory 12 in the computer 1 (steps S22 and S31). When the data transfer by DMA is completed, the peripheral device 2 sends a signal indicating an interruption request to the processor 11 (step S32).
In a case where the number of bytes that can be transferred by the peripheral device 2 in one transmission is smaller than the number of bytes that can be transferred indicated the parameter set at step S21, the peripheral device 2 performs data transfer to the volatile memory 12 plural times, and sends the signal indicating the interruption request after the last transmission is completed.
The processor 11 being executing the process of the device driver, acquires the script crated and stored at step S 12 in response to the signal indicating the interruption request, and sets various parameters (for example, mask interruption, clear interruption factor) for notifying the application that DMA is completed by an interruption, in accordance with the content of the acquired script (step S23). Then, in a case where the interruption shows that DMA is completed, the processor 11 creates a notification of DMA completion, and passes it to the process of the application (step S24). As the result of step S24, the DMA is completed.
With the above-described operation, the computer system can allow the scripts to be passed from the process in the user mode to the process in the kernel mode, enabling the process that cannot be executed in the user mode to be executed in the kernel mode. Furthermore, in a case where unspecified or many functions are desired to be realized under the control of the OS, the device driver needs not be updated. Accordingly, it becomes easier to realize the unspecified or many functions by using the device driver.
The present computer system is not limited to the above-described one.
For example, the computer 1 and the peripheral device 2 need not necessarily be connected to each other via a PCI, but the manners of their connection are arbitrary. Accordingly, the computer 1 and the peripheral device 2 may be directly connected to each other via an internal bus, or may be connected via an ATAPI (AT Attachment Packet Interface), a USB (Universal Serial Bus) interface, an IEEE 1394 interface, a Bluetooth™, or oilier arbitrary interface circuits.
The process the device driver causes the processor 11 to execute is not limited to response to an interruption or DMA control. Accordingly, for example, the device driver may cause the processor 11 to execute arbitrary processes for controlling the units of the computer 1 or arbitrary devices connected to the computer 1. Meanwhile, the computer system may not comprise the peripheral device 2. In this case, the computer 1 may not be so structured as to have the peripheral device 2 insertable.
The command set provided by the device driver may include a command that macro-wise defines a predetermined series of processes to be executed under the control of the OS.
The script may not be created by the processor 11 in the process of the application. Accordingly, for example, the script may be created beforehand and stored in a storage area of the non- volatile memory 13 or an arbitrary recording medium that can be read by the recording medium drive unit 16. In this case, the processor 11 may be so arranged as to read the script from the non- volatile memory 13 or the recording medium at an arbitrary timing in accordance with the process of the application.
Alternatively, at the time of initialization of the computer system, the processor 11 may read a fixed file including the script from an external storage device or the like, and store it in a storage area of the non- volatile memory 13, so that it can read and interpret it at a required timing.
Furthermore, the processor 11 may use a script stored in the non- volatile memory 13
or the like, together with a script which the processor 11 itself will create in accordance with the process of the application.
The embodiment of the present invention has been explained. The computer system of the present invention needs not be a specialized system, but may be an ordinary computer system. A computer system that executes the above-described processes can be constituted by installing the above-described device driver and application on, for example, a personal computer from one or a plurality of recording media (flexible disk, CD-ROM, etc.) that store these device driver and application.
Alternatively, these device driver and application may be uploaded on a BBS (Bulletin Board System) on a communication line so as to be distributed through the communication line, or a carrier wave may be modulated by a signal representing these device driver and application and the obtained modulated wave may be transmitted, so that an apparatus that receives this modulated wave may demodulate the modulated wave and restore the programs. In a case where the OS takes charge of some part of the processes, or the OS constitutes part of one structural component, a program from which such part is excluded may be stored in a recording medium. Also in this case, according to the present invention, a program for realizing each function or step to be executed by the computer is stored in such a recording medium. Industrial Applicability
The present invention is effective in developing a device driver for each device involved, under an OS that puts some restrictions on accesses from an application to hardware. For example, the present invention can be effectively utilized for debugging or evaluating plural kinds of devices. Various embodiments and changes may be made thereunto without departing from the broad spirit and scope of the invention. The above-described embodiment is intended to illustrate the present invention, not to limit the scope of the present invention.
The scope of the present invention is shown by the attached claims rather than the embodiment. Various modifications made within the meaning of an equivalent of the claims of the invention and within the claims are to be regarded to be in the scope of the present invention. This application is based on Japanese Patent Application No. 2004-381196 filed on
December 28, 2004 and including specification, claims, drawings and summary. The disclosure of the above Japanese Patent Application is incorporated herein by reference in its entirety.
Claims
1. A program executed by a computer in a kernel mode under control of an operating system which, by being executed by said computer, controls said computer to realize said kernel mode as a first privileged mode and a user mode as a second privileged mode, said program controlling said computer to execute in said kernel mode: a function of specifying a process which should be executed in said kernel mode by interpreting a script describing said process, when said computer creates said script by executing an application program in said user mode under control of said operating system; and a function of executing said specified process.
2. The program according to claim 1, controlling said computer to execute a function of, in a case where a device is connected to a processor included in said computer and said script describes a procedure of a control which should be executed by said processor on said device in said kernel mode, specifying a process for controlling said device, and executing said specified process in said kernel mode.
3. A computer-readable recording medium storing a program executed by a computer in a kernel mode under control of an operating system which, by being executed by said computer, controls said computer to realize said kernel mode as a first privileged mode and a user mode as a second privileged mode, said program controlling said computer to execute in said kernel mode: a function of specifying a process which should be executed in said kernel mode by interpreting a script describing said process, when said computer creates said script by executing an application program in said user mode under control of said operating system; and a function of executing said specified process.
4. The computer-readable recording medium according to claim 3, storing a program for controlling said computer to execute a function of, in a case where a device is connected to a processor included in said computer and said script describes a procedure of a control which should be executed by said processor on said device in said kernel mode, specifying a process for controlling said device, and executing said specified process in said kernel mode.
5. A data processing apparatus constituted by a computer executing an operating system controlling said computer to realize a kernel mode as a first privileged mode and a user mode as a second privileged mode, said computer: executing a driver program in said kernel mode under control of said operating system; executing an application program in said user mode under control of said operating system; creating a script describing a process which should be executed under control of said driver program, under control of said application program; and specifying said process by interpreting said script under control of said driver program, and executing said specified process under control of said driver program.
6. The data processing apparatus according to claim 5, wherein: said driver program comprises a program for controlling a processor included in said computer to execute a process for controlling a device connected to said processor; and said application program comprises a program for controlling said computer to create said script, which describes a procedure of a control on said device which should be executed under control of said driver program.
7. A data processing method for a computer operating under an operating system providing a kernel mode as a first privileged mode and a user mode as a second privileged mode, said method comprising: a step of creating, under control of an application program operating in said user mode, a script describing a process which should be executed under control of a driver program operating in said kernel mode, when data exchange between said application program and said driver program becomes necessary during executing said application program; a step of acquiring said script when said process becomes necessary during executing said driver program, and specifying said process by interpreting said acquired script under control of said driver program; and a step of executing said specified process under control of said driver program.
8. The data processing method according to claim 7, wherein: said driver program comprises a program for controlling a processor included in said computer to execute a process for controlling a device connected to said processor; and said application program comprises a program for controlling said computer to create said script, which describes a procedure of a control on said device which should be executed under control of said driver program.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2004-381196 | 2004-12-28 | ||
| JP2004381196A JP2006185387A (en) | 2004-12-28 | 2004-12-28 | Program and data processing apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2006070939A1 true WO2006070939A1 (en) | 2006-07-06 |
Family
ID=36615038
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/JP2005/024271 Ceased WO2006070939A1 (en) | 2004-12-28 | 2005-12-28 | Program executed under control of operating system providing kernel mode and user mode |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JP2006185387A (en) |
| WO (1) | WO2006070939A1 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8434098B2 (en) | 2008-02-07 | 2013-04-30 | Microsoft Corporation | Synchronizing split user-mode/kernel-mode device driver architecture |
| US8819399B1 (en) | 2009-07-31 | 2014-08-26 | Google Inc. | Predicated control flow and store instructions for native code module security |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130124872A1 (en) * | 2011-11-15 | 2013-05-16 | MingXiang Shen | Method of accessing a computer hardware device in a Metro user interface mode application |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH11249873A (en) * | 1998-03-02 | 1999-09-17 | Mitsubishi Electric Corp | Dynamic management method and dynamic management method of driver function |
| JP2001005766A (en) * | 1999-06-22 | 2001-01-12 | Mitsubishi Electric Corp | Non-stop extended driver device |
| JP2003108336A (en) * | 2001-09-28 | 2003-04-11 | Canon Inc | Apparatus for information processing, method therefor and program |
| JP2004272499A (en) * | 2003-03-07 | 2004-09-30 | Sony Corp | Device management method and device management system |
-
2004
- 2004-12-28 JP JP2004381196A patent/JP2006185387A/en active Pending
-
2005
- 2005-12-28 WO PCT/JP2005/024271 patent/WO2006070939A1/en not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH11249873A (en) * | 1998-03-02 | 1999-09-17 | Mitsubishi Electric Corp | Dynamic management method and dynamic management method of driver function |
| JP2001005766A (en) * | 1999-06-22 | 2001-01-12 | Mitsubishi Electric Corp | Non-stop extended driver device |
| JP2003108336A (en) * | 2001-09-28 | 2003-04-11 | Canon Inc | Apparatus for information processing, method therefor and program |
| JP2004272499A (en) * | 2003-03-07 | 2004-09-30 | Sony Corp | Device management method and device management system |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8434098B2 (en) | 2008-02-07 | 2013-04-30 | Microsoft Corporation | Synchronizing split user-mode/kernel-mode device driver architecture |
| US8819399B1 (en) | 2009-07-31 | 2014-08-26 | Google Inc. | Predicated control flow and store instructions for native code module security |
| US9075625B1 (en) | 2009-07-31 | 2015-07-07 | Google Inc. | Predicated control flow and store instructions for native code module security |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2006185387A (en) | 2006-07-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI400652B (en) | Dual operating system parallel processing methods, recording media and computer program products | |
| US6795912B1 (en) | Method for controlling computer, computer, and storage medium | |
| US8373870B2 (en) | Information processing apparatus and control method thereof | |
| JP2012009013A (en) | Unified storage device based on partial virtualized machine | |
| KR101089260B1 (en) | Method and system for automatic installation of a functional unit driver on a host | |
| JP3671667B2 (en) | Microcomputer, electronic equipment and debugging system | |
| JP5307133B2 (en) | Device emulation support apparatus, device emulation support method, device emulation support circuit, and information processing apparatus | |
| JP2007206885A (en) | Computer system and system startup method | |
| KR20140083530A (en) | System on chip including boot shell debugging hardware and driving method thereof | |
| WO1998043173A1 (en) | Emulation system and information processor | |
| JP2002132496A (en) | Emulating apparatus and parts, emulation method, recording medium, and program | |
| CN104412230B (en) | The method and apparatus for calling wireless communication function from firmware module using supervisor call instruction | |
| US7844754B2 (en) | Data transfer apparatus and data transfer method | |
| WO2006070939A1 (en) | Program executed under control of operating system providing kernel mode and user mode | |
| JP2015215684A (en) | Information processing apparatus and information processing program | |
| JP4482044B2 (en) | Information processing apparatus and device controller drive control method | |
| US7680909B2 (en) | Method for configuration of a processing unit | |
| JP2012194675A (en) | Information apparatus and emergency access method for information apparatus | |
| JP2004220575A (en) | Interface circuit for card-type memory, ASIC with the circuit, and image forming apparatus with the ASIC | |
| JPH0836485A (en) | Information processing apparatus and method of controlling information processing apparatus | |
| TWI387926B (en) | Method for updating program section | |
| JP4597032B2 (en) | Computer system, basic program startup method, and loader program | |
| JP3741182B2 (en) | Microcomputer, electronic equipment and debugging system | |
| JPH07334373A (en) | Emulation system and emulation method | |
| JP7274069B2 (en) | TRACE CONTROL DEVICE, EMULATOR, TRACE CONTROL METHOD, AND TRACE CONTROL PROGRAM |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application | ||
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 05824663 Country of ref document: EP Kind code of ref document: A1 |
|
| WWW | Wipo information: withdrawn in national office |
Ref document number: 5824663 Country of ref document: EP |