JP2008225717A - Kernel booting method, kernel source code optimization method, kernel source code optimization device, and program - Google Patents

Kernel booting method, kernel source code optimization method, kernel source code optimization device, and program Download PDF

Info

Publication number
JP2008225717A
JP2008225717A JP2007061279A JP2007061279A JP2008225717A JP 2008225717 A JP2008225717 A JP 2008225717A JP 2007061279 A JP2007061279 A JP 2007061279A JP 2007061279 A JP2007061279 A JP 2007061279A JP 2008225717 A JP2008225717 A JP 2008225717A
Authority
JP
Japan
Prior art keywords
code
partitioning
kernel
devices
storage unit
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.)
Granted
Application number
JP2007061279A
Other languages
Japanese (ja)
Other versions
JP5029076B2 (en
Inventor
Tatsuhiko Sorai
達彦 空井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2007061279A priority Critical patent/JP5029076B2/en
Publication of JP2008225717A publication Critical patent/JP2008225717A/en
Application granted granted Critical
Publication of JP5029076B2 publication Critical patent/JP5029076B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To achieve the high speed operation of kernel booting process in a computer equipped with a plurality of connection devices. <P>SOLUTION: Firstly, in a first phase 201, booting process for each device installed in a computer is performed. In this case, booting process is sequentially performed from a device whose stand-by time for booting the device is longer. When the first phase 201 is completed, first phase completion decision processing 203 is performed. In the first phase completion decision processing 203, whether or not boot has been completed is decided for every device. In a second phase 204, the initialization of the device driver corresponding to the device whose boot completion has been confirmed is performed. At last, the other initialization processing 205 such as a memory initialization process is performed. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、カーネル起動処理を高速化するカーネル起動技術およびカーネルソースコード最適化技術に関し、特に、デバイスを起動してからデバイスの起動が完了するまでの時間であるデバイス起動待ち時間を有効利用することにより、カーネル起動処理を高速化するカーネル起動技術およびカーネルソースコード最適化技術に関する。   The present invention relates to a kernel booting technique and a kernel source code optimization technique for speeding up kernel booting processing, and in particular, effectively uses a device boot waiting time that is a time from booting a device to completion of booting of the device. In particular, the present invention relates to a kernel booting technique and a kernel source code optimization technique for speeding up the kernel booting process.

先ず、図19を参照して従来一般的に行われているカーネル起動方法について説明する。同図に示すようにカーネル起動処理100においては、ドライバ初期化処理102と、その他の初期化処理101(メモリの初期化処理など)とが実行される。   First, referring to FIG. 19, a conventional kernel booting method generally used will be described. As shown in the figure, in the kernel activation process 100, a driver initialization process 102 and other initialization processes 101 (memory initialization process, etc.) are executed.

ドライバ初期化処理102では、デバイスを起動するためのデバイス起動処理102−1と、上記デバイスに対応するデバイスドライバを初期化するためのデバイスドライバ初期化処理102−2とが実行される。デバイスドライバ初期化処理102−2は、デバイスの起動が完了した後に行うことが必要であるため、デバイス起動処理102−1を実行してからデバイスドライバ初期化処理102−2が実行可能となるまでには、ある程度の時間(デバイス起動待ち時間103)が必要になる。このデバイス起動待ち時間103は、CPUが何も実行しない無駄な時間であり、デバイスの種類によってはかなり長い時間となる。また、図19では、1つのデバイス、デバイスドライバに対するデバイス起動処理102−1、デバイス初期化処理102−2しか示していないが、複数のデバイス、デバイスドライバを有する実際のシステムでは、デバイス、デバイスドライバの数だけデバイス起動処理102−1、デバイスドライバ初期化処理102−2がシーケンシャルに実行され、デバイスの数だけデバイス起動待ち時間103が発生する。このため、カーネル起動処理100において、ドライバ初期化処理102が最も時間のかかる処理となる。   In the driver initialization process 102, a device activation process 102-1 for activating a device and a device driver initialization process 102-2 for initializing a device driver corresponding to the device are executed. Since the device driver initialization process 102-2 needs to be performed after the activation of the device is completed, the device driver initialization process 102-2 can be executed after the device activation process 102-1 is executed. Requires a certain amount of time (device activation waiting time 103). This device activation waiting time 103 is a useless time when the CPU does not execute anything, and may be a considerably long time depending on the type of device. FIG. 19 shows only the device activation processing 102-1 and device initialization processing 102-2 for one device and device driver. However, in an actual system having a plurality of devices and device drivers, the device and device driver are shown. The device activation processing 102-1 and the device driver initialization processing 102-2 are executed sequentially for the number of devices, and the device activation waiting time 103 is generated for the number of devices. For this reason, in the kernel activation process 100, the driver initialization process 102 is the most time-consuming process.

上述したように、従来の一般的なカーネル起動方法では、デバイスの数だけCPUが何も実行しないデバイス起動待ち時間103が発生するため、カーネル起動処理100を高速化することができないという問題があった。   As described above, the conventional general kernel startup method has the problem that the kernel startup processing 100 cannot be accelerated because the device startup waiting time 103 in which the CPU does not execute anything for the number of devices occurs. It was.

一方、コンピュータが備えている複数のデバイスを初期化する技術として、図20に示すように、各デバイスA、B、C、…に対して初期化のためのコマンドを順次発行し、その後、コマンド実行終了割り込み信号を発生したデバイスから順に次のコマンドを発行する技術が従来から知られている(例えば、特許文献1参照)。   On the other hand, as a technique for initializing a plurality of devices included in a computer, as shown in FIG. 20, commands for initialization are sequentially issued to each device A, B, C,. A technique for issuing the next command in order from the device that has generated the execution end interrupt signal has been conventionally known (see, for example, Patent Document 1).

特開平10−307649号公報JP-A-10-307649

特許文献1に記載されている従来の技術では、或るデバイスのデバイス起動待ち時間において、他のデバイスを起動し、複数のデバイスの初期化を並行して行うようにしているので、初期化処理に必要となる時間を短縮化することができる。しかし、特許文献1には、複数のデバイスをどのような順番で起動されるかは全く記載されていない。このため、デバイス起動待ち時間が短いデバイスから順に起動される場合があり、このような場合、CPUが何も実行しない無駄な時間が多くなり、十分な高速化が見込めないという問題がある。   In the conventional technique described in Patent Document 1, other devices are activated and a plurality of devices are initialized in parallel during the device activation waiting time of a certain device. The time required for the process can be shortened. However, Patent Document 1 does not describe in what order a plurality of devices are activated. For this reason, there are cases where devices are activated in the order from the device with the shortest device activation waiting time. In such a case, there is a problem that a wasteful time during which the CPU does nothing increases and sufficient speedup cannot be expected.

〔発明の目的〕
そこで、本発明の目的は、デバイス起動待ち時間を考慮した順番で各デバイスを起動することにより、CPUが何も実行しない無駄な時間を極力少なくし、カーネル初期化処理に要する時間を短縮させることにある。
(Object of invention)
Accordingly, an object of the present invention is to reduce the time required for kernel initialization processing by minimizing wasted time when the CPU does nothing by starting each device in the order in which the device activation waiting time is taken into consideration. It is in.

本発明にかかる第1のカーネル起動方法は、
複数のデバイスと、該複数のデバイス毎のデバイスドライバとを有するコンピュータにおけるカーネル起動方法であって、
前記コンピュータが、前記複数のデバイスをデバイス起動待ち時間が長いものから順に起動するデバイス起動ステップと、
前記コンピュータが、起動が完了したデバイスに対応するデバイスドライバから順に初期化するデバイスドライバ初期化ステップとを含むことを特徴とする。
A first kernel booting method according to the present invention includes:
A kernel booting method in a computer having a plurality of devices and a device driver for each of the plurality of devices,
A device activation step in which the computer activates the plurality of devices in descending order of device activation waiting time;
The computer includes a device driver initialization step that sequentially initializes device drivers corresponding to devices that have been activated.

本発明にかかる第2のカーネル起動方法は、
複数のデバイスと、該複数のデバイス毎のデバイスドライバとを有するコンピュータにおけるカーネル起動方法であって、
前記コンピュータが前記複数のデバイスをデバイス起動待ち時間が長いものから順に起動するデバイス起動ステップと、
前記コンピュータが前記デバイス起動ステップの次に実行するステップであって、デバイスに非依存なモジュールを初期化するデバイス非依存初期化ステップと、
前記コンピュータが前記デバイス非依存初期化ステップの次に実行するステップであって、前記複数のデバイスの全てで起動が完了しているか否かを判定する起動完了判定ステップと、
前記コンピュータが前記起動完了判定ステップにおいて全てのデバイスの起動が完了したと判定した後に実行するステップであって、前記複数のデバイスドライバを初期化するデバイスドライバ初期化ステップと、
前記コンピュータが前記デバイスドライバ初期化ステップの次に実行するステップであって、デバイスに依存するモジュールを初期化するデバイス依存初期化ステップとを含むことを特徴とする。
The second kernel booting method according to the present invention is:
A kernel booting method in a computer having a plurality of devices and a device driver for each of the plurality of devices,
A device activation step in which the computer activates the plurality of devices in descending order of device activation waiting time; and
A step executed by the computer after the device activation step, a device-independent initialization step for initializing a device-independent module;
A step that is executed after the device independent initialization step by the computer, and a start completion determination step for determining whether or not the start has been completed for all of the plurality of devices;
A step that is executed after the computer determines that the activation of all devices has been completed in the activation completion determination step, and a device driver initialization step that initializes the plurality of device drivers;
And a device-dependent initialization step of initializing a module depending on the device, the step being executed after the device driver initialization step by the computer.

本発明にかかる第3のカーネル起動方法は、第1または第2のカーネル起動方法において、
前記デバイス起動ステップでは、前記複数のデバイスの内の、カーネル起動処理の完了直後に使用するデバイスのみを起動し、
前記デバイスドライバ初期化ステップでは、前記複数のデバイスドライバの内の、カーネル起動処理の完了直後に使用するデバイスドライバのみを初期化し、且つ、
前記コンピュータがカーネル起動処理の完了後に、前記複数のデバイスの内の、起動していないデバイスを起動し、その後、前記複数のデバイスドライバの内の、初期化していないデバイスドライバを初期化することを特徴とする。
A third kernel booting method according to the present invention is the first or second kernel booting method,
In the device booting step, only the device to be used immediately after completion of the kernel booting process among the plurality of devices is booted,
In the device driver initialization step, among the plurality of device drivers, only a device driver to be used immediately after completion of the kernel boot process is initialized, and
The computer boots an unbooted device among the plurality of devices after the kernel boot process is completed, and then initializes an uninitialized device driver among the plurality of device drivers. Features.

本発明にかかる第4のカーネル起動方法は、
複数のデバイスと、該複数のデバイス毎のデバイスドライバと、複数のCPUとを有するコンピュータにおけるカーネル起動方法であって、
前記複数のCPUが、自CPUに割り当てられているデバイスをデバイス起動待ち時間が長いものから順に起動するデバイス起動ステップと、
前記複数のCPUが前記デバイス起動ステップの次に実行するステップであって、自CPUに割り当てられているモジュールの内の、デバイスに非依存なモジュールを初期化するデバイス非依存初期化ステップと、
前記複数のCPUが前記デバイス非依存初期化ステップの次に実行するステップであって、自CPUに割り当てられているデバイスの全てで起動が完了しているか否かを判定する起動完了判定ステップと、
前記複数のCPUが前記起動完了ステップにおいて自CPUに割り当てられている全てのデバイスの起動が完了したと判定した後に実行するステップであって、自CPUに割り当てられているデバイスに対応するデバイスドライバを初期化するデバイスドライバ初期化ステップと、
前記複数のCPUが前記デバイスドライバ初期化ステップの次に実行するステップであって、自CPUに割り当てられているモジュールの内の、デバイスに依存するモジュールを初期化するデバイス依存初期化ステップとを含むことを特徴とする。
The fourth kernel booting method according to the present invention is:
A kernel booting method in a computer having a plurality of devices, a device driver for each of the plurality of devices, and a plurality of CPUs,
A device activation step in which the plurality of CPUs activate devices assigned to the CPU in order from the longest device activation waiting time;
A device-independent initialization step for initializing a module-independent module among modules assigned to the CPU, which is executed by the plurality of CPUs after the device activation step;
A step that is executed after the device-independent initialization step by the plurality of CPUs, and a startup completion determination step for determining whether or not the startup has been completed for all devices assigned to the CPU;
A step of executing the plurality of CPUs after determining that the activation of all devices allocated to the CPU in the activation completion step is completed, and a device driver corresponding to the device allocated to the CPU; A device driver initialization step to be initialized;
A step that is executed after the device driver initialization step by the plurality of CPUs, and includes a device-dependent initialization step that initializes a device-dependent module among modules assigned to the CPU. It is characterized by that.

本発明にかかる第5のカーネル起動方法は、
複数のデバイスと、該複数のデバイス毎のデバイスドライバとを有するコンピュータにおけるカーネル起動方法であって、
前記コンピュータが、ブートローダの実行時に前記複数のデバイスをデバイス起動待ち時間が長いものから順に起動し、全てのデバイスの起動が完了した後、カーネル起動処理を開始させるデバイス起動ステップと、
前記コンピュータが前記デバイス起動ステップの次に行うステップであって、前記デバイスドライバを初期化するデバイスドライバ初期化ステップとを含むことを特徴とする。
The fifth kernel booting method according to the present invention is:
A kernel booting method in a computer having a plurality of devices and a device driver for each of the plurality of devices,
A device booting step in which the computer boots the plurality of devices in descending order of the device boot waiting time when the boot loader is executed, and starts kernel boot processing after booting of all devices is completed;
The device includes a device driver initialization step of initializing the device driver after the device activation step.

本発明にかかる第1のカーネルソースコード最適化方法は、
複数のデバイスと、該複数のデバイス毎のデバイスドライバと、カーネルソースコードが格納されたカーネルソースコード記憶部と、前記複数のデバイス毎のデバイス起動待ち時間が格納された起動待ち時間記憶部と、区画化コード記憶部と、最適化コード記憶部とを備えたコンピュータによって前記カーネルソースコードを最適化するカーネルソースコード最適化方法であって、
前記コンピュータが、前記カーネルソースコード記憶部から前記カーネルソースコードを入力し、該入力したカーネルソースコードを、デバイスに対する起動処理を行うデバイス毎の区画化コードと、デバイスドライバに対する初期化処理を行うデバイスドライバ毎の区画化コードと、他の処理を行う区画化コードとに区画化して前記区画化コード記憶部に格納する区画化分析ステップと、
前記コンピュータが、前記区画化コード記憶部から各区画化コードを入力し、該入力した区画化コードの内のデバイスに対する起動処理を行う区画化コードをデバイス起動待ち時間が長い順に配置し、その後ろに、前記複数のデバイス毎に起動が完了したか否かを判定し、起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させるコードを配置し、その後ろに、前記入力した区画化コードの内のデバイスドライバに対する初期化を行う区画化コードを配置した最適化コードを生成し、該生成した最適化コードを前記最適化コード記憶部に格納する再配置ステップとを含むことを特徴とする。
The first kernel source code optimization method according to the present invention is as follows:
A plurality of devices, a device driver for each of the plurality of devices, a kernel source code storage unit storing a kernel source code, a startup waiting time storage unit storing a device startup waiting time for each of the plurality of devices, A kernel source code optimization method for optimizing the kernel source code by a computer including a partitioned code storage unit and an optimization code storage unit,
The computer inputs the kernel source code from the kernel source code storage unit, and the input kernel source code is a partitioning code for each device that performs startup processing on a device, and a device that performs initialization processing on a device driver A partitioning analysis step of partitioning into a partitioning code for each driver and partitioning code for performing other processing and storing the partitioning code in the partitioning code storage unit;
The computer inputs each partitioning code from the partitioning code storage unit, and arranges partitioning codes for performing startup processing on devices among the input partitioning codes in order of increasing device startup waiting time, and behind A code for determining whether or not activation is completed for each of the plurality of devices, and starting initialization processing of a device driver corresponding to the device for which activation is determined to be completed, followed by the input A relocation step of generating an optimization code in which the partitioning code for initializing the device driver among the generated partitioning codes is arranged and storing the generated optimization code in the optimization code storage unit. It is characterized by.

本発明にかかる第2のカーネルソースコード最適化方法は、第1のカーネルソースコード最適化方法において、
前記区画化分析ステップでは、前記カーネルソースコード記憶部から入力したカーネルソースコードを関数呼び出し単位で区画化することにより、区画化コードを生成することを特徴とする。
A second kernel source code optimization method according to the present invention is the first kernel source code optimization method,
In the partitioning analysis step, the partitioning code is generated by partitioning the kernel source code input from the kernel source code storage unit in units of function calls.

本発明にかかる第3のカーネルソースコード最適化方法は、第1または第2のカーネルソースコード最適化方法において、
前記コンピュータが、前記複数のデバイスそれぞれのデバイス起動待ち時間を測定し、測定したデバイス起動待ち時間を前記起動待ち時間記憶部に格納する情報採取ステップを含むことを特徴とする。
A third kernel source code optimization method according to the present invention is the first or second kernel source code optimization method,
The computer includes an information collecting step of measuring a device activation waiting time of each of the plurality of devices and storing the measured device activation waiting time in the activation waiting time storage unit.

本発明にかかる第1のカーネルソースコード最適化装置は、
複数のデバイスと、
該複数のデバイス毎のデバイスドライバと、
カーネルソースコードが格納されたカーネルソースコード記憶部と、
前記複数のデバイス毎のデバイス起動待ち時間が格納された起動待ち時間記憶部と、
区画化コード記憶部と、
最適化コード記憶部と、
前記カーネルソースコード記憶部から前記カーネルソースコードを入力し、該入力したカーネルソースコードを、デバイスに対する起動処理を行うデバイス毎の区画化コードと、デバイスドライバに対する初期化処理を行うデバイスドライバ毎の区画化コードと、他の処理を行う区画化コードとに区画化して前記区画化コード記憶部に格納する区画化分析手段と、
前記区画化コード記憶部から各区画化コードを入力し、該入力した区画化コードの内のデバイスに対する起動処理を行う区画化コードをデバイス起動待ち時間が長い順に配置し、その後ろに、前記複数のデバイス毎に起動が完了したか否かを判定し、起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させるコードを配置し、その後ろに、前記入力した区画化コードの内のデバイスドライバに対する初期化を行う区画化コードを配置した最適化コードを生成し、生成した最適化コードを前記最適化コード記憶部に格納する再配置手段とを備えたことを特徴とする。
A first kernel source code optimizing device according to the present invention includes:
Multiple devices,
A device driver for each of the plurality of devices;
A kernel source code storage unit storing kernel source code;
An activation waiting time storage unit storing device activation waiting time for each of the plurality of devices;
A partitioning code storage unit;
An optimized code storage unit;
The kernel source code is input from the kernel source code storage unit, and the input kernel source code is partitioned for each device that performs startup processing for the device, and for each device driver that performs initialization processing for the device driver. Partitioning analysis means for partitioning into a partitioning code and partitioning code for performing other processing and storing in the partitioning code storage unit;
Each partitioning code is input from the partitioning code storage unit, and partitioning codes for performing startup processing on the devices among the input partitioning codes are arranged in order from the longest device startup waiting time, and behind the plurality of partitioning codes It is determined whether or not the activation is completed for each device, and a code for starting the initialization process of the device driver corresponding to the device that is determined to have completed the activation is arranged, followed by the input partitioning code And a rearrangement unit for generating an optimization code in which a partitioning code for performing initialization for a device driver is arranged, and storing the generated optimization code in the optimization code storage unit. .

本発明にかかる第2のカーネルソースコード最適化装置は、第1のカーネルソースコード最適化装置において、
前記区画化分析手段が、前記カーネルソースコード記憶部から入力したカーネルソースコードを関数呼び出し単位で区画化することにより、区画化コードを生成することを特徴とする。
A second kernel source code optimization device according to the present invention is the first kernel source code optimization device,
The partition analysis unit generates a partition code by partitioning the kernel source code input from the kernel source code storage unit in units of function calls.

本発明にかかる第3のカーネルソースコード最適化装置は、第1または第2のカーネルソースコード最適化装置において、
前記複数のデバイスそれぞれのデバイス起動待ち時間を測定し、測定したデバイス起動待ち時間を前記起動待ち時間記憶部に格納する情報採取手段を備えたことを特徴とする。
A third kernel source code optimization apparatus according to the present invention is the first or second kernel source code optimization apparatus,
The apparatus includes an information collecting unit that measures device activation waiting times of the plurality of devices and stores the measured device activation waiting times in the activation waiting time storage unit.

本発明にかかるプログラムは、
複数のデバイスと、該複数のデバイス毎のデバイスドライバと、カーネルソースコードが格納されたカーネルソースコード記憶部と、前記複数のデバイス毎のデバイス起動待ち時間が格納された起動待ち時間記憶部と、区画化コード記憶部と、最適化コード記憶部とを備えたコンピュータを、
前記カーネルソースコード記憶部から前記カーネルソースコードを入力し、該入力したカーネルソースコードを、デバイスに対する起動処理を行うデバイス毎の区画化コードと、デバイスドライバに対する初期化処理を行うデバイスドライバ毎の区画化コードと、他の処理を行う区画化コードとに区画化して前記区画化コード記憶部に格納する区画化分析手段、
前記区画化コード記憶部から各区画化コードを入力し、該入力した区画化コードの内のデバイスに対する起動処理を行う区画化コードをデバイス起動待ち時間が長い順に配置し、その後ろに、前記複数のデバイス毎に起動が完了したか否かを判定し、起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させるコードを配置し、その後ろに、前記入力した区画化コードの内のデバイスドライバに対する初期化を行う区画化コードを配置した最適化コードを生成し、生成した最適化コードを前記最適化コード記憶部に格納する再配置手段として機能させる。
The program according to the present invention is:
A plurality of devices, a device driver for each of the plurality of devices, a kernel source code storage unit storing a kernel source code, a startup waiting time storage unit storing a device startup waiting time for each of the plurality of devices, A computer having a partitioned code storage unit and an optimized code storage unit,
The kernel source code is input from the kernel source code storage unit, and the input kernel source code is partitioned for each device that performs startup processing for the device, and for each device driver that performs initialization processing for the device driver. Partitioning analysis means for partitioning into a partitioning code and a partitioning code for performing other processing and storing in the partitioning code storage unit,
Each partitioning code is input from the partitioning code storage unit, and partitioning codes for performing startup processing on the devices among the input partitioning codes are arranged in order from the longest device startup waiting time, and behind the plurality of partitioning codes It is determined whether or not the activation is completed for each device, and a code for starting the initialization process of the device driver corresponding to the device that is determined to have completed the activation is arranged, followed by the input partitioning code The optimization code in which the partitioned code for initializing the device driver is arranged is generated, and the generated optimization code is made to function as a rearrangement unit that stores the optimization code in the optimization code storage unit.

〔作用〕
カーネル起動処理において、コンピュータは、先ず、複数のデバイスをデバイス起動待ち時間が長いものから順に起動し、その後、起動が完了したデバイスに対応するデバイスドライバから順に初期化する。
[Action]
In the kernel activation process, the computer first activates a plurality of devices in descending order of device activation waiting time, and then initializes sequentially from the device driver corresponding to the device that has completed activation.

また、既存のカーネルソースコードから上記したようなカーネル起動処理を行う最適化コードを自動的に生成するため、区画化分析手段が、カーネルソースコードを、デバイスに対する起動処理を行うデバイス毎の区画化コードと、デバイスドライバに対する初期化処理を行うデバイスドライバ毎の区画化コードと、他の処理を行う区画化コードとに区画化し、再配置手段が、区画化コードの内の、デバイスに対する起動処理を行う区画化コードをデバイス起動待ち時間が長い順に配置し、その後ろに、起動が完了したか否かを判定し、起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させるコードを配置し、その後ろに、デバイスドライバに対する初期化処理を行う区画化コードを配置した最適化コードを生成する。   In addition, since the optimization code for performing the kernel boot process as described above is automatically generated from the existing kernel source code, the partition analysis unit partitions the kernel source code for each device that performs the boot process on the device. The code is partitioned into a partition code for each device driver that performs initialization processing for the device driver, and partitioning code that performs other processing, and the relocation means performs startup processing for the device in the partitioning code. The partitioning codes to be executed are arranged in the order of the device activation waiting time, and after that, it is determined whether the activation is completed, and the initialization process of the device driver corresponding to the device that is determined to have completed the activation is started. Optimized code where code is placed, followed by partitioned code that performs initialization processing for the device driver Generated.

本発明によれば、カーネル起動処理においてCPUが何も実行しない無駄な時間を極力少なくすることができ、その結果、カーネル起動処理に要する時間を短縮化することが可能になる。その理由は、コンピュータがカーネル起動処理を行う際、先ず、複数のデバイスをデバイス起動待ち時間が長いものから順に起動し、その後、起動が完了したデバイスに対応するデバイスドライバから順に初期化するようにしているからである。   According to the present invention, it is possible to minimize the wasteful time during which the CPU does nothing in the kernel boot process, and as a result, it is possible to shorten the time required for the kernel boot process. The reason for this is that when the computer performs the kernel boot process, first start multiple devices in descending order of device boot latency, and then initialize the device drivers corresponding to the devices that have booted up in order. Because.

また、本発明によれば、既存のカーネルソースコードから上記したようなカーネル起動処理を行う最適化コードを生成することが可能になる。その理由は、カーネルソースコードを、デバイスに対する起動処理を行うデバイス毎の区画化コードと、デバイスドライバに対する初期化処理を行うデバイスドライバ毎の区画化コードと、他の処理を行う区画化コードとに区画化する区画化分析手段と、区画化コードの内の、デバイスに対する起動処理を行う区画化コードをデバイス起動待ち時間が長い順に配置し、その後ろに、起動が完了したか否かを判定し、起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させるコードを配置し、その後ろに、デバイスドライバに対する初期化処理を行う区画化コードを配置した最適化コードを生成する再配置手段とを備えているからである。   Further, according to the present invention, it is possible to generate an optimization code for performing the kernel startup process as described above from an existing kernel source code. The reason for this is that the kernel source code is divided into a partitioning code for each device that performs startup processing on the device, a partitioning code for each device driver that performs initialization processing for the device driver, and a partitioning code that performs other processing. The partitioning analysis means for partitioning and the partitioning code for performing the startup process for the device in the partitioning code are arranged in the order of the device startup waiting time, and after that, it is determined whether the startup is completed. , Place the code that starts the initialization process of the device driver corresponding to the device that has been determined to have completed startup, and then generate the optimization code that contains the partitioning code that performs the initialization process for the device driver This is because it includes relocation means.

次に、本発明を実施するための最良の形態について図面を参照して詳細に説明する。   Next, the best mode for carrying out the present invention will be described in detail with reference to the drawings.

〔本発明の第1の実施の形態の構成の説明〕
本実施の形態は、カーネル初期化処理が高速化されるように、カーネルソースコードを最適化するものである。図1を参照すると、本実施の形態を適用したコンピュータ1は、カーネル10と、区画化分析手段20と、再配置手段30と、記憶装置40と、複数のデバイス50とを備えている。
[Description of Configuration of First Embodiment of the Present Invention]
In the present embodiment, the kernel source code is optimized so that the kernel initialization process is accelerated. Referring to FIG. 1, a computer 1 to which this embodiment is applied includes a kernel 10, a partitioning analysis unit 20, a rearrangement unit 30, a storage device 40, and a plurality of devices 50.

記憶装置40には、カーネルソースコード記憶部41と、区画化コード記憶部42と、起動待ち時間記憶部43と、分類情報記憶部44と、分析結果記憶部45と、最適化コード記憶部46と、オブジェクトコード記憶部47とが設けられている。カーネルソースコード記憶部41には、カーネル10のカーネルソースコード(最適化を行う前のカーネルソースコード)が格納されている。   The storage device 40 includes a kernel source code storage unit 41, a partitioned code storage unit 42, an activation waiting time storage unit 43, a classification information storage unit 44, an analysis result storage unit 45, and an optimization code storage unit 46. And an object code storage unit 47 is provided. The kernel source code storage unit 41 stores the kernel source code of the kernel 10 (kernel source code before optimization).

カーネル10は、デバイス50毎のデバイスドライバ12を備えている。更に、カーネル10には、各デバイス50のデバイス起動待ち時間を測定し、起動待ち時間記憶部43に格納する情報採取モジュール11が組み込まれている。   The kernel 10 includes a device driver 12 for each device 50. Further, the kernel 10 incorporates an information collection module 11 that measures the device activation waiting time of each device 50 and stores it in the activation waiting time storage unit 43.

区画化分析手段20は、区画化手段21と、分析手段22とを含んでいる。   The partitioning analysis means 20 includes a partitioning means 21 and an analysis means 22.

区画化手段21は、カーネルソースコード記憶部41から入力したカーネルソースコードを関数呼び出し単位で区画化することにより、区画化コードを生成し、生成した区画化コードを区画化コード記憶部42に格納する機能を有する。なお、区画化手段21は、カーネルソースコードを関数呼び出し単位で区画化する際、関数呼び出しで使用する引数への操作部分も同じ区画に入れる。また、区画化手段21は、区画化コードを区画化コード記憶部42に格納する際、各区画化コードを一意に識別する区画化コード名を付与する。区画化コードに付与する区画化コード名は、各区画化コードを一意に識別できるものならどのようなものでも構わないが、例えば、区画化時に抽出された呼び出し関数名に“REBLOCKING”などのPrefixを付けたものを、区画化コード名とすることができる。   The partitioning means 21 generates a partitioned code by partitioning the kernel source code input from the kernel source code storage unit 41 in units of function calls, and stores the generated partitioned code in the partitioned code storage unit 42. Has the function of When partitioning the kernel source code in function call units, the partitioning means 21 also puts the operation part for the argument used in the function call in the same partition. Further, the partitioning means 21 assigns a partitioning code name for uniquely identifying each partitioning code when storing the partitioning code in the partitioning code storage unit 42. The partitioning code name assigned to the partitioning code may be anything as long as each partitioning code can be uniquely identified. The one with a can be used as a partitioning code name.

分析手段22は、分類情報記憶部44に格納されている分類情報に基づいて、区画化コード記憶部42に格納されている各区画化コードが、次の3つのフェーズのどのフェーズに属するものであるかを判定する機能を有する。   Based on the classification information stored in the classification information storage unit 44, the analysis means 22 is assigned to which of the following three phases each partitioning code stored in the partitioning code storage unit 42 belongs. It has a function to determine whether or not there is.

・第1フェーズ(フェーズ1)…起動コマンドの発行処理などのデバイス起動処理を行うフェーズである。
・第2フェーズ(フェーズ2)…ドライバ構造体作成処理などのデバイスドライバ初期化処理を行うフェーズである。
・第3フェーズ(フェーズ3)…デバイス起動処理、デバイスドライバ初期化処理以外の初期化処理を行うフェーズである。
First phase (phase 1): This is a phase for performing device activation processing such as activation command issuance processing.
Second phase (Phase 2): Phase in which device driver initialization processing such as driver structure creation processing is performed.
Third phase (phase 3) is a phase for performing initialization processing other than device activation processing and device driver initialization processing.

分類情報記憶部44には、第1フェーズおよび第2フェーズで使用される関数と、その関数の処理内容(第1フェーズで使用されるものなのか、第2フェーズで使用されるものなのかを示す)とが対応付けて登録されている。図2は、分類情報記憶部44の内容例を示す図である。同図の例は、関数「io_device_init()」は、第1フェーズ(デバイス起動処理)で使用され、関数「io_device_driver_init()」は、第2フェーズ(デバイスドライバ初期化処理)で使用されることを示している。   The classification information storage unit 44 stores the function used in the first phase and the second phase and the processing content of the function (whether it is used in the first phase or the second phase). Are registered in association with each other. FIG. 2 is a diagram illustrating an example of the contents of the classification information storage unit 44. In the example in the figure, the function “io_device_init ()” is used in the first phase (device activation process), and the function “io_device_driver_init ()” is used in the second phase (device driver initialization process). Show.

即ち、分析手段22は、区画化コード記憶部42に格納されている各区画化コードの内、分類情報記憶部44において処理内容が「デバイス起動処理(第1フェーズ)」となっている関数を含んでいるものは第1フェーズに属すると判定し、分類情報記憶部44において処理内容が「デバイスドライバ初期化処理(第2フェーズ)」となっている関数を含んでいるものは第2フェーズに属すると判定し、分類情報記憶部44に登録されている関数を含んでいないものは第3フェーズに属すると判定する。   That is, the analysis unit 22 includes a function whose processing content is “device activation processing (first phase)” in the classification information storage unit 44 among the respective partitioning codes stored in the partitioning code storage unit 42. What is included is determined to belong to the first phase, and what includes a function whose processing content is “device driver initialization processing (second phase)” in the classification information storage unit 44 is included in the second phase. It is determined that they belong, and those that do not include the function registered in the classification information storage unit 44 are determined to belong to the third phase.

更に、分析手段22は、第1フェーズに属すると判定した区画化コードについては、起動待ち時間記憶部43を参照して、その区画化コードが起動処理を担当しているデバイスのデバイス起動時間を求める機能や、分析結果記憶部45に分析結果情報を格納する機能を有する。分析結果情報には、各区画化コードの区画化コード名と、その区画化コード名の区画化コードが属するフェーズのフェーズ識別子と、デバイス起動待ち時間(第1フェーズに属する区画化コードについてのみ)とが含まれる。なお、第1フェーズに属する各区画化コードが、どのデバイスの起動処理を担当しているかは、各区画化コード内の引数から調べることができる。   Further, the analysis unit 22 refers to the activation waiting time storage unit 43 for the partitioning code determined to belong to the first phase, and determines the device activation time of the device for which the partitioning code is in charge of activation processing. And a function for storing analysis result information in the analysis result storage unit 45. The analysis result information includes the partition code name of each partition code, the phase identifier of the phase to which the partition code of the partition code name belongs, and the device activation waiting time (only for the partition code belonging to the first phase). And are included. In addition, it can be checked from an argument in each partitioning code that each partitioning code belonging to the first phase is in charge of which device activation process.

図3は、分析結果記憶部45の内容例を示す図である。同図の例は、区画化コード名「K1」「K2」「K3」の区画化コードは、それぞれ第1、第2、第3フェーズに属し、区画化コード名「K1」の区画化コードによって初期化されるデバイスは、デバイス起動待ち時間が「t1」であることを示している。   FIG. 3 is a diagram illustrating an example of the contents of the analysis result storage unit 45. In the example shown in the figure, the partitioning codes with the partitioning code names “K1”, “K2”, and “K3” belong to the first, second, and third phases, respectively. The device to be initialized indicates that the device activation waiting time is “t1”.

再配置手段30は、区画化コード記憶部42に格納されている各区画化コードと、分析結果記憶部45の内容とに基づいて、図4に示すような最適化コード400を生成し、それを最適化コード記憶部46に格納する機能を有する。   The rearrangement means 30 generates an optimization code 400 as shown in FIG. 4 on the basis of each partitioning code stored in the partitioning code storage unit 42 and the contents of the analysis result storage unit 45. Is stored in the optimized code storage unit 46.

図4を参照すると、最適化コード400の先頭部分には、第1フェーズに属する各区画化コード401(各デバイス50を起動させる区画化コード)が、デバイス起動待ち時間が長いものから順に配置されている。その後ろには、各デバイス50毎に起動が完了したか否かを判定し、起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させる第1フェーズ完了判定コード402が配置されている。その後ろには、第2、第3フェーズに属する各区画化コード403、404が配置されている。   Referring to FIG. 4, at the top of the optimization code 400, each partitioning code 401 (partitioning code for starting each device 50) belonging to the first phase is arranged in order from the longest device activation waiting time. ing. A first phase completion determination code 402 for determining whether or not the activation has been completed for each device 50 and starting the initialization process of the device driver corresponding to the device that has been determined to be activated is disposed behind the first phase completion determination code 402. Has been. Behind that, the partitioning codes 403 and 404 belonging to the second and third phases are arranged.

なお、区画化分析手段20および再配置手段30は、CPU(コンピュータ)によって実現可能であり、コンピュータによって実現する場合は、例えば、次のようにする。コンピュータを、区画化分析手段20、再配置手段30として機能させるためのプログラムを記録したデバイス、半導体メモリ、その他の記録媒体を用意し、コンピュータに上記プログラムを読み取らせる。コンピュータは、読み取ったプログラムに従って自身の動作を制御することにより、自コンピュータ上に、区画化分析手段20および再配置手段30を実現する。   Note that the partitioning analysis unit 20 and the rearrangement unit 30 can be realized by a CPU (computer), and when realized by a computer, for example, as follows. A device, a semiconductor memory, and other recording media recording a program for causing the computer to function as the partitioning analysis unit 20 and the rearrangement unit 30 are prepared, and the computer reads the program. The computer realizes the partitioning analysis means 20 and the rearrangement means 30 on its own computer by controlling its own operation according to the read program.

〔第1の実施の形態の動作の説明〕
次に、本実施の形態の動作について詳細に説明する。
[Description of Operation of First Embodiment]
Next, the operation of the present embodiment will be described in detail.

本実施の形態では、図5のフローチャートに示すように、先ず、区画化手段21による区画化処理(ステップS51)が行われ、次いで、情報採取モジュール11による情報採取処理(ステップS52)が行われ、その後、分析手段22による分析処理(ステップS53)が行われ、最後に、再配置手段30による再配置処理(ステップS54)が行われる。以下では、各手段が各ステップで行う処理を詳しく説明する。   In the present embodiment, as shown in the flowchart of FIG. 5, first, the partitioning process by the partitioning means 21 (step S51) is performed, and then the information collection process by the information collection module 11 (step S52) is performed. Thereafter, an analysis process (step S53) by the analysis unit 22 is performed, and finally a rearrangement process (step S54) by the rearrangement unit 30 is performed. Below, the process which each means performs at each step is demonstrated in detail.

区画化手段21は、図6のフローチャートに示すように、カーネルソースコード記憶部41からカーネルソースコードを入力し(ステップS61)、入力したカーネルソースコードを関数呼び出し単位で区画化することにより、区画化コードを生成する(ステップS62)。その際、区画化手段21は、関数呼び出しで使用する引数への操作部分も同じ区画に入れる。その後、区画化手段21は、各区画化コードにそれぞれユニークな区画化コード名を付加して区画化コード記憶部42に格納する(ステップS63)。   As shown in the flowchart of FIG. 6, the partitioning means 21 inputs the kernel source code from the kernel source code storage unit 41 (step S61), and partitions the input kernel source code in units of function calls. A code is generated (step S62). At that time, the partitioning means 21 also puts the operation part for the argument used in the function call in the same partition. Thereafter, the partitioning means 21 adds a unique partitioning code name to each partitioning code and stores it in the partitioning code storage unit 42 (step S63).

図7に区画化コード記憶部42の内容例を示す。同図の例は、n個の区画化コード42−1〜42−nがそれぞれ区画化コード名「K1」〜「Kn」を付加されて区画化コード記憶部42に登録されていることを示している。   FIG. 7 shows an example of the contents of the partitioning code storage unit 42. The example in the figure shows that n partitioning codes 42-1 to 42-n are registered in the partitioning code storage unit 42 with partitioning code names “K1” to “Kn” added thereto, respectively. ing.

区画化手段21による区画化処理(図5のステップS51)が完了すると、情報採取モジュール11による情報採取処理(ステップS52)が行われる。   When the partitioning process (step S51 in FIG. 5) by the partitioning means 21 is completed, the information collection process (step S52) by the information collection module 11 is performed.

この情報採取処理では、まだ最適化が実施されていないカーネル10に対し、情報採取モジュール11を組み込んだ上でテストランという形で一度カーネル起動処理を実施する。情報採取モジュール11では、テストランの間に、各デバイス50のデバイス起動待ち時間を測定し(図8のステップS81)、各デバイスのデバイスIDと測定したデバイス起動待ち時間とを対応付けて起動待ち時間記憶部43に格納する(ステップS82)。   In this information collection process, the kernel activation process is executed once in the form of a test run after incorporating the information collection module 11 into the kernel 10 that has not been optimized yet. The information collection module 11 measures the device activation waiting time of each device 50 during a test run (step S81 in FIG. 8), and waits for activation by associating the device ID of each device with the measured device activation waiting time. The time is stored in the time storage unit 43 (step S82).

情報採取モジュール11による情報採取処理(図5のステップS52)が完了すると、分析手段22による分析処理(ステップS53)が実行される。   When the information collection process by the information collection module 11 (step S52 in FIG. 5) is completed, the analysis process (step S53) by the analysis unit 22 is executed.

分析手段22は、図9のフローチャートに示すように、先ず、区画化コード記憶部42(図7参照)から各区画化コード42−1〜42−nを入力し(ステップS91)、次いで、分類情報記憶部44(図2参照)から関数と処理内容との対からなる分類情報を入力する(ステップS92)。   As shown in the flowchart of FIG. 9, the analysis means 22 first inputs the partitioning codes 42-1 to 42-n from the partitioning code storage unit 42 (see FIG. 7) (step S91), and then classifies them. Classification information including a pair of a function and a processing content is input from the information storage unit 44 (see FIG. 2) (step S92).

次いで、分析手段22は、分類情報記憶部44から入力した分類情報に基づいて、各区画化コード42−1〜42−nが属するフェーズを判定する(ステップS93)。具体的には、区画化コード42−1〜42−nの内、入力した分類情報において処理内容が「デバイス起動処理(第1フェーズ)」「デバイスドライバ初期化処理(第2フェーズ)」となっている関数を含んでいる区画化コードは、それぞれ第1フェーズ、第2フェーズに属すると判定し、分類情報中の関数を含んでいない区画化コードは、第3フェーズに属すると判定する。   Next, the analysis unit 22 determines the phase to which each partitioning code 42-1 to 42-n belongs based on the classification information input from the classification information storage unit 44 (step S93). Specifically, among the partitioning codes 42-1 to 42-n, the processing contents in the input classification information are “device activation processing (first phase)” and “device driver initialization processing (second phase)”. Are determined to belong to the first phase and the second phase, respectively, and the partitioning code not including the function in the classification information is determined to belong to the third phase.

その後、分析手段22は、起動待ち時間記憶部43から各デバイス50のデバイス起動待ち時間を入力し(ステップS94)、第1フェーズに属する各区画化コード毎に、その区画化コードが起動処理を受け持っているデバイスのデバイス起動時間を求める(ステップS95)。   Thereafter, the analysis means 22 inputs the device activation waiting time of each device 50 from the activation waiting time storage unit 43 (step S94), and for each partitioning code belonging to the first phase, the partitioning code performs the activation process. The device activation time of the device in charge is obtained (step S95).

そして、最後に、分析手段22は、各区画化コード42−1〜42−nの区画化コード名「K1」〜「Kn」と、その区画化コード名の区画化コードが属するフェーズのフェーズ識別子と、デバイス起動待ち時間(第1フェーズに属する区画化コードのみ)とからなる分析結果情報を、分析結果記憶部45に格納する(ステップS96)。   Finally, the analysis unit 22 uses the partitioning code names “K1” to “Kn” of the partitioning codes 42-1 to 42-n and the phase identifier of the phase to which the partitioning code of the partitioning code name belongs. And the analysis result information including the device activation waiting time (only the partitioning code belonging to the first phase) is stored in the analysis result storage unit 45 (step S96).

分析手段22による分析処理(図5のステップS53)が完了すると、再配置手段30による再配置処理(ステップS54)が実行される。   When the analysis process (step S53 in FIG. 5) by the analysis unit 22 is completed, the rearrangement process (step S54) by the rearrangement unit 30 is executed.

再配置手段30は、図10のフローチャートに示すように、先ず、分析結果情報記憶部45(図3参照)から分析結果情報を入力し(ステップS101)、次いで、区画化コード記憶部(図7参照)から区画化コード名が付加された区画化コード42−1〜42−nを入力する(ステップS102)。   As shown in the flowchart of FIG. 10, the rearrangement means 30 first inputs the analysis result information from the analysis result information storage unit 45 (see FIG. 3) (step S101), and then the partitioning code storage unit (FIG. 7). The partitioning codes 42-1 to 42-n to which the partitioning code names are added are input (see step S102).

次いで、再配置手段30は、入力した分析結果情報と、区画化コード42−1〜42−nとに基づいて、図4に示すような最適化コード400を生成する(ステップS103)。   Next, the rearrangement unit 30 generates an optimization code 400 as shown in FIG. 4 based on the input analysis result information and the partitioning codes 42-1 to 42-n (step S103).

即ち、再配置手段30は、デバイス起動待ち時間が長いデバイスから順にデバイス起動処理が行われるように、第1フェーズに属する各区画化コード401(各デバイス50の起動処理を行う区画化コード)をデバイス起動待ち時間が長いものから順に配置する。デバイス起動待ち時間が長いデバイスから順にデバイス起動処理を行うようにするのは、CPUが何もしない無駄な時間を極力少なくし、カーネル起動処理に要する時間を短縮化するためである。   That is, the relocation unit 30 assigns each partitioning code 401 (partitioning code for performing the start processing of each device 50) belonging to the first phase so that the device start processing is performed in order from the device with the long device start waiting time. Arrange devices in descending order of device startup latency. The reason why the device activation processing is performed in order from the device with the longest device activation waiting time is to reduce the time required for the kernel activation processing by minimizing the wasteful time during which the CPU does nothing.

この次に、デバイス50の起動が完了した後に、対応するデバイスドライバ12の初期化処理が行われるようにするために、各デバイス50毎に起動が完了したか否かを判定し、起動が完了したと判定したデバイス50に対応するデバイスドライバ12の初期化処理を開始させる第1フェーズ完了判定コード402を配置する。   Next, in order to perform initialization processing of the corresponding device driver 12 after the activation of the device 50 is completed, it is determined whether the activation is completed for each device 50 and the activation is completed. The first phase completion determination code 402 for starting the initialization process of the device driver 12 corresponding to the device 50 determined to have been performed is arranged.

第1フェーズ完了判定コード402の次には、第2フェーズに属する区画化コード(デバイスドライバ12の初期化処理を行う区画化コード)403を配置する。更に、第2フェーズの処理が完了した後、第3フェーズの処理が行われるように、第3フェーズに属する区画化コードを配置する。   Next to the first phase completion determination code 402, a partitioning code (partitioning code for performing initialization processing of the device driver 12) 403 belonging to the second phase is arranged. Further, the partitioning code belonging to the third phase is arranged so that the third phase processing is performed after the completion of the second phase processing.

この再配置を行った結果として最適化コード400が生成される。ここでの最適化コード400は、カーネルソースコード記憶部41に格納されているカーネルソースコードと同等のソースコードであるので最適化コード400を用いてカーネルのビルドが可能である。最適化コード400を使用してカーネルのビルドを行えば、カーネル起動処理全体について高速化が図れるように処理の再配置が行われたカーネルが作成可能となり、カーネル起動処理の高速化としての目的が達成される。   As a result of this rearrangement, an optimized code 400 is generated. Since the optimization code 400 here is a source code equivalent to the kernel source code stored in the kernel source code storage unit 41, a kernel can be built using the optimization code 400. If the kernel is built using the optimization code 400, it is possible to create a kernel that has been rearranged so that the entire kernel startup process can be speeded up. Achieved.

そして、最後に、再配置手段30は、生成した最適化コード400を最適化コード記憶部46に格納する(ステップS104)。   Finally, the rearrangement unit 30 stores the generated optimization code 400 in the optimization code storage unit 46 (step S104).

〔本実施の形態のカーネル起動処理の説明〕
次に、図11を参照して、最適化コード400を利用したカーネル起動処理100について説明する。なお、カーネル起動処理100は、CPU(図示せず)が、最適化コード400をコンパイルしたオブジェクトコードを実行することにより行われるものであり、上記オブジェクトコードは、オブジェクトコード記憶部47に格納されている。
[Explanation of kernel boot processing of this embodiment]
Next, with reference to FIG. 11, the kernel activation process 100 using the optimization code 400 will be described. The kernel activation process 100 is performed by a CPU (not shown) executing an object code obtained by compiling the optimized code 400. The object code is stored in the object code storage unit 47. Yes.

カーネル起動処理100においては、先ず、第1フェーズ(フェーズ1)201が実行される。第1フェーズ201においては、各デバイス50が、デバイス起動待ち時間が長い順に起動される。   In the kernel boot process 100, first, the first phase (phase 1) 201 is executed. In the first phase 201, each device 50 is activated in descending order of device activation waiting time.

第1フェーズ201が完了すると、第1フェーズ完了判定処理203により、各デバイス50毎に、デバイスの起動が完了したか否かを判定する。この判定は、デバイス50に対しての「ポーリング」によるデバイス起動判定や、デバイス起動完了後に割り込みが発生するデバイス50に関しては「デバイスからの割り込み発生」による判定などを指す。そして、起動完了が確認できたデバイス50については、そのデバイス50に対応するデバイスドライバ12の初期化処理(第2フェーズ)を開始させる。   When the first phase 201 is completed, the first phase completion determination process 203 determines whether or not the device activation is completed for each device 50. This determination refers to device activation determination based on “polling” with respect to the device 50, or determination based on “occurrence of interrupt from device” for the device 50 that generates an interrupt after the completion of device activation. Then, for the device 50 whose activation has been confirmed, the initialization process (second phase) of the device driver 12 corresponding to the device 50 is started.

第2フェーズ(フェーズ2)204において、全てのデバイスドライバ12に対する初期化処理(ドライバ構造体作成処理など)が完了すると、第3フェーズ(メモリ初期化処理などのその他の初期化処理)205が実行される。   In the second phase (phase 2) 204, when initialization processing (driver structure creation processing, etc.) for all device drivers 12 is completed, the third phase (other initialization processing such as memory initialization processing) 205 is executed. Is done.

なお、上述した説明では、図5の区画化処理(ステップS51)、分析処理(ステップS53)において、区画化手段21、分析手段22がそれぞれ図6、図9のフローチャートに示す処理を行うようにしたが、区画化手段21、分析手段22がそれぞれ図12、図13のフローチャートに示す処理を行うようにしても良い。   In the above description, in the partitioning process (step S51) and the analysis process (step S53) of FIG. 5, the partitioning means 21 and the analysis means 22 perform the processes shown in the flowcharts of FIGS. However, the partitioning means 21 and the analysis means 22 may perform the processes shown in the flowcharts of FIGS.

区画化手段21は、図12のフローチャートに示すように、カーネルソースコード記憶部41からカーネルソースコードを入力し(ステップS121)、入力したカーネルソースコードを関数呼び出し単位で区画化することにより、区画化コードを生成する(ステップS122)。その際、区画化手段21は、関数呼び出しで使用する引数への操作部分も同じ区画に入れる。   As shown in the flowchart of FIG. 12, the partitioning means 21 inputs the kernel source code from the kernel source code storage unit 41 (step S121), and partitions the input kernel source code in units of function calls. An encrypted code is generated (step S122). At that time, the partitioning means 21 also puts the operation part for the argument used in the function call in the same partition.

その後、区画化手段21は、分類情報記憶部44(図2参照)から分類情報を入力し、この分類情報に基づいて、各区画化コードが第1フェーズ〜第3フェーズのどのフェーズに属するか判定する(ステップS123、S124)。その後、区画化手段21は、各区画化コードに、その区画化コードが属するフェーズのフェーズ識別子と、ユニークな区画化コード名とを付加して区画化コード記憶部42に格納する(ステップS125)。   Thereafter, the partitioning means 21 inputs the classification information from the classification information storage unit 44 (see FIG. 2), and based on this classification information, which phase of the first to third phases each partitioning code belongs to Determination is made (steps S123 and S124). Thereafter, the partitioning means 21 adds the phase identifier of the phase to which the partitioning code belongs and a unique partitioning code name to each partitioning code and stores them in the partitioning code storage unit 42 (step S125). .

図14に区画化コード記憶部42の内容例を示す。同図の例は、n個の区画化コード42−1〜42−nがそれぞれ区画化コード名「K1」〜「Kn」を付加されて区画化コード記憶部42に登録されていることを示すと共に、区画化コード42−1、42−2、42−nがそれぞれ第1フェーズ(F1)、第2フェーズ(F2)、第3フェーズ(F3)に属していることを示している。   FIG. 14 shows an example of the contents of the partitioning code storage unit 42. The example in the figure shows that n partition codes 42-1 to 42-n are registered in the partition code storage unit 42 with partition code names "K1" to "Kn" added thereto, respectively. In addition, the partitioning codes 42-1, 42-2, and 42-n belong to the first phase (F1), the second phase (F2), and the third phase (F3), respectively.

一方、分析手段22は、図13のフローチャートに示すように、先ず、区画化コード記憶部42(図14参照)から、区画化コード名およびフェーズ識別子が付加された区画化コード42−1〜42−nを入力し(ステップS131)、次いで、起動待ち時間記憶部43から各デバイス50のデバイス起動待ち時間を入力する(ステップS132)。その後、分析手段22は、第1フェーズに属する各区画化コード毎に、その区画化コードが起動処理を受け持っているデバイスのデバイス起動待ち時間を求める(ステップS133)。そして、最後に、分析手段22は、各区画化コード42−1〜42−nの区画化コード名「K1」〜「Kn」と、その区画化コード名の区画化コードが属するフェーズのフェーズ識別子と、デバイス起動待ち時間(第1フェーズに属する区画化コードのみ)とからなる分析結果情報を、分析結果記憶部45に格納する(ステップS134)。   On the other hand, as shown in the flowchart of FIG. 13, the analysis unit 22 firstly creates partitioned codes 42-1 to 42-42 to which the partitioned code names and phase identifiers are added from the partitioned code storage unit 42 (see FIG. 14). -N is input (step S131), and then the device activation waiting time of each device 50 is input from the activation waiting time storage unit 43 (step S132). Thereafter, the analysis unit 22 obtains the device activation waiting time of the device for which the partitioning code is in charge of the activation process for each partitioning code belonging to the first phase (step S133). Finally, the analysis unit 22 uses the partitioning code names “K1” to “Kn” of the partitioning codes 42-1 to 42-n and the phase identifier of the phase to which the partitioning code of the partitioning code name belongs. And the analysis result information including the device activation waiting time (only the partitioning code belonging to the first phase) is stored in the analysis result storage unit 45 (step S134).

〔第1の実施の形態の効果〕
本実施の形態によれば、カーネル起動処理においてCPUが何も実行しない無駄な時間を極力少なくすることができ、その結果、カーネル起動処理に要する時間を短縮化することが可能になる。その理由は、コンピュータ1がカーネル起動処理100を行う際、先ず、複数のデバイスをデバイス起動待ち時間が長いものから順に起動し、その後、起動が完了したデバイスに対応するデバイスドライバから順に初期化するようにしているからである。
[Effect of the first embodiment]
According to the present embodiment, it is possible to minimize the wasteful time during which the CPU does nothing in the kernel boot process, and as a result, it is possible to shorten the time required for the kernel boot process. The reason is that when the computer 1 performs the kernel boot process 100, first, a plurality of devices are booted in order from the device having the longest boot time, and then the device drivers corresponding to the devices that have been booted are initialized in turn. It is because it is doing.

また、本実施の形態によれば、既存のカーネルソースコードから上記したようなカーネル起動処理を行う最適化コードを生成することが可能になる。その理由は、カーネルソースコードを、デバイスに対する起動処理を行うデバイス毎の区画化コードと、デバイスドライバに対する初期化処理を行うデバイスドライバ毎の区画化コードと、他の処理を行う区画化コードとに区画化する区画化分析手段20と、区画化コードの内の、デバイスに対する起動処理を行う区画化コードをデバイス起動待ち時間が長い順に配置し、その後ろに、起動が完了したか否かを判定し、起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させるコードを配置し、その後ろに、デバイスドライバに対する初期化を行う区画化コードを配置し、その後ろに、他の処理を行う区画化コードを配置した最適化コードを生成する再配置手段30とを備えているからである。   Further, according to the present embodiment, it is possible to generate an optimization code for performing the kernel startup process as described above from the existing kernel source code. The reason for this is that the kernel source code is divided into a partitioning code for each device that performs startup processing on the device, a partitioning code for each device driver that performs initialization processing for the device driver, and a partitioning code that performs other processing. The partitioning analysis means 20 for partitioning and the partitioning codes for performing the startup processing for the devices in the partitioning code are arranged in the order of the device startup waiting time, and after that, it is determined whether the startup is completed. Then, place the code that starts the initialization process of the device driver corresponding to the device that is determined to have completed booting, and place the partitioning code that performs initialization for the device driver, followed by the others This is because it includes a rearrangement unit 30 that generates an optimized code in which the partitioned code for performing the above process is arranged.

〔本発明の第2の実施の形態〕
次に、本発明の第2の実施の形態について説明する。図15は本実施の形態にかかるカーネル起動方法を説明するための図であり、本実施の形態のカーネル起動処理100においては、第1フェーズ201、デバイスに非依存な初期化処理202、第1フェーズ完了判定処理203a、第2フェーズ204、デバイスに依存する初期化処理206が順次実行される。
[Second Embodiment of the Present Invention]
Next, a second embodiment of the present invention will be described. FIG. 15 is a diagram for explaining a kernel booting method according to the present embodiment. In the kernel booting process 100 of the present embodiment, the first phase 201, the device-independent initialization process 202, the first Phase completion determination processing 203a, second phase 204, and device-dependent initialization processing 206 are sequentially executed.

第1フェーズ201においては、各デバイス50に対するデバイス起動処理を、デバイス起動待ち時間が長いものから順に実行する。   In the first phase 201, the device activation processing for each device 50 is executed in order from the device with the longest device activation waiting time.

第1フェーズ201の完了後、デバイスに非依存な初期化処理202を実行する。デバイスに非依存な初期化処理202においては、デバイス起動処理およびデバイスドライバ初期化処理を除いた初期化処理(図19におけるその他の初期化処理101)の内の、デバイスの状態によらずカーネル起動処理100内の任意のタイミングで実行可能な初期化処理を実行する。即ち、カーネル起動処理100の任意のタイミングで初期化処理を行うことができるモジュールに対する初期化処理を行う。   After the completion of the first phase 201, a device-independent initialization process 202 is executed. In the initialization process 202 independent of the device, the kernel is activated regardless of the device state in the initialization process (other initialization processes 101 in FIG. 19) excluding the device activation process and the device driver initialization process. An initialization process that can be executed at an arbitrary timing in the process 100 is executed. That is, initialization processing is performed on a module that can perform initialization processing at an arbitrary timing of the kernel activation processing 100.

ここで、第1フェーズ201において、デバイス起動待ち時間が長いデバイスから順に起動するようにした理由は、最も長いデバイスの起動待ち時間103の間に他のデバイスのデバイス起動処理を行うことで、待ち時間の相殺を行うことが可能となるからであり、逆に、デバイス起動待ち時間が短いデバイスから起動を行う場合で、最も長いデバイスの起動待ち時間103よりデバイスに非依存な初期化処理202にかかる時間が短かった場合には、CPUとしては何も処理しない無駄な待ち合わせ時間が発生するからである。   Here, in the first phase 201, the reason for starting sequentially from the device with the longest device activation waiting time is that the device activation processing of the other device is performed during the activation waiting time 103 of the longest device. This is because it is possible to cancel the time, and conversely, in the case of starting from a device with a short device activation waiting time, the initialization processing 202 which is device-independent than the longest device activation waiting time 103 is performed. This is because, when the time is short, a wasteful waiting time in which nothing is processed by the CPU occurs.

デバイスに非依存な初期化処理202の完了後、第1フェーズ完了判定処理203aを実行する。第1フェーズ完了判定処理203aでは、全てのデバイス50の起動が完了したか否かを判定する。即ち、第1フェーズ完了判定処理203aでは、第2フェーズ204へ移行するための必要条件の判定を行う。   After completion of the device-independent initialization process 202, a first phase completion determination process 203a is executed. In the first phase completion determination process 203a, it is determined whether or not all the devices 50 have been activated. That is, in the first phase completion determination process 203a, a necessary condition for shifting to the second phase 204 is determined.

第1フェーズ完了判定処理203aにおいて、全てのデバイス50の起動完了が確認できた場合、第2フェーズ204を実行する。第2フェーズ204では、各デバイスドライバ12に対する初期化処理(ドライバ構造体作成処理など)を実行する。   In the first phase completion determination process 203a, when it is confirmed that all the devices 50 have been activated, the second phase 204 is executed. In the second phase 204, initialization processing (driver structure creation processing or the like) for each device driver 12 is executed.

そして、最後に、デバイスドライバの初期化完了後に実行可能となるデバイスに依存する初期化処理206を行う。即ち、デバイスドライバの初期化処理が完了しなければ初期化処理を行うことができないモジュールに対する初期化処理を行う。   Finally, an initialization process 206 depending on the device that can be executed after the initialization of the device driver is completed. That is, initialization processing is performed for modules that cannot be initialized unless the initialization processing of the device driver is completed.

なお、上記した処理は、カーネルソースコードをコンパイルしたオブジェクトコードを実行するCPUによって行われる。   The above processing is performed by a CPU that executes object code obtained by compiling kernel source code.

〔第2の実施の形態の効果〕
本実施の形態によれば、カーネル起動処理においてCPUが何も実行しない無駄な時間を極めて少なくすることができ、その結果、カーネル起動処理に要する時間を短縮化することが可能になる。その理由は、各デバイス50をデバイス起動待ち時間が長いものから順に起動する第1フェーズ201の次に、デバイスに非依存な初期化処理202を行うようにしているからである。
[Effects of Second Embodiment]
According to the present embodiment, it is possible to significantly reduce the time that the CPU does not execute anything in the kernel startup process, and as a result, it is possible to shorten the time required for the kernel startup process. This is because the device-independent initialization process 202 is performed after the first phase 201 in which each device 50 is activated in order from the longest device activation waiting time.

〔本発明の第3の実施の形態〕
本実施の形態は、カーネル起動処理において初期化の必要性が無いデバイスに関しては、カーネル起動処理の完了後に初期化を実施することにより、カーネル起動処理に要する時間を短縮化したことを特徴とする。
[Third embodiment of the present invention]
This embodiment is characterized by shortening the time required for kernel boot processing by performing initialization after completion of the kernel boot processing for devices that do not need to be initialized in the kernel boot processing. .

コンピュータが備えているデバイスは、カーネル起動直後に必要となるデバイスと、必要では無いデバイスとの2種類に分類することができる。本実施の形態では、カーネル起動直後に必要となるデバイスについては、カーネル起動処理におけるドライバ初期化処理内で実行し、カーネル起動完了直後に必要では無いデバイスに対しての初期化処理は、カーネル起動完了後に行うようにする。   Devices provided in the computer can be classified into two types: devices that are required immediately after the kernel is started and devices that are not required. In this embodiment, devices that are required immediately after the kernel startup are executed in the driver initialization process in the kernel startup process, and initialization processes for devices that are not required immediately after the kernel startup is completed are kernel startup. Do this after completion.

今、コンピュータが第1デバイス(デバイス1)〜第3デバイス(デバイス3)の3台のデバイスを備え、且つ第3デバイスがカーネル起動直後に必要でないデバイスであったとする。また、第1デバイスのデバイス起動待ち時間よりも、第2デバイスのデバイス起動待ち時間の方が長いとする。   Now, assume that the computer includes three devices, a first device (device 1) to a third device (device 3), and the third device is a device that is not required immediately after the kernel is started. Further, it is assumed that the device activation waiting time of the second device is longer than the device activation waiting time of the first device.

本実施の形態では、図16に示すように、カーネル起動処理100のドライバ初期化処理102において、先ず、第2デバイスに対するデバイス起動処理102−1が行われ、第2デバイスのデバイス起動待ち時間103の間に、第1デバイスに対するデバイス起動処理102−2、第1デバイスに対応するデバイスドライバに対する初期化処理102−3が順次行われる。そして、第2デバイスの起動が完了すると、第2デバイスに対応するデバイスドライバに対する初期化処理102−4が行われる。   In the present embodiment, as shown in FIG. 16, in the driver initialization process 102 of the kernel activation process 100, first, the device activation process 102-1 for the second device is performed, and the device activation waiting time 103 of the second device is performed. In the meantime, the device activation process 102-2 for the first device and the initialization process 102-3 for the device driver corresponding to the first device are sequentially performed. When the activation of the second device is completed, initialization processing 102-4 for the device driver corresponding to the second device is performed.

カーネル起動完了直後に必要のない第3デバイスに対するデバイス起動処理102−5、および第3デバイスに対応するデバイスドライバに対するデバイスドライバ初期化処理102−6は、カーネル起動処理100が完了した後に行う。なお、図15に示した第2の実施の形態に本実施の形態を適用する様にしても良い。   The device activation process 102-5 for the third device that is not required immediately after the kernel activation is completed and the device driver initialization process 102-6 for the device driver corresponding to the third device are performed after the kernel activation process 100 is completed. Note that this embodiment may be applied to the second embodiment shown in FIG.

〔第3の実施の形態の効果〕
本実施の形態によれば、カーネル起動完了直後に使用しないデバイス、デバイスドライバに対する起動処理102−5、初期化処理102−6は、カーネル起動処理100の完了後に行うようにしているので、カーネル起動処理100に要する時間を短くすることができる。
[Effect of the third embodiment]
According to the present embodiment, the boot process 102-5 and the initialization process 102-6 for devices and device drivers that are not used immediately after the kernel boot is completed are performed after the kernel boot process 100 is completed. The time required for the process 100 can be shortened.

〔本発明の第4の実施の形態〕
本実施の形態は、CPUを複数有するコンピュータにおいて、各CPUが処理を並行して行うことにより、カーネル起動処理に要する時間を短縮化させることを特徴とする。
[Fourth embodiment of the present invention]
The present embodiment is characterized in that in a computer having a plurality of CPUs, the time required for the kernel boot process is shortened by the CPUs performing the processes in parallel.

図17は、CPU1〜CPU4の4台のCPUを有するコンピュータにおけるカーネル起動処理100を示した図である。   FIG. 17 is a diagram showing a kernel boot process 100 in a computer having four CPUs CPU1 to CPU4.

先ず、各CPU1〜CPU4が、それぞれ、自CPUに割り当てられているデバイスに対するデバイス起動処理「フェーズ1−1〜フェーズ1−4」201を並行して行う。その際、各CPU1〜CPU4は、デバイス起動待ち時間が長いものから順にデバイス起動処理を行う。   First, each of the CPUs 1 to 4 performs in parallel the device activation processing “phase 1-1 to phase 1-4” 201 for the devices assigned to the CPU. At that time, each of the CPU1 to CPU4 performs device activation processing in order from the device with the longest device activation waiting time.

次いで、各CPU1〜CPU4が、自CPUに割り当てられているモジュールの内の、デバイスに非依存なモジュールに対する初期化処理202を行う。   Next, each of the CPU1 to CPU4 performs an initialization process 202 for a module independent of the device among the modules assigned to the CPU.

その後、各CPU1〜CPU4が、自CPUに割り当てられている全てのデバイスの起動が完了したか否かを判定するフェーズ1完了判定処理203を行う。   Thereafter, each of the CPU1 to CPU4 performs a phase 1 completion determination process 203 for determining whether or not activation of all devices assigned to the CPU is completed.

そして、自CPUに割り当てられている全てのデバイスの起動が完了していると判定したCPUから順に、自CPUに割り当てられているデバイスに対応するデバイスドライバのデバイスドライバ初期化処理「フェーズ2−1〜2−4」204を行う。   Then, the device driver initialization process “phase 2-1” of the device driver corresponding to the device assigned to the own CPU is sequentially performed from the CPU determined that the activation of all the devices assigned to the own CPU is completed. ˜2-4 ”204 is performed.

最後に、デバイスドライバの初期化処理が完了したCPUから順に、自CPUに割り当てられているモジュールの内の、デバイスに依存するモジュールの初期化処理205を行う。   Finally, the module-dependent module initialization process 205 among the modules assigned to the CPU is sequentially performed from the CPU for which the device driver initialization process has been completed.

〔第4の実施の形態の効果〕
本実施の形態によれば、複数のCPUが並行してカーネル起動処理100を行うので、カーネル起動処理100に要する時間を短縮化することができる。
[Effect of the fourth embodiment]
According to this embodiment, since a plurality of CPUs perform the kernel boot process 100 in parallel, the time required for the kernel boot process 100 can be shortened.

〔第5の実施の形態〕
次に、本発明の第5の実施の形態について説明する。本実施の形態は、コンピュータが、ブートローダの実行時に、デバイスに対するデバイス起動処理を行うことにより、カーネル起動処理に要する時間を短縮化したことを特徴とする。
[Fifth Embodiment]
Next, a fifth embodiment of the present invention will be described. The present embodiment is characterized in that the time required for the kernel boot process is shortened by performing the device boot process for the device when the computer executes the boot loader.

本実施の形態では、図18に示すように、コンピュータがブートローダの実行時、第1デバイス〜第3デバイスに対するデバイス起動処理102−1〜102−3を実行する。なお、各デバイスのデバイス起動待ち時間は、第1デバイスが最も長く、第3デバイスが最も短いとする。その後、ブートローダの本来の処理であるカーネル起動処理100を開始させる処理を行う。このブートローダ実行中というタイミングにおいてデバイスのデバイス起動処理102−1〜102−3の実行を前倒しすることにより、デバイスの起動待ちという時間の間、他の処理101を行うことで、無駄な待ち時間を相殺する。その後、カーネル起動処理100のドライバ初期化処理102において、各デバイスドライバの初期化処理102−4〜102−6を実行する。   In the present embodiment, as shown in FIG. 18, when the computer executes the boot loader, the computer executes device activation processing 102-1 to 102-3 for the first device to the third device. The device activation waiting time of each device is assumed to be the longest for the first device and the shortest for the third device. Thereafter, a process for starting the kernel activation process 100 which is the original process of the boot loader is performed. By delaying the execution of the device activation processing 102-1 to 102-3 of the device at the time when the boot loader is being executed, the other processing 101 is performed during the device activation waiting time. cancel. Thereafter, in the driver initialization processing 102 of the kernel activation processing 100, initialization processing 102-4 to 102-6 of each device driver is executed.

〔第5の実施の形態の効果〕
本実施の形態によれば、コンピュータがブートローダの実行時に、デバイスに対するデバイス起動処理102−1〜102−3を行うようにしているので、カーネル起動処理100に要する時間を短くすることができる。
[Effect of Fifth Embodiment]
According to the present embodiment, when the computer executes the boot loader, the device startup processing 102-1 to 102-3 for the device is performed, so that the time required for the kernel startup processing 100 can be shortened.

本発明によりカーネル起動の高速化が可能となるため、即応性が必要な組み込み機器を用いたシステムに適用出来る。また、組み込み以外でも、オペレーティングシステムが存在し、起動時にカーネルによりデバイスの初期化を実施するシステム全般に適用可能である。   According to the present invention, kernel booting can be speeded up, so that the present invention can be applied to a system using an embedded device that requires quick response. In addition to installation, the present invention is applicable to all systems in which an operating system exists and a device is initialized by a kernel at the time of startup.

本発明の第1の実施の形態の構成例を示すブロック図である。It is a block diagram which shows the structural example of the 1st Embodiment of this invention. 分類情報記憶部44の内容例を示す図である。4 is a diagram illustrating an example of contents of a classification information storage unit 44. FIG. 分析結果記憶部45の内容例を示す図である。It is a figure which shows the example of the content of the analysis result memory | storage part. 最適化コード400の一例を示す図である。5 is a diagram illustrating an example of an optimization code 400. FIG. 第1の実施の形態の処理の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the process of 1st Embodiment. 区画化手段21の処理例を示すフローチャートである。4 is a flowchart showing a processing example of partitioning means 21. 区画化コード記憶部42の内容例を示す図である。It is a figure which shows the example of the content of the partitioning code memory | storage part. 情報採取モジュール11の処理例を示すフローチャートである。5 is a flowchart illustrating a processing example of an information collection module 11. 分析手段22の処理例を示すフローチャートである。3 is a flowchart showing a processing example of an analysis unit 22. 再配置手段30の処理例を示すフローチャートである。5 is a flowchart showing a processing example of a rearrangement unit 30. 第1の実施の形態におけるカーネル起動方法を説明するための図である。It is a figure for demonstrating the kernel starting method in 1st Embodiment. 区画化手段21が行う他の処理例を示すフローチャートである。It is a flowchart which shows the other process example which the partitioning means 21 performs. 分析手段22が行う他の処理例を示すフローチャートである。It is a flowchart which shows the other process example which the analysis means 22 performs. 区画化コード記憶部42の内容例を示す図である。It is a figure which shows the example of the content of the partitioning code memory | storage part. 本発明の第2の実施の形態にかかるカーネル起動方法を説明するための図である。It is a figure for demonstrating the kernel starting method concerning the 2nd Embodiment of this invention. 本発明の第3の実施の形態にかかるカーネル起動方法を説明するための図である。It is a figure for demonstrating the kernel starting method concerning the 3rd Embodiment of this invention. 本発明の第4の実施の形態にかかるカーネル起動方法を説明するための図である。It is a figure for demonstrating the kernel starting method concerning the 4th Embodiment of this invention. 本発明の第5の実施の形態にかかるカーネル起動方法を説明するための図である。It is a figure for demonstrating the kernel starting method concerning the 5th Embodiment of this invention. 従来の一般的なカーネル起動方法を説明するための図である。It is a figure for demonstrating the conventional general kernel starting method. 特許文献1に記載されている従来の技術を説明するための図である。It is a figure for demonstrating the prior art described in patent document 1. FIG.

符号の説明Explanation of symbols

1…コンピュータ
10…カーネル
11…情報採取モジュール
12…デバイスドライバ
20…区画化分析手段
21…区画化手段
22…分析手段
30…再配置手段
40…記憶装置
41…カーネルソースコード記憶部
42…区画化コード記憶部
43…起動待ち時間記憶部
44…分類情報記憶部
45…分析結果記憶部
46…最適化コード記憶部
47…オブジェクトコード記憶部
DESCRIPTION OF SYMBOLS 1 ... Computer 10 ... Kernel 11 ... Information collection module 12 ... Device driver 20 ... Partitioning analysis means 21 ... Partitioning means 22 ... Analysis means 30 ... Relocation means 40 ... Storage device 41 ... Kernel source code storage part 42 ... Partitioning Code storage unit 43 ... Start-up waiting time storage unit 44 ... Classification information storage unit 45 ... Analysis result storage unit 46 ... Optimization code storage unit 47 ... Object code storage unit

Claims (12)

複数のデバイスと、該複数のデバイス毎のデバイスドライバとを有するコンピュータにおけるカーネル起動方法であって、
前記コンピュータが、前記複数のデバイスをデバイス起動待ち時間が長いものから順に起動するデバイス起動ステップと、
前記コンピュータが、起動が完了したデバイスに対応するデバイスドライバから順に初期化するデバイスドライバ初期化ステップとを含むことを特徴とするカーネル起動方法。
A kernel booting method in a computer having a plurality of devices and a device driver for each of the plurality of devices,
A device activation step in which the computer activates the plurality of devices in descending order of device activation waiting time;
A kernel booting method comprising: a device driver initialization step in which the computer initializes in order from a device driver corresponding to a device whose booting has been completed.
複数のデバイスと、該複数のデバイス毎のデバイスドライバとを有するコンピュータにおけるカーネル起動方法であって、
前記コンピュータが前記複数のデバイスをデバイス起動待ち時間が長いものから順に起動するデバイス起動ステップと、
前記コンピュータが前記デバイス起動ステップの次に実行するステップであって、デバイスに非依存なモジュールを初期化するデバイス非依存初期化ステップと、
前記コンピュータが前記デバイス非依存初期化ステップの次に実行するステップであって、前記複数のデバイスの全てで起動が完了しているか否かを判定する起動完了判定ステップと、
前記コンピュータが前記起動完了判定ステップにおいて全てのデバイスの起動が完了したと判定した後に実行するステップであって、前記複数のデバイスドライバを初期化するデバイスドライバ初期化ステップと、
前記コンピュータが前記デバイスドライバ初期化ステップの次に実行するステップであって、デバイスに依存するモジュールを初期化するデバイス依存初期化ステップとを含むことを特徴とするカーネル起動方法。
A kernel booting method in a computer having a plurality of devices and a device driver for each of the plurality of devices,
A device activation step in which the computer activates the plurality of devices in descending order of device activation waiting time; and
A step executed by the computer after the device activation step, a device-independent initialization step for initializing a device-independent module;
A step that is executed after the device independent initialization step by the computer, and a start completion determination step for determining whether or not the start has been completed for all of the plurality of devices;
A step of executing after the computer determines that the activation of all devices has been completed in the activation completion determination step, a device driver initialization step of initializing the plurality of device drivers;
A kernel booting method comprising: a step executed by the computer after the device driver initialization step, and a device-dependent initialization step for initializing a device-dependent module.
請求項1または2記載のカーネル起動方法において、
前記デバイス起動ステップでは、前記複数のデバイスの内の、カーネル起動処理の完了直後に使用するデバイスのみを起動し、
前記デバイスドライバ初期化ステップでは、前記複数のデバイスドライバの内の、カーネル起動処理の完了直後に使用するデバイスドライバのみを初期化し、且つ、
前記コンピュータがカーネル起動処理の完了後に、前記複数のデバイスの内の、起動していないデバイスを起動し、その後、前記複数のデバイスドライバの内の、初期化していないデバイスドライバを初期化することを特徴とするカーネル起動方法。
The kernel booting method according to claim 1 or 2,
In the device activation step, only the device to be used immediately after the completion of the kernel activation process among the plurality of devices is activated,
In the device driver initialization step, among the plurality of device drivers, only a device driver to be used immediately after completion of a kernel boot process is initialized, and
The computer boots an unbooted device among the plurality of devices after the kernel boot process is completed, and then initializes an uninitialized device driver among the plurality of device drivers. A featured kernel boot method.
複数のデバイスと、該複数のデバイス毎のデバイスドライバと、複数のCPUとを有するコンピュータにおけるカーネル起動方法であって、
前記複数のCPUが、自CPUに割り当てられているデバイスをデバイス起動待ち時間が長いものから順に起動するデバイス起動ステップと、
前記複数のCPUが前記デバイス起動ステップの次に実行するステップであって、自CPUに割り当てられているモジュールの内の、デバイスに非依存なモジュールを初期化するデバイス非依存初期化ステップと、
前記複数のCPUが前記デバイス非依存初期化ステップの次に実行するステップであって、自CPUに割り当てられているデバイスの全てで起動が完了しているか否かを判定する起動完了判定ステップと、
前記複数のCPUが前記起動完了ステップにおいて自CPUに割り当てられている全てのデバイスの起動が完了したと判定した後に実行するステップであって、自CPUに割り当てられているデバイスに対応するデバイスドライバを初期化するデバイスドライバ初期化ステップと、
前記複数のCPUが前記デバイスドライバ初期化ステップの次に実行するステップであって、自CPUに割り当てられているモジュールの内の、デバイスに依存するモジュールを初期化するデバイス依存初期化ステップとを含むことを特徴とするカーネル起動方法。
A kernel booting method in a computer having a plurality of devices, a device driver for each of the plurality of devices, and a plurality of CPUs,
A device activation step in which the plurality of CPUs activate devices assigned to the CPU in order from the longest device activation waiting time;
A device-independent initialization step for initializing a module-independent module among modules assigned to the CPU, which is executed by the plurality of CPUs after the device activation step;
A step that is executed after the device-independent initialization step by the plurality of CPUs, and a startup completion determination step for determining whether or not the startup has been completed for all devices assigned to the CPU;
A step of executing the plurality of CPUs after determining that the activation of all devices allocated to the CPU in the activation completion step is completed, and a device driver corresponding to the device allocated to the CPU; A device driver initialization step to be initialized;
A step that is executed after the device driver initialization step by the plurality of CPUs, and includes a device-dependent initialization step that initializes a device-dependent module among modules assigned to the CPU. A kernel booting method characterized by the above.
複数のデバイスと、該複数のデバイス毎のデバイスドライバとを有するコンピュータにおけるカーネル起動方法であって、
前記コンピュータが、ブートローダの実行時に前記複数のデバイスをデバイス起動待ち時間が長いものから順に起動し、全てのデバイスの起動が完了した後、カーネル起動処理を開始させるデバイス起動ステップと、
前記コンピュータが前記デバイス起動ステップの次に行うステップであって、前記デバイスドライバを初期化するデバイスドライバ初期化ステップとを含むことを特徴とするカーネル起動方法。
A kernel booting method in a computer having a plurality of devices and a device driver for each of the plurality of devices,
A device booting step in which the computer boots the plurality of devices in descending order of the device boot waiting time when the boot loader is executed, and starts kernel boot processing after booting of all devices is completed;
A kernel booting method comprising: a step performed by the computer after the device booting step, and a device driver initialization step of initializing the device driver.
複数のデバイスと、該複数のデバイス毎のデバイスドライバと、カーネルソースコードが格納されたカーネルソースコード記憶部と、前記複数のデバイス毎のデバイス起動待ち時間が格納された起動待ち時間記憶部と、区画化コード記憶部と、最適化コード記憶部とを備えたコンピュータによって前記カーネルソースコードを最適化するカーネルソースコード最適化方法であって、
前記コンピュータが、前記カーネルソースコード記憶部から前記カーネルソースコードを入力し、該入力したカーネルソースコードを、デバイスに対する起動処理を行うデバイス毎の区画化コードと、デバイスドライバに対する初期化処理を行うデバイスドライバ毎の区画化コードと、他の処理を行う区画化コードとに区画化して前記区画化コード記憶部に格納する区画化分析ステップと、
前記コンピュータが、前記区画化コード記憶部から各区画化コードを入力し、該入力した区画化コードの内のデバイスに対する起動処理を行う区画化コードをデバイス起動待ち時間が長い順に配置し、その後ろに、前記複数のデバイス毎に起動が完了したか否かを判定し起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させるコードを配置し、その後ろに、前記入力した区画化コードの内のデバイスドライバに対する初期化を行う区画化コードを配置した最適化コードを生成し、該生成した最適化コードを前記最適化コード記憶部に格納する再配置ステップとを含むことを特徴とするカーネルソースコード最適化方法。
A plurality of devices, a device driver for each of the plurality of devices, a kernel source code storage unit storing a kernel source code, a startup waiting time storage unit storing a device startup waiting time for each of the plurality of devices, A kernel source code optimization method for optimizing the kernel source code by a computer including a partitioned code storage unit and an optimization code storage unit,
The computer inputs the kernel source code from the kernel source code storage unit, and the input kernel source code is a partitioning code for each device that performs startup processing on a device, and a device that performs initialization processing on a device driver A partitioning analysis step of partitioning into a partitioning code for each driver and partitioning code for performing other processing and storing the partitioning code in the partitioning code storage unit;
The computer inputs each partitioning code from the partitioning code storage unit, and arranges partitioning codes for performing startup processing on devices among the input partitioning codes in order of increasing device startup waiting time, and behind A code for determining whether or not activation is completed for each of the plurality of devices and starting initialization processing of a device driver corresponding to the device for which activation is determined to be completed, followed by the input A relocation step of generating an optimization code in which the partitioning code for initializing the device driver in the partitioning code is arranged, and storing the generated optimization code in the optimization code storage unit. Kernel source code optimization method characterized.
請求項6記載のカーネルソースコード最適化方法において、
前記区画化分析ステップでは、前記カーネルソースコード記憶部から入力したカーネルソースコードを関数呼び出し単位で区画化することにより、区画化コードを生成することを特徴とするカーネルソースコード最適化方法。
The kernel source code optimizing method according to claim 6,
In the partitioning analysis step, a kernel source code optimization method is characterized in that partitioning code is generated by partitioning kernel source code input from the kernel source code storage unit in units of function calls.
請求項6または7記載のカーネルソースコード最適化方法において、
前記コンピュータが、前記複数のデバイスそれぞれのデバイス起動待ち時間を測定し、測定したデバイス起動待ち時間を前記起動待ち時間記憶部に格納する情報採取ステップを含むことを特徴とするカーネルソースコード最適化方法。
The kernel source code optimization method according to claim 6 or 7,
A kernel source code optimization method comprising: an information collecting step in which the computer measures a device activation waiting time of each of the plurality of devices and stores the measured device activation waiting time in the activation waiting time storage unit .
複数のデバイスと、
該複数のデバイス毎のデバイスドライバと、
カーネルソースコードが格納されたカーネルソースコード記憶部と、
前記複数のデバイス毎のデバイス起動待ち時間が格納された起動待ち時間記憶部と、
区画化コード記憶部と、
最適化コード記憶部と、
前記カーネルソースコード記憶部から前記カーネルソースコードを入力し、該入力したカーネルソースコードを、デバイスに対する起動処理を行うデバイス毎の区画化コードと、デバイスドライバに対する初期化処理を行うデバイスドライバ毎の区画化コードと、他の処理を行う区画化コードとに区画化して前記区画化コード記憶部に格納する区画化分析手段と、
前記区画化コード記憶部から各区画化コードを入力し、該入力した区画化コードの内のデバイスに対する起動処理を行う区画化コードをデバイス起動待ち時間が長い順に配置し、その後ろに、前記複数のデバイス毎に起動が完了したか否かを判定し、起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させるコードを配置し、その後ろに、前記入力した区画化コードの内のデバイスドライバに対する初期化を行う区画化コードを配置した最適化コードを生成し、生成した最適化コードを前記最適化コード記憶部に格納する再配置手段とを備えたことを特徴とするカーネルソースコード最適化装置。
Multiple devices,
A device driver for each of the plurality of devices;
A kernel source code storage unit storing kernel source code;
An activation waiting time storage unit storing device activation waiting time for each of the plurality of devices;
A partitioning code storage unit;
An optimized code storage unit;
The kernel source code is input from the kernel source code storage unit, and the input kernel source code is partitioned for each device that performs startup processing for the device, and for each device driver that performs initialization processing for the device driver. Partitioning analysis means for partitioning into a partitioning code and partitioning code for performing other processing and storing in the partitioning code storage unit;
Each partitioning code is input from the partitioning code storage unit, and partitioning codes for performing startup processing on the devices among the input partitioning codes are arranged in order from the longest device startup waiting time, and behind the plurality of partitioning codes It is determined whether or not the activation is completed for each device, and a code for starting the initialization process of the device driver corresponding to the device that is determined to have completed the activation is arranged, followed by the input partitioning code And a rearrangement unit for generating an optimization code in which a partitioning code for performing initialization for a device driver is arranged, and storing the generated optimization code in the optimization code storage unit. Kernel source code optimization device.
請求項9記載のカーネルソースコード最適化装置において、
前記区画化分析手段が、前記カーネルソースコード記憶部から入力したカーネルソースコードを関数呼び出し単位で区画化することにより、区画化コードを生成することを特徴とするカーネルソースコード最適化装置。
The kernel source code optimizing device according to claim 9,
A kernel source code optimizing apparatus, wherein the partitioning analysis unit generates a partitioned code by partitioning the kernel source code input from the kernel source code storage unit in units of function calls.
請求項9または10記載のカーネルソースコード最適化装置において、
前記複数のデバイスそれぞれのデバイス起動待ち時間を測定し、測定したデバイス起動待ち時間を前記起動待ち時間記憶部に格納する情報採取手段を備えたことを特徴とするカーネルソースコード最適化装置。
The kernel source code optimizing device according to claim 9 or 10,
An apparatus for optimizing a kernel source code, comprising information collecting means for measuring device activation waiting times of each of the plurality of devices and storing the measured device activation waiting times in the activation waiting time storage unit.
複数のデバイスと、該複数のデバイス毎のデバイスドライバと、カーネルソースコードが格納されたカーネルソースコード記憶部と、前記複数のデバイス毎のデバイス起動待ち時間が格納された起動待ち時間記憶部と、区画化コード記憶部と、最適化コード記憶部とを備えたコンピュータを、
前記カーネルソースコード記憶部から前記カーネルソースコードを入力し、該入力したカーネルソースコードを、デバイスに対する起動処理を行うデバイス毎の区画化コードと、デバイスドライバに対する初期化処理を行うデバイスドライバ毎の区画化コードと、他の処理を行う区画化コードとに区画化して前記区画化コード記憶部に格納する区画化分析手段、
前記区画化コード記憶部から各区画化コードを入力し、該入力した区画化コードの内のデバイスに対する起動処理を行う区画化コードをデバイス起動待ち時間が長い順に配置し、その後ろに、前記複数のデバイス毎に起動が完了したか否かを判定し、起動が完了したと判定したデバイスに対応するデバイスドライバの初期化処理を開始させるコードを配置し、その後ろに、前記入力した区画化コードの内のデバイスドライバに対する初期化を行う区画化コードを配置した最適化コードを生成し、生成した最適化コードを前記最適化コード記憶部に格納する再配置手段として機能させるためのプログラム。
A plurality of devices, a device driver for each of the plurality of devices, a kernel source code storage unit storing a kernel source code, a startup waiting time storage unit storing a device startup waiting time for each of the plurality of devices, A computer having a partitioned code storage unit and an optimized code storage unit,
The kernel source code is input from the kernel source code storage unit, and the input kernel source code is partitioned for each device that performs startup processing for the device, and for each device driver that performs initialization processing for the device driver. Partitioning analysis means for partitioning into a partitioning code and partitioning code for performing other processing and storing in the partitioning code storage unit,
Each partitioning code is input from the partitioning code storage unit, and partitioning codes for performing startup processing on the devices among the input partitioning codes are arranged in the order of long device startup waiting time, and behind the plurality of partitioning codes It is determined whether or not the activation is completed for each device, and a code for starting the initialization process of the device driver corresponding to the device that is determined to have completed the activation is arranged, followed by the input partitioning code A program for generating an optimized code in which a partitioned code for initializing a device driver is arranged, and causing the generated optimized code to function as a relocation means for storing the optimized code in the optimized code storage unit.
JP2007061279A 2007-03-12 2007-03-12 Kernel activation method, kernel source code optimization method, kernel source code optimization apparatus and program Expired - Fee Related JP5029076B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007061279A JP5029076B2 (en) 2007-03-12 2007-03-12 Kernel activation method, kernel source code optimization method, kernel source code optimization apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007061279A JP5029076B2 (en) 2007-03-12 2007-03-12 Kernel activation method, kernel source code optimization method, kernel source code optimization apparatus and program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2011243400A Division JP5195997B2 (en) 2011-11-07 2011-11-07 Kernel source code optimization method, kernel source code optimization apparatus and program

Publications (2)

Publication Number Publication Date
JP2008225717A true JP2008225717A (en) 2008-09-25
JP5029076B2 JP5029076B2 (en) 2012-09-19

Family

ID=39844283

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007061279A Expired - Fee Related JP5029076B2 (en) 2007-03-12 2007-03-12 Kernel activation method, kernel source code optimization method, kernel source code optimization apparatus and program

Country Status (1)

Country Link
JP (1) JP5029076B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750346A (en) * 2019-10-17 2020-02-04 Oppo(重庆)智能科技有限公司 Task operation optimization method, device, terminal and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10171557A (en) * 1996-12-09 1998-06-26 Nec Gumma Ltd Information processor
JPH10283084A (en) * 1997-04-10 1998-10-23 Canon Inc Information processor, control method therefor and storage medium
JPH10307649A (en) * 1997-05-07 1998-11-17 Toshiba Corp Computer system and its initializing method
JP2005284425A (en) * 2004-03-29 2005-10-13 Kyocera Mita Corp Electronic device and image forming apparatus
JP2006109332A (en) * 2004-10-08 2006-04-20 Canon Inc Imaging apparatus, control method thereof and storage medium
JP2006338664A (en) * 2005-06-03 2006-12-14 Qnx Software Systems Gmbh & Co Kg System for performing code during operating system initialization

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10171557A (en) * 1996-12-09 1998-06-26 Nec Gumma Ltd Information processor
JPH10283084A (en) * 1997-04-10 1998-10-23 Canon Inc Information processor, control method therefor and storage medium
JPH10307649A (en) * 1997-05-07 1998-11-17 Toshiba Corp Computer system and its initializing method
JP2005284425A (en) * 2004-03-29 2005-10-13 Kyocera Mita Corp Electronic device and image forming apparatus
JP2006109332A (en) * 2004-10-08 2006-04-20 Canon Inc Imaging apparatus, control method thereof and storage medium
JP2006338664A (en) * 2005-06-03 2006-12-14 Qnx Software Systems Gmbh & Co Kg System for performing code during operating system initialization

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110750346A (en) * 2019-10-17 2020-02-04 Oppo(重庆)智能科技有限公司 Task operation optimization method, device, terminal and storage medium
CN110750346B (en) * 2019-10-17 2022-11-15 Oppo(重庆)智能科技有限公司 Task operation optimization method, device, terminal and storage medium

Also Published As

Publication number Publication date
JP5029076B2 (en) 2012-09-19

Similar Documents

Publication Publication Date Title
CN101421700B (en) Method and apparatus to support independent systems in partitions of a processing system
EP3285170B1 (en) Application profiling job management system, program, and method
JP5015665B2 (en) Method, apparatus, and computer program for sharing kernel services between kernels
US20120227040A1 (en) Hybrid Operating System
US8271707B2 (en) Method and system for PCI hybrid function
CN105814541B (en) The method of computer equipment and computer equipment internal storage starting
US20050246478A1 (en) Information processing apparatus and a method and a program of loading a device driver
JP2008033933A (en) Concurrent physical processor reallocation method, system, and program
WO2013165459A1 (en) Control flow graph operating system configuration
US20130231912A1 (en) Method, system, and scheduler for simulating multiple processors in parallel
CN109983448B (en) Information processing apparatus, device allocation method, and computer-readable storage medium
CN101364178A (en) Executing method and management method of BIOS while starting up for computer
US9990216B2 (en) Providing hypercall interface for virtual machines
US9779050B2 (en) Allocating virtual resources to root PCI bus
US20080126747A1 (en) Methods and apparatus to implement high-performance computing
US9342477B2 (en) Multi-core processor, controlling method thereof and computer system with such processor
JP5029076B2 (en) Kernel activation method, kernel source code optimization method, kernel source code optimization apparatus and program
CN104714843A (en) Method and device supporting multiple processors through multi-kernel operating system living examples
JP5195997B2 (en) Kernel source code optimization method, kernel source code optimization apparatus and program
US10810032B2 (en) System and method for dynamic guest-controlled halt polling using a CPU governor
JP5365840B2 (en) Multiprocessor system and method of operating multiprocessor system
CN110858184B (en) PCI bus device enumeration method and device
US20140380328A1 (en) Software management system and computer system
CN112965895A (en) Desktop application program automatic test method, device, equipment and storage medium
US20120284711A1 (en) Method and Arrangement for Configuring a Resource for a Virtual Runtime Environment

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20090717

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20090717

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110330

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110906

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111107

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120529

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120611

R150 Certificate of patent or registration of utility model

Ref document number: 5029076

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150706

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees