CN102141915B - Equipment real-time control method based on RTLinux - Google Patents

Equipment real-time control method based on RTLinux Download PDF

Info

Publication number
CN102141915B
CN102141915B CN201010611052.4A CN201010611052A CN102141915B CN 102141915 B CN102141915 B CN 102141915B CN 201010611052 A CN201010611052 A CN 201010611052A CN 102141915 B CN102141915 B CN 102141915B
Authority
CN
China
Prior art keywords
rtlinux
real
function
equipment
time
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.)
Expired - Fee Related
Application number
CN201010611052.4A
Other languages
Chinese (zh)
Other versions
CN102141915A (en
Inventor
潘小群
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.)
SEVENTH ACADEMY OF CHINA SHIPBUILDING INDUSTRY CORP
Original Assignee
SEVENTH ACADEMY OF CHINA SHIPBUILDING INDUSTRY 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 SEVENTH ACADEMY OF CHINA SHIPBUILDING INDUSTRY CORP filed Critical SEVENTH ACADEMY OF CHINA SHIPBUILDING INDUSTRY CORP
Priority to CN201010611052.4A priority Critical patent/CN102141915B/en
Publication of CN102141915A publication Critical patent/CN102141915A/en
Application granted granted Critical
Publication of CN102141915B publication Critical patent/CN102141915B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides an equipment real-time control method based on RTLinux, which comprises the following step of extending the RTLinux by utilizing a real-time operating system of an RTLinux real-time kernel loaded on a standard RTLinux system after cut-down to improve the support to required control equipment and realizing the interrupt sharing of the RTLinux. With the adoption of the method, the original characteristics of the RTLinux are not changed, all functions of the original RTLinux are supported, the compatibility is good, and the extension development of the RTLinux and the equipment control application under a Linux system can be carried out.

Description

A kind of equipment real-time control method based on RTLinux
Technical field
The present invention relates to a kind of equipment real-time control method based on real time operating system RTLinux, a computer system software technology that relates to real time operating system, device drives, the solution that provides a set of equipment including real time environment, device drives and interface api function storehouse to control in real time.
Background technology
The application of real time computer control technology based on real time operating system in Industry Control, communication and large server is increasingly extensive.Traditional general-purpose system is due to the timesharing of operating system, mainly that long interruption reaction time and task switched the reaction time, real-time control to equipment such as PCI equipment, USB device, the network equipments cannot be provided, therefore cannot meet the requirement of these equipment to the real-time task such as high efficient data capture, sequential control.
In numerous real time operating systems, linux system possesses following advantage: open property is good, can Free Acquisition in source code, and revise arbitrarily; Can support kinds of platform, transplantability is good; System kernel can be reduced as required; The feature richness of supporting; Safety and reliability is high.Adopt the Linux after reducing under the system of assurance meets the prerequisite of required function, to guarantee minimizing of volume, can save to greatest extent storage space to special embedded device.But the linux system of standard is because real-time performance is not good, conventionally adopt in system, to load RTLinux real-time kernel and realize the support when strong.
The hard real time operating system that RTLinux and (SuSE) Linux OS coexist can create the real-time process that meets POSIX.1b standard of accurate operation.RTLinux has realized the Real-Time Scheduling core that can try to be the first efficiently, and comprehensively take over and interrupt, and the minimum process operation of a priority using standard Linux as this real-time kernel.RTLinux and standard Linux form a complete entirety, and real-time kernel has been guaranteed the hard real-time of mission critical, can complete and both comprise real-time and non real-time complex task.But RTLinux operating system exists interrupts sharing, and can not support the operation of multiple same categories of device simultaneously, kernel thread cannot relevant device interruption etc. problem.Meanwhile, RTLinux, as real-time system kernel, lacks the support to hardware device.
Summary of the invention
The deficiency existing for above-mentioned prior art, the present invention proposes a kind of equipment real-time control method based on RTLinux, utilize the real time operating system that loads RTLinux real-time kernel after reduction in standard Linux system, RTLinux is expanded, increase the support of RTLinux to required opertaing device, realize RTLinux and interrupt sharing, mainly comprise the following steps:
(1) in RTLinux source code, write support equipment interface function, comprise interfacing equipment file type, file operation interface function, method function, the function of registering and cancelling, and generate corresponding interface module;
(2) in the interruption registration function of RTLinux, increase the interruption registration to equipment, rewrite the rtl_core.c file in RTLinux, in the situation that keeping the original processing mode of RTLinux constant, increase the interruption support of the equipment to PLX PCI9000;
(3) the device drives interface file_operations of the standard Linux driver to PLX PCI9000 family chip adopts the kernel function of RTLinux to carry out real time implementation, and spin lock real time implementation, in PLX PCI9000 standard Linux driver, use the rtl_wait_t handling interrupt of RTLinux to wait for, use the posix thread response PLX PCI9000 device interrupt of RTLinux;
(4) adopt the kernel function of RTLinux to be encapsulated as kernel module in the api function storehouse of PLX PCI9000 standard Linux, the physical memory mapping function of PLX PCI9000 equipment is rewritten as to the form consistent with RTLinux kernel function, increases the mutex of posix.
The equipment real-time control method based on RTLinux that the present invention proposes, that a kind of equipment that possesses hard real-time is controlled solution in real time, comprise that real time operating system environment, real-time device drive and control in real time api function, solve under standard RTLinux and cannot realize the shared problem of interrupting, can realize the real-time control to multiple same categories of device simultaneously, through actual verification, identical device is brought up to Microsecond grade than non real-time control interrupt response time by Millisecond under controlling in real time, and real-time performance is good; In addition, method of the present invention does not change the primary characteristic of RTLInux, supports the repertoire of original RTLinux, compatible good, can carry out the regarded as output controlling of equipment control application under RTLinux and linux system.
Embodiment
The present invention adopts the real time operating system that loads RTLinux real-time kernel after reduction in standard Linux system.RTLinux is expanded, increase RTLinux to required opertaing device, as the support of PCI equipment, USB device, the network equipment, realize RTLinux and interrupt sharing, guarantee that multiple same categories of device can move in real-time kernel simultaneously.On the original standard Linux driver of equipment architecture basics, keep driver framework structure and drive interface, use RTLinux real-time kernel function by its real time implementation.The real-time application api interface function of device drives is provided, by the real time implementation of device drives interface api function, solves the problem incompatible with RTLinux that drive.Solve the problem that kernel thread cannot respond interruption, in RTLinux thread, realize and interrupt processing.Finally, need to solve Real Time Drive and former API built-in function incompatibility problem, and the system function using in API built-in function is rewritten by kernel function, form real time implementation by api function storehouse with RTLinux kernel module, built-in function as real-time kernel module loading, is called by real-time task after driver module loads.Specifically real-time RTLinux system is expanded, realize interrupt shared mechanism, and in the Posix of RTLinux thread handling interrupt; In RTLinux, add the support to equipment.Increase equipment interface function, comprise interfacing equipment file type, file operation interface function, method function, the function of registering and cancelling, and generate corresponding interface module; Interrupt registration function at RTLinux and increase the real-time processing to device drives.The hard interruption of RTLinux, same interrupt number can only be registered an equipment, and the equipment that cannot be driven by multiple use RTLinux is shared.To interrupt shared mechanism in order realizing in RTLinux, to rewrite the rtl_core.c file in RTLinux.For with the original function compatibility of RTLinux, keeping original processing mode constant in the situation that, increased the interruption support to new equipment (XJS_device).Use the corresponding interruption registration of such new equipment institute, response and process function, same interrupt number and multiple XJS_device can be shared; Rewrite by the RTLinux real time implementation of carrying out real time implementation and device drives interface file_operations of driver being interrupted to processing section, and spin lock real time implementation, has realized the real time implementation that drives source code under the standard Linux of device drives.Owing to cannot responding interruption in kernel thread, for response apparatus in real-time task interrupts, in driving, use the rtl_wait_t handling interrupt of RTLinux to wait for, realize real-time task and use the posix thread response apparatus of RTLinux to interrupt.API is rewritten as to kernel module function, physical memory mapping function is rewritten as to the form consistent with real-time kernel, increase the mutex of posix, real-time control function is converted to kernel function, thus the kernelised of finishing equipment api function and real time implementation.The loading in last programming apparatus Real Time Drive, API kernel function storehouse and deletion script can add and remove real-time device easily in system equipment path/dev.
To the real-time control task of equipment, can be after hardware system loading equipment, start the RTLinux real-time kernel after expansion, and start-up loading device path script, be written into the real-time function library kernel module of real-time device driver module and API, different real-time tasks can be called real-time API built-in function according to mission requirements and carry out the real-time control to equipment simultaneously.
RTLinux after the present invention's expansion does not change the primary characteristic of RTLInux, supports the repertoire of original RTLinux completely.Equipment Real Time Drive, Real Time Drive API storehouse will enter system with real-time kernel module loading after RTLinux starts.The real-time control section of equipment also moves real-time kernel module in system; and the un-real time jobs such as equipment control application may operate in Linux user's space; the various resources (network, file system etc.) that use system easily provides; and be subject to the protection of system, increase the security of system.
To provide PLX PCI9000 family chip as the PCI equipment of the interface controller real-time control solution under RTLinux, further illustrate technology contents of the present invention below.
In RTLinux source code, write the equipment interface function of supporting PLX PCI9000 interface chip, comprise interfacing equipment file type, file operation interface function, method function, the function of registering and cancelling, and generate corresponding interface module.Interrupt registration function at RTLinux and increase the real-time processing that PCI9000 is driven.To interrupt shared mechanism in order realizing in RTLinux, to rewrite the rtl_core.c file in RTLinux.In the situation that keeping original processing mode constant, increase the interruption support to a class new equipment (XJS_device).Use the corresponding interruption registration of such new equipment institute, response and process function, same interrupt number and multiple XJS_device can be shared.Improve in standard Linux driver and api function storehouse to PLX PCI9000 family chip, can in the RTLinux kernel after expansion, move.To the RTLinux real time implementation of driver device drives interface file_operations, and spin lock real time implementation, realize the real time implementation of PLX PCI9000 series interfaces chip standard Linux driving source code.Owing to cannot responding interruption in kernel thread, for response apparatus in real-time task interrupts, in driving, use the rtl_wait_t handling interrupt of RTLinux to wait for, realize real-time task and use the posix thread response apparatus of RTLinux to interrupt.Api function storehouse is encapsulated as to kernel module function, PCI9000 physical memory mapping function is rewritten as to the form consistent with real-time kernel, the mutex that increases posix, is converted to kernel function by real-time control function, thereby completes kernelised and the real time implementation of PCI9000 api function.Specific as follows:
First, need to expand real-time RTLinux system, increase support to PLX PCI9000, realize and interrupt shared mechanism, and can be in the Posix of RTLinux thread handling interrupt
The original device file interface of RTLinux cannot be supported PLX pci interface chip, in RTLinux source code, write the equipment interface function of supporting PLX pci interface chip, comprise interfacing equipment file type, file operation interface function, method function, the function of registering and cancelling, and generate corresponding interface module.
In the interruption registration function of RTLinux, increase the interruption registration of the equipment to PLX PCI9000, rewrite the rtl_core.c file in RTLinux, in the situation that keeping the original processing mode of RTLinux constant, increase the interruption support of the equipment to PLX PCI9000.Interrupt registration function at RTLinux and increase the real-time processing that PLX is driven.The hard interruption of RTLinux, same interrupt number can only be registered an equipment, and the equipment that cannot be driven by multiple use RTLinux is shared.To interrupt shared mechanism in order realizing in RTLinux, to rewrite the rtl_core.c file in RTLinux.For with the original function compatibility of RTLinux, keeping original processing mode constant in the situation that, increased the interruption support to a class new equipment (XJS_device).Use the corresponding interruption registration of such new equipment institute, response and process function, same interrupt number and multiple XJS_device can be shared.
Adopt the kernel function of RTLinux to carry out real time implementation to the device drives interface file_operations of standard Linux driver, and spin lock real time implementation, in standard Linux driver, use the rtl_wait_t handling interrupt of RTLinux to wait for, use the posix thread response PLX PCI9000 device interrupt of RTLinux.Rewrite by the RTLinux real time implementation of carrying out real time implementation and device drives interface file_operations of driver being interrupted to processing section, and spin lock real time implementation, realize the real time implementation of PLX PCI9000 series interfaces chip standard Linux driving source code.Owing to cannot responding interruption in kernel thread, for response apparatus in real-time task interrupts, in driving, use the rtl_Wait_t handling interrupt of RTLinux to wait for, realize real-time task and use the posix thread response apparatus of RTLinux to interrupt.
Adopt the kernel function of RTLinux to be encapsulated as kernel module in the api function storehouse of standard Linux, the physical memory mapping function of PLX PCI900 equipment is rewritten as to the form consistent with RTLinux kernel function, increase the mutex of posix.API is rewritten as to kernel module function, PLX physical memory mapping function is rewritten as to the form consistent with real-time kernel, increase the mutex of posix, real-time control function is converted to kernel function, thereby completes kernelised and the real time implementation of PCI9000API function.
Finally, write PLX real-time device and load and delete script, can in system equipment path/dev, add easily and remove PLX real-time device.
To the real-time control task of the different PCI equipment based on PLX PCI9000 series, can be after hardware system loading equipment, start the RTLinux real-time kernel after expansion, and start-up loading device path script, be written into the real-time function library kernel module of PLX real-time device driver module and API, different real-time tasks can be called the real-time built-in function of API according to mission requirements and carry out the real-time control to equipment simultaneously.
The present invention has proposed the real-time control solution of PLX PCI9000 Series PC I interfacing equipment under a set of completely complete real-time Linux on the standard Linux driving of open source code and the basis of RTLinux real-time system, comprise that real time operating system environment, real-time device drive and control in real time api function, and solved cannot realize under RTLinux and interrupt shared problem, under this scheme, can realize multiple same categories of device real-time workings simultaneously.Versatility of the present invention is good, and the various functions of PLX PCI9000 family chip are had to tenability completely, and real-time performance is good, and identical device doubles than non real-time control interrupt response time under controlling in real time.The present invention loads on PCI using standard Linux as platform and the CPCI computing machine real-time solution as equipment, also can be used as the real-time control system of the embedded device based on PLX PCI9000 chip.

Claims (1)

1. the equipment real-time control method based on RTLinux, mainly comprises the following steps:
(1) in RTLinux source code, write support equipment interface function, comprise interfacing equipment file type, file operation interface function, method function, the function of registering and cancelling, and generate corresponding interface module;
(2) in the interruption registration function of RTLinux, increase the interruption registration to equipment, rewrite the rtl_core.c file in RTLinux, in the situation that keeping the original processing mode of RTLinux constant, increase the interruption support of the equipment to PLX PCI9000;
(3) the device drives interface file_operations of the standard Linux driver to PLX PCI9000 family chip adopts the kernel function of RTLinux to carry out real time implementation, and spin lock real time implementation, in PLXPCI9000 standard Linux driver, use the rtl_wait_t handling interrupt of RTLinux to wait for, use the posix thread response PLX PCI9000 device interrupt of RTLinux;
(4) adopt the kernel function of RTLinux to be encapsulated as kernel module in the api function storehouse of PLX PCI9000 standard Linux, the physical memory mapping function of PLX PCI9000 equipment is rewritten as to the form consistent with RTLinux kernel function, increases the mutex of posix.
CN201010611052.4A 2010-12-29 2010-12-29 Equipment real-time control method based on RTLinux Expired - Fee Related CN102141915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010611052.4A CN102141915B (en) 2010-12-29 2010-12-29 Equipment real-time control method based on RTLinux

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010611052.4A CN102141915B (en) 2010-12-29 2010-12-29 Equipment real-time control method based on RTLinux

Publications (2)

Publication Number Publication Date
CN102141915A CN102141915A (en) 2011-08-03
CN102141915B true CN102141915B (en) 2014-05-14

Family

ID=44409457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010611052.4A Expired - Fee Related CN102141915B (en) 2010-12-29 2010-12-29 Equipment real-time control method based on RTLinux

Country Status (1)

Country Link
CN (1) CN102141915B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766263B (en) * 2017-10-12 2020-11-06 硅谷数模半导体(北京)有限公司 Control method and device of interface chip, storage medium and processor
CN110825501A (en) * 2018-08-07 2020-02-21 龙芯中科技术有限公司 Processor core optimization method and device and storage medium
CN109445959A (en) * 2018-10-17 2019-03-08 北京技德终端技术有限公司 A kind of sensing data processing real time operating system
CN110209483A (en) * 2019-05-28 2019-09-06 福州瑞芯微电子股份有限公司 Machine control system of sweeping the floor and control method, storage medium and controlling terminal

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609797A (en) * 2004-11-22 2005-04-27 浙江大学 Method for avoiding RTL inux double-kernel
CN101894045A (en) * 2010-06-18 2010-11-24 阳坚 Real-time Linux operating system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7191445B2 (en) * 2001-08-31 2007-03-13 Texas Instruments Incorporated Method using embedded real-time analysis components with corresponding real-time operating system software objects

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609797A (en) * 2004-11-22 2005-04-27 浙江大学 Method for avoiding RTL inux double-kernel
CN101894045A (en) * 2010-06-18 2010-11-24 阳坚 Real-time Linux operating system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于RTLinux系统的设备驱动程序开发与应用;陈建春 等;《微型机与应用》;20020930(第9期);15-16,60 *
陈建春 等.基于RTLinux系统的设备驱动程序开发与应用.《微型机与应用》.2002,(第9期),15-16,60.

Also Published As

Publication number Publication date
CN102141915A (en) 2011-08-03

Similar Documents

Publication Publication Date Title
US10120736B2 (en) Executing a kernel device driver as a user space process
RU2406113C2 (en) Systems and methods for dual-mode virtualisation of real and idealised hardware devices
CN102231138B (en) Accurate memory data acquisition system and method for computer
CN105204913A (en) Method and system for running Linux application on Android operating system and system
US9164784B2 (en) Signalizing an external event using a dedicated virtual central processing unit
US20160239321A1 (en) Supporting multiple operating system environments in computing device without contents conversion
CN101655798A (en) Method for deployment and operation of application in computer and virtual machine environments
CN113672342B (en) Embedded virtualization system, construction and test methods, terminal and medium
US10223094B2 (en) Initializing a system on a chip
CN101819539B (en) Interrupt nesting method for transplanting muCOS-II to ARM7
CN105242962A (en) Quick lightweight thread triggering method based on heterogeneous many-core
CN102141915B (en) Equipment real-time control method based on RTLinux
US10394571B2 (en) Passing data from a host-based utility to a service processor
EP3701373B1 (en) Virtualization operations for directly assigned devices
US20220414052A1 (en) Multi-Core Processor, Multi-Core Processor Processing Method, and Related Device
KR101249735B1 (en) Device and method for executing Android applications on general purpose operating systems, and computer readable recording medium for the same
KR101993917B1 (en) Optimization of resource usage in a multi-environment computing system
WO2018103372A1 (en) Driver management method and host machine
CN105094870A (en) Compatible method of 64-bit Linux operating system for 32-bit application software
CN101840391B (en) Electronic payment system dual-processor sub-system communication method and calling method thereof
CN102508715B (en) Object calling method and device based on multiple threads
US9448782B1 (en) Reducing a size of an application package
CN114860393A (en) Cross-platform virtual machine migration method, device and equipment
CN100492299C (en) Embedded software developing method and system
KR20100135874A (en) Operating system fast run command

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140514