Driver generation device and driver generation program
The driver generation device and program maintain consistent path information and compile commands across host PC and container environments, facilitating seamless driver source compilation without environmental adjustments.
Patent Information
- Application Number
- JP2023071140
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-24
- Publication Date
- 2024-11-06
- Estimated Expiration
- 2043-04-24
AI Technical Summary
Compiling device drivers requires kernel source and path information, necessitating changes in the compile command when moving between host PC and container environments.
A driver generation device and program that utilize container virtualization software to maintain consistent path information and compile commands across host PC and container environments, allowing for seamless driver source compilation.
Enables driver source compilation within a container using the same commands as on the host PC, eliminating the need to adjust path environments and simplifying the build process.
Smart Images

Figure 2024156564000001_ABST
Abstract
Description
[Technical field]
[0001] An embodiment of the present invention relates to a driver generation device and a driver generation program. [Background technology]
[0002] A known technique uses container technology to prepare a container that provides an environment for compiling a driver source of a device driver, mounts the driver source in the container, and compiles the driver source in the container. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Special Publication No. 2022-540810 Summary of the Invention [Problem to be solved by the invention]
[0004] Compiling the driver source requires the kernel source and path information for the kernel source. For this reason, when building a device driver using a kernel source (for POS, MFP, etc.) on a host PC with existing technology, the kernel source must be mounted on the container along with the driver source. Here, the host PC refers to the physical computer that runs the container virtualization software. At this time, the path information for the kernel source changes between the host PC and the container. For this reason, the compile command used when compiling on the host PC must be changed on the container.
[0005] An object of the present invention is to provide a driver generating device capable of compiling a driver source in a container by using a compile command used during compilation on a computer. [Means for solving the problem]
[0006] A driver generating device according to an embodiment includes a computer having a processor and a storage device. The storage device stores a kernel source for an embedded device equipped with Linux (registered trademark), a driver source of a device driver for the embedded device, a container including a cross compiler for compiling the driver source, and container virtualization software for managing the container. The storage device stores a driver generating program that causes the processor to realize a function of referring to path information of the kernel source on the computer when the container virtualization software starts the container, a function of creating a directory in the container with the same path as the directory of the path of the kernel source on the computer based on the path information, a function of mounting the kernel source on the computer to the directory with the same path in the container, a function of mounting the driver source in the container, and a function of compiling the driver source using the same command as on the computer to generate a device driver. [Brief description of the drawings]
[0007] [Figure 1] FIG. 1 is a diagram illustrating a hardware configuration of a driver generating device according to an embodiment. [Diagram 2] FIG. 2 is a diagram illustrating a functional configuration of a driver generating device according to the embodiment. [Diagram 3] FIG. 3 is a flowchart showing a process flow of the operation of the driver generating device according to the embodiment. [Figure 4] FIG. 4 is a flowchart showing the flow of compilation processing within a container of the driver generating device according to the embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] Hereinafter, a driver generating device according to an embodiment will be described with reference to the drawings.
[0009] (Hardware configuration) First, a hardware configuration of a driver generation device 10 according to an embodiment will be described with reference to Fig. 1. Fig. 1 is a diagram showing a hardware configuration of the driver generation device 10 according to an embodiment. The driver generation device 10 is configured by a computer.
[0010] 1, the driver generation device 10 includes a processor 11, a ROM (Read Only Memory) 12, a RAM (Random Access Memory) 13, a storage 14, a display 15, a keyboard 16, and an interface (I / F) 17. In addition to these, the driver generation device 10 may include other peripheral devices.
[0011] The processor 11, ROM 12, RAM 13, storage 14, display 15, keyboard 16, and interface 17 are electrically connected to one another via a bus 18, and transmit and receive data to and from one another via the bus 18.
[0012] The processor 11 is hardware that executes programs and processes data. The processor 11 is configured, for example, with a general-purpose hardware processor including a CPU (Central Processing Unit) and a GPU (Graphical Processing Unit). The processor 11 controls the ROM 12, the RAM 13, the storage 14, the display 15, the keyboard 16, and the interface 17 as a whole.
[0013] The ROM 12 and the RAM 13 constitute a main storage device. The ROM 12 is a non-volatile memory. The RAM 13 is a volatile memory.
[0014] The ROM 12 stores a startup program required to start the driver generating device 10. The processor 11 executes the startup program in the ROM 12 to start the driver generating device 10. The ROM 12 is configured, for example, with an EPROM (Erasable Programmable Read Only Memory), and stores various settings at the time of startup in addition to the startup program.
[0015] The RAM 13 temporarily stores programs necessary for the processor 11 to perform various functions, and data necessary for executing the programs.
[0016] The storage 14 is an auxiliary storage device that non-temporarily stores data. The storage 14 is composed of a non-volatile memory such as an HDD (Hard Disk Drive) or an SSD (Solid State Drive). The storage 14 non-temporarily stores programs executed by the processor 11 and data required for executing the programs. The processor 11 loads the programs and data in the storage 14 into the RAM 13 and executes the programs to perform various functions.
[0017] The display 15 is an output device that outputs data and presents various types of information to the user.
[0018] The keyboard 16 is an input device that receives data, such as instructions to be executed by the processor 11 and data to be stored in the storage 14.
[0019] The interface 17 is connected to an external device and enables input and output of data to and from the external device. The external device may include input devices such as a mouse or a receiving device, output devices such as a transmitting device, and input / output devices such as a disk drive.
[0020] (Functional configuration) Next, the functional configuration of the driver generating device 10 will be described with reference to Fig. 2. Fig. 2 is a diagram showing a schematic diagram of the functional configuration of the driver generating device 10.
[0021] 2, the driver generation device 10 includes a host PC 20 and a software configuration 21 installed in the host PC 20. The software configuration 21 is stored in the storage 14, and is loaded into the RAM 13 when the driver generation device 10 is started up.
[0022] The software configuration 21 includes an OS 22, container virtualization software 23, a container 24, a driver generation program 27, a kernel source 28, and a driver source 29. The host PC 20 is a physical computer that executes the container virtualization software 23.
[0023] The container virtualization software 23 is a platform that realizes a container-type virtual environment. The container virtualization software 23 provides an execution environment that manages the container 24. The management of the container 24 includes starting the container 24, running an application in the container 24, and stopping and destroying the container 24.
[0024] The container 24 is formed by mounting a container image on the container virtualization software 23. The container 24 provides a platform-independent application execution environment. In the embodiment, the container 24 provides an application execution environment for compiling a driver source 29 for an embedded device equipped with Linux. The embedded device equipped with Linux is, for example, a multi-function peripheral (MFP), a barcode printer (BCP), a point of sale (POS), a POS peripheral device, etc.
[0025] The container 24 includes a cross compiler 25 and a cross library 26. The container 24 operates by using the kernel of the OS 22. For example, the container virtualization software 23 is a Docker (registered trademark) engine, and the container 24 is a Docker container.
[0026] The driver generation program 27 is a program that controls the container virtualization software 23 so as to compile the driver source 29 in the container 24 and generate a device driver for an embedded device equipped with Linux. In other words, the driver generation program 27 is a program that controls the container 24 through the container virtualization software 23.
[0027] The kernel source 28 is the source code of the kernel of an embedded device equipped with Linux. For example, the kernel source 28 is stored in the / src / kernel directory. The driver source 29 is the source code of a device driver for an embedded device equipped with Linux. The driver source 29 is stored in the current directory.
[0028] (operation) The operation of the driver generating device 10 will be described below with reference to Figures 3 and 4. The operation of the driver generating device 10 is to compile the driver source 29 using container technology and generate a device driver for an embedded device equipped with Linux. Figure 3 is a flowchart showing the process flow of the operation of the driver generating device 10. Figure 4 is a flowchart showing the flow of the compilation process in the container 24.
[0029] The operation of the driver generation device 10 is performed by the processor 11 executing the driver generation program 27 under the control of the OS 22 and by controlling the container virtualization software 23 in accordance with the driver generation program 27. From another perspective, the operation of the driver generation device 10 is performed by the driver generation program 27 controlling the container 24 through the container virtualization software 23. For convenience, the following description will be given with the driver generation program 27 and the container virtualization software 23 as the operating subjects. It is assumed that the driver generation program 27 and the container virtualization software 23 are running.
[0030] In ACT 11 , the driver generation program 27 causes the container virtualization software 23 to start the container 24 .
[0031] In ACT12, the driver generation program 27 refers to the path information of the kernel source 28 of the host PC 20, and passes the path information to the container virtualization software 23. Next, the driver generation program 27 causes the container virtualization software 23 to create, in the container 24, a directory ( / src / kernel) with the same path as the directory of the path ( / src / kernel) of the kernel source 28 on the host PC 20, based on the path information. If the directory ( / src / kernel) has already been created, the container virtualization software 23 omits this process.
[0032] In ACT13, the driver generation program 27 causes the container virtualization software 23 to mount the kernel source 28 on the host PC 20 to a directory ( / src / kernel) in the container 24. For example, when the container virtualization software 23 is a Docker engine, the driver generation program 27 causes the Docker engine to mount the kernel source 28 with the volume option of Docker, by referencing an environment variable (KERNEL_SRC) or the like used when building a device driver in the host PC 20. This allows the kernel source 28 to be shared between the host PC 20 and the container 24.
[0033] In ACT14, the driver generation program 27 causes the container virtualization software 23 to mount the driver source 29 on the host PC 20 in the container 24. For example, the driver generation program 27 causes the container virtualization software 23 to mount the driver source 29 in the current directory in the / work directory in the container 24. This causes the driver source 29 to be shared between the host PC 20 and the container 24. Therefore, processing on the driver source 29 in the container 24 is also reflected in the driver source 29 on the host PC 20.
[0034] In ACT 15 , the driver generator 27 causes the container virtualization software 23 to compile the driver source 29 within the container 24 .
[0035] The compilation process within the container 24 will now be described with reference to FIG.
[0036] In ACT 21, the container virtualization software 23 reads the path information of the kernel source 28 in the container 24. The path information of the kernel source 28 in the container 24 is the same as the path information of the kernel source 28 on the host PC 20, and both are ( / src / kernel).
[0037] In ACT22, the container virtualization software 23 causes the cross compiler 25 to compile the driver source 29 in the container 24. At this time, since the path information of the kernel source 28 in the container 24 is the same as the path information of the kernel source 28 on the host PC 20, the container virtualization software 23 can cause the cross compiler 25 to compile the driver source 29 in the container 24 using the same compile command as the compile command used at the time of compilation on the host PC 20. As a result, the device driver is built in the container 24. As a result, the device driver is generated in the / work directory in the container 24 and in the current directory on the host PC 20. With this, the compilation process in the container 24 is completed. After the device driver is generated, the container virtualization software 23 returns to the process of ACT16 outside the container 24.
[0038] In ACT 16 , the driver generation program 27 causes the container virtualization software 23 to stop and destroy the container 24 .
[0039] Through the above processing, the operation of the driver generating device 10, that is, the processing of compiling the driver source 29 using the container 24 and generating a device driver for an embedded device equipped with Linux, is completed.
[0040] (Driver generation program) As can be seen from the above explanation, the driver generation program 27 provides the host PC 20 with the following functions when the container 24 is started by the container virtualization software 23: a function to refer to path information of the kernel source 28 on the host PC 20, a function to create a directory in the container 24 with the same path as the directory of the path of the kernel source 28 on the host PC 20 based on the path information, a function to mount the kernel source 28 on the host PC 20 to the directory with the same path in the container, a function to mount the driver source 29 in the container 24, and a function to compile the driver source 29 using the same command as on the host PC 20 to generate a device driver.
[0041] From another perspective, when the container virtualization software 23 starts up the container 24, the driver generation program 27 refers to the path information of the kernel source 28 on the host PC 20, and then, based on the path information, causes the container virtualization software 23 to create a directory in the container 24 with the same path as the directory of the path of the kernel source 28 on the host PC 20, then causes the container virtualization software 23 to mount the kernel source 28 on the host PC 20 to the directory with the same path in the container 24, then causes the container virtualization software 23 to mount the driver source 29 in the container 24, and then causes the container virtualization software 23 to compile the driver source 29 using the cross compiler 25 using the same command as on the host PC 20 to generate a device driver.
[0042] (effect) As can be seen from the above description, according to the embodiment, the kernel source 28 on the host PC 20 is mounted in a directory in the container 24 with the same path as the directory of the path of the kernel source 28 on the host PC 20. Therefore, the driver source 29 can be compiled in the container 24 using a compile command used at the time of compilation on the host PC 20. In other words, the path environment variable of the kernel source 28 required when building a device driver on the host PC 20 can be used in the container 24 without being changed. Therefore, the build script for the host PC 20 can be used for compiling the driver source 29 in the container 24. This allows the user to build a device driver without being aware of the directory structure in the container 24.
[0043] Although some embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and spirit of the invention, and are included in the scope of the invention and its equivalents described in the claims. [Explanation of symbols]
[0044] 10...driver generation device, 11...processor, 12...ROM, 13...RAM, 14...storage, 15...display, 16...keyboard, 17...interface, 18...bus, 20...host PC, 21...software configuration, 23...container virtualization software, 24...container, 25...cross compiler, 26...cross library, 27...driver generation program, 28...kernel source, 29...driver source.
Claims
1. A processor; A storage device that stores a kernel source for an embedded device equipped with Linux, a driver source for a device driver for the embedded device, a container including a cross compiler that compiles the driver source, and container virtualization software that manages the container; A driver generation apparatus including a computer having: The storage device includes: A function of referencing path information of the kernel source on the computer when the container is started by the container virtualization software; a function of creating a directory in the container having the same path as a directory of the path of the kernel source on the computer based on the path information; mounting the kernel source on the computer to the directory at the same path within the container; mounting the driver source within the container; a function of compiling the driver source using the same commands as on the computer to generate the device driver; storing a driver generation program for realizing the above; Driver generation device.
2. A computer, A software configuration installed in the computer; A driver generation device having: The software configuration includes a kernel source for an embedded device equipped with Linux, a driver source for a device driver for the embedded device, a container including a cross compiler for compiling the driver source, container virtualization software for managing the container, and a driver generation program for controlling the container virtualization software; The driver generation program When the container is started by the container virtualization software, the path information of the kernel source on the computer is referenced; making the container virtualization software create a directory in the container having the same path as a directory of the path of the kernel source on the computer based on the path information; causing the container virtualization software to mount the kernel source on the computer to the directory at the same path within the container; causing the container virtualization software to mount the driver source within the container; causing the container virtualization software to cause the cross compiler to compile the driver source using the same commands as on the computer to generate the device driver; Driver generation device.
3. A processor; A storage device that stores a kernel source for an embedded device equipped with Linux, a driver source for a device driver for the embedded device, a container including a cross compiler that compiles the driver source, and container virtualization software that manages the container; A computer of a driver generation apparatus having A function of referencing path information of the kernel source on the computer when the container is started by the container virtualization software; a function of creating a directory in the container having the same path as a directory of the path of the kernel source on the computer based on the path information; A function of mounting the kernel source on the computer to a directory of the same path within the container; mounting the driver source within the container; a function of compiling the driver source using the same commands as on the computer to generate the device driver; A driver generation program that makes this possible.
4. A computer of a driver generating device having a kernel source for an embedded device equipped with Linux, a driver source for a device driver for the embedded device, a container including a cross compiler for compiling the driver source, container virtualization software for managing the container, and a driver generating program for controlling the container virtualization software, When the container is started by the container virtualization software, path information of the kernel source on the computer is referenced; making the container virtualization software create a directory in the container having the same path as a directory of the path of the kernel source on the computer based on the path information; causing the container virtualization software to mount the kernel source on the computer to the directory at the same path within the container; causing the container virtualization software to mount the driver source within the container; causing the container virtualization software to cause the cross compiler to compile the driver source using the same commands as on the computer to generate the device driver; Driver generator.
Citation Information
Patent Citations
File access system, method, and program
JP2017076264A
How to Implement a Container-Based Virtualization System
JP2022540810A
Method and system for a customized local build environment image
US20230021416A1
