CN108958817A - Bus driver method, apparatus and storage medium - Google Patents

Bus driver method, apparatus and storage medium Download PDF

Info

Publication number
CN108958817A
CN108958817A CN201810687420.XA CN201810687420A CN108958817A CN 108958817 A CN108958817 A CN 108958817A CN 201810687420 A CN201810687420 A CN 201810687420A CN 108958817 A CN108958817 A CN 108958817A
Authority
CN
China
Prior art keywords
bus
operating system
working
backup
initial
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.)
Pending
Application number
CN201810687420.XA
Other languages
Chinese (zh)
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.)
Beijing Institute of Radio Measurement
Original Assignee
Beijing Institute of Radio Measurement
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 Beijing Institute of Radio Measurement filed Critical Beijing Institute of Radio Measurement
Priority to CN201810687420.XA priority Critical patent/CN108958817A/en
Publication of CN108958817A publication Critical patent/CN108958817A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/12Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
    • G06F13/124Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine

Abstract

The invention discloses a kind of bus driver method, apparatus and storage mediums, are applied to embedded OS, comprising: load bus configures when setting operating system is initial;The controller and register address of bus are set, to support operating system access;Bus down trigger mode is set;Operating system is set and registers bus and bus resource in kernel;The read-write capability of bus is set.In addition, method further includes the working method according to bus, the mailing address of bus, the initial parameter of bus control unit are set;Bus monitor is set, and to measure the running parameter of bus communication, whether monitoring bus is working properly;At least one backup bus is set, and when working bus breaks down, backup bus takes over working bus in a manner of warm back-up or cold standby.Compared with the prior art, technical solution provided by the invention, can be general in all kinds of hardware and software platforms, and extends the function of bus application, improves the reliability of bus.

Description

Bus driver method, apparatus and storage medium
Technical field
The present invention relates to computer bus drive areas.More particularly, to a kind of embedded system bus drive area Method.
Background technique
Embedded system is just widely used with the development of Internet in every field, as outstanding behaviour Make system code, the real time operating systems such as VxWorks, QNX, RTEMS realize real-time more better than other operating systems, have Effect property, commerciality, tailorability and interoperability, be widely used in the high-quality precision and sophisticated technologies such as communication, military affairs, Aeronautics and Astronautics and In the high field of requirement of real-time, such as satellite communication, military exercises, trajectory guidance, aircraft navigation.
Fieldbus is one of the hot spot of nowadays automatic field technology development, is known as the computer bureau of automatic field Domain net.Its appearance realizes that real-time, reliable data communication provides strong between each node for dcs Technical support.Especially in embedded system application field, fieldbus is even more to be widely used.Due to the class of bus Type is various, such as common are CAN bus, 1553B bus, ARNIC429 bus and foundation bus etc., embedded operation system System needs the exploitation that different buses is driven and applied respectively, does not have versatility, exists again in the process of development big The repeated work of amount.
In consideration of it, the purpose of the present invention is to provide a kind of bus driver method, apparatus and storage mediums, using general Implementation technology, so that driving method can be general in all kinds of hardware and software platforms, and the function of expansion bus application.
Summary of the invention
In order to solve the above-mentioned technical problem, the purpose of the present invention is to provide a kind of bus driver method, apparatus and storages Medium, to alleviate problem of the existing technology.
In a first aspect, being applied to embedded OS the present invention provides a kind of bus driver method, comprising: setting Load bus configures when operating system is initial;The controller and register address of bus are set, to support operating system access;If Set bus down trigger mode;Operating system is set and registers bus and bus resource in kernel;The read-write capability of bus is set.
Optionally, according to the working method of bus, the mailing address of bus, the initial parameter of bus control unit are set.
Optionally, bus monitor is set, and to measure the running parameter of bus communication, whether monitoring bus is working properly.
Optionally, at least one backup bus is set, and when working bus failure, backup bus is with warm back-up or cold The mode of backup takes over working bus.
Second aspect, the present invention provides a kind of bus driver devices, are applied to embedded OS, comprising: operation System configuration module, load bus configures when setting operating system is initial, and setting operating system nucleus registers bus and bus money Source;The controller and register address of bus is arranged in bus configuration module, and to support operating system access, setting bus is interrupted The read-write capability of bus is arranged in triggering mode.
Optionally further comprising: bus runs module and mailing address, the bus of bus is arranged according to the working method of bus The initial parameter of controller.
Optionally further comprising: bus monitor is arranged in bus monitor module, to measure the running parameter of bus communication, Monitor whether bus is working properly.
Optionally further comprising: at least one backup bus is arranged in bus backup module, when working bus breaks down, Backup bus takes over working bus in a manner of warm back-up or cold standby.
The third aspect, the present invention provides a kind of bus driver devices, are applied to embedded OS, comprising: processing Device;Memory for storage processor executable instruction;Wherein, processor is configured as: setting operating system adds when initial Carry bus configuration;The controller and register address of bus are set, to support operating system access;Bus down trigger side is set Formula;Operating system nucleus is set and registers bus and bus resource;The read-write capability of bus is set.
Fourth aspect, the present invention provides a kind of computer readable storage mediums, are stored thereon with computer program instructions, It is characterized in that, realizing bus driver method and step provided by first aspect when the program instruction is executed by processor.
Beneficial effects of the present invention are as follows:
Technical solution provided by the invention can include the following benefits: load bus is matched when setting operating system is initial It sets;The controller and register address of bus are set, to support operating system access;Bus down trigger mode is set;Setting Operating system nucleus registers bus and bus resource;The read-write capability of bus is set.In this way, bus driver side provided by the invention Method, can be general in all kinds of hardware and software platforms, and extends the function of bus application, improves the reliability of bus.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below Attached drawing is one embodiment of the present invention, for those of ordinary skill in the art, before not making the creative labor It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of bus driver method flow diagram of first embodiment of the invention;
Fig. 2 is a kind of structural schematic diagram of bus driver device of second embodiment of the invention;
Fig. 3 is a kind of structural schematic diagram of bus driver device of third embodiment of the invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Technical solution be clearly and completely described, described embodiments are some of the embodiments of the present invention, rather than whole Embodiment.
Embodiment one:
Fig. 1 is a kind of bus driver method flow diagram of first embodiment of the invention, as shown in Figure 1, this method includes such as Lower four steps.
Step S101: operating system configuration is carried out.Specifically, load bus configures when setting operating system is initial, setting Operating system registers bus and bus resource in kernel.
In an alternative embodiment, operating system uses VxWorks, it is necessary first to the config.h text in BSP Part is configured, and BSP is mainly the initialization of CPU, is provided bottom hardware for entire software systems and is supported.Such as with CAN bus For, need to increase macrodefinition DRV_CANBUS_USER.Furthermore, it is necessary to the resource that CAN bus needs to use is set, such as when Clock, traffic rate etc. register these resources in VxWorks kernel, could drive hardware by operating system.
Step S102: bus configuration is carried out.Specifically, the controller and register address of bus are set, to support to operate System access;Bus down trigger mode is set;The read-write capability of bus is set.
In an alternative embodiment, operating system uses VxWorks, and bus uses CAN bus, grasps in Vxworks Make the address that CAN bus is set in system, just the address of accessible operation note, otherwise operation note centainly will cause The collapse of Vxworks operating system.The numerical value of gicTrigger is determined in operating system file hwconf.c, is defined in array The triggering mode of the interruption of CAN, is typically chosen level triggers.The characteristics of according to bus, formulates bus read-write program, total to support The application of line.
Step S103: setting bus initialization parameter.Specifically, according to the working method of bus, the logical of bus is set Believe the initial parameter of address, bus control unit.
In an alternative embodiment, the address of CAN bus is divided into 11 and 29 both of which, needs before communicating It is configured, just can be carried out bus communication work.
In another alternative embodiment, 1553B bus is principal and subordinate's control bus, and needing to configure bus before communicating is BC (Bus Controller bus marco end) or RT (Remote terminal far sets end);It can only be deposited in communication system In a BC, may exist multiple RT, the address of specified RT is also needed if it is RT.
Step S104: setting bus monitor.Specifically, bus monitor is set, to measure the work ginseng of bus communication Whether number, monitoring bus are working properly.
In an alternative embodiment, the settable BM of 1553B bus (Bus Monitor), to monitor in 1553B bus Each communication link whether normal communication, and monitoring parameters such as traffic load.
Step S105: setting bus backup method.Specifically, at least one backup bus is set, when working bus occurs When failure, backup bus takes over working bus in a manner of warm back-up or cold standby.
In an alternative embodiment, the warm back-up bus of 1553B bus inherently dual redundant includes A and B two Bus.When bus A, which is communicated, to break down, bus marco chip can automatically switch to B bus and be communicated.
In another alternative embodiment, two CAN bus are set in bus communication, and are set as cold standby mould Formula switches to backup bus when working bus breaks down.
Embodiment two:
The embodiment of the invention provides a kind of bus driver device, it is above-mentioned which is mainly used for the execution embodiment of the present invention Bus driver method provided by content does specific introduction to bus driver device provided in an embodiment of the present invention below.
Fig. 2 is a kind of structural schematic diagram of bus driver device of second embodiment of the invention.As shown in Fig. 2, the bus Driving device 200 comprises the following modules.
Operating system configuration module 201, load bus configures when setting operating system is initial, and setting operating system nucleus is infused Volume bus and bus resource.
The controller and register address of bus is arranged in bus configuration module 202, to support operating system access, setting Bus down trigger mode, is arranged the read-write capability of bus.
Optionally include: bus runs module 203 and mailing address, the bus of bus is arranged according to the working method of bus The initial parameter of controller.
Optionally include: bus monitor is arranged in bus monitor module 204, to measure the running parameter of bus communication, Monitor whether bus is working properly.
Optionally include: at least one backup bus is arranged in bus backup module 205, when working bus breaks down, Backup bus takes over working bus in a manner of warm back-up or cold standby.
Embodiment three:
The embodiment of the invention also provides a kind of bus driver devices.As shown in figure 3, the bus driver device of the embodiment 300 include: processor 301, memory 302, bus 303, and stores in the memory 302 and can transport on processor 301 Capable computer program, such as the program are used to work in driving bus 303.Processor 301 is realized when executing computer program Step in above-mentioned each bus driver embodiment of the method, for example, step S101, S102, S103, S104 shown in FIG. 1 and S105.Alternatively, processor 301 realizes the function of each module in above-mentioned each Installation practice, such as Fig. 2 when executing computer program In module with drive bus 303 work.
Illustratively, the computer program can be divided into one or more modules, one or more of moulds Block is stored in the memory 302, and is executed by 301 devices of the processing, to complete the present invention.One or more of moulds Block can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing the computer journey Implementation procedure of the sequence in the bus driver device.For example, the computer program can be divided into operating system configuration Module and bus configuration module, each module concrete function are as follows: operating system configuration module, and setting operating system loads when initial Bus configuration, setting operating system nucleus register bus and bus resource;Bus configuration module is arranged the controller of bus and posts Storage address is arranged bus down trigger mode, the read-write capability of bus is arranged to support operating system access.
The bus driver device can be SCM system, desktop PC, notebook, palm PC and cloud clothes Business device etc. calculates equipment.The bus driver device may include, but be not limited only to, processor, memory.Those skilled in the art It is appreciated that the schematic diagram is only the example of bus driver device, the restriction to bus driver device is not constituted, it can be with Including than illustrating more or fewer components, perhaps combining certain components or different components, such as bus driver dress Setting can also include input-output equipment, bus etc..
Alleged processor can be micro-control unit (Microcontroller Unit, MCU), central processing unit (Central Processing Unit, CPU), can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at Reason device is also possible to any conventional processor etc., and the processor is the control centre of the bus driver device, using each The various pieces of kind interface and the entire bus driver device of connection.
The memory can be used for storing the computer program and/or module, and the processor is by operation or executes Computer program in the memory and/or module are stored, and calls the data being stored in memory, described in realization The various functions of bus driver device.The memory can mainly include storing program area and storage data area, wherein storage journey It sequence area can application program needed for storage program area, at least one function (such as sound-playing function, image player function Deng) etc.;Storage data area, which can be stored, uses created data (such as audio data, phone directory etc.) etc. according to mobile phone.This Outside, memory may include high-speed random access memory, can also include nonvolatile memory, such as hard disk, memory, insert Connect formula hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash memory Block (Flash Card), at least one disk memory, flush memory device or other volatile solid-state parts.
Example IV:
If the integrated module of bus driver device is realized in the form of SFU software functional unit and as independent product pin It sells or in use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned All or part of the process in embodiment method can also instruct relevant hardware to complete by computer program, described Computer program can be stored in a computer readable storage medium, which, can be real when being executed by processor The step of existing above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, the computer journey Sequence code can be source code form, object identification code form, executable file or certain intermediate forms etc..It is described computer-readable Medium may include: any entity or device, recording medium, USB flash disk, mobile hard that can carry the computer program code Disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs to illustrate It is that the content that the computer-readable medium includes can be fitted according to the requirement made laws in jurisdiction with patent practice When increase and decrease, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier wave letter Number and telecommunication signal.
Finally, it should be noted that embodiment described above, only a specific embodiment of the invention, to illustrate the present invention Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, those skilled in the art should understand that: anyone skilled in the art In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. a kind of bus driver method is applied to embedded OS characterized by comprising
Be arranged the operating system it is initial when load the bus configuration;
The controller and register address of the bus are set, to support the operating system access;
The bus down trigger mode is set;
The operating system is set and registers the bus and bus resource in kernel;
The read-write capability of the bus is set.
2. the method according to claim 1, wherein further include:
According to the working method of the bus, the mailing address of the bus, the initial parameter of bus control unit are set.
3. the method according to claim 1, wherein further include:
Bus monitor is set and monitors whether the bus is working properly to measure the running parameter of the bus communication.
4. the method according to claim 1, wherein further include:
At least one backup bus is set, and when working bus failure, the backup bus is with warm back-up or cold standby Mode takes over the working bus.
5. a kind of bus driver device is applied to embedded OS characterized by comprising
Operating system configuration module, be arranged the operating system it is initial when load the bus configuration, the operating system is set Kernel registers the bus and bus resource;
The controller and register address of the bus is arranged in bus configuration module, to support the operating system access, setting The bus down trigger mode, is arranged the read-write capability of the bus.
6. device according to claim 5, which is characterized in that further include:
Bus runs module, according to the working method of the bus, be arranged the mailing address of the bus, bus control unit just Beginning parameter.
7. device according to claim 5, which is characterized in that further include:
Bus monitor module is arranged bus monitor to measure the running parameter of the bus communication and monitors that the bus is It is no working properly.
8. device according to claim 5, which is characterized in that further include:
At least one backup bus is arranged in bus backup module, and when working bus breaks down, the backup bus is with hot standby The mode of part or cold standby takes over the working bus.
9. a kind of bus driver device is applied to embedded OS characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to: be arranged the operating system it is initial when load the bus configuration;It is arranged described total The controller and register address of line, to support the operating system access;The bus down trigger mode is set;Setting institute It states operating system nucleus and registers the bus and bus resource;The read-write capability of the bus is set.
10. a kind of computer readable storage medium, is stored thereon with computer program instructions, which is characterized in that the program instruction The step of any one of Claims 1 to 4 the method is realized when being executed by processor.
CN201810687420.XA 2018-06-28 2018-06-28 Bus driver method, apparatus and storage medium Pending CN108958817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810687420.XA CN108958817A (en) 2018-06-28 2018-06-28 Bus driver method, apparatus and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810687420.XA CN108958817A (en) 2018-06-28 2018-06-28 Bus driver method, apparatus and storage medium

Publications (1)

Publication Number Publication Date
CN108958817A true CN108958817A (en) 2018-12-07

Family

ID=64487548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810687420.XA Pending CN108958817A (en) 2018-06-28 2018-06-28 Bus driver method, apparatus and storage medium

Country Status (1)

Country Link
CN (1) CN108958817A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860321A (en) * 2022-04-06 2022-08-05 网易(杭州)网络有限公司 External device control method, device, equipment and medium based on raspberry pi

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070230484A1 (en) * 2006-03-31 2007-10-04 Hu Carl C Message buffer for a receiver apparatus on a communications bus
CN101123487A (en) * 2007-09-29 2008-02-13 航天东方红卫星有限公司 An implementation for star network bus redundancy backup
CN102752180A (en) * 2012-06-18 2012-10-24 中国电子科技集团公司第十研究所 Method for achieving controller area network (CAN) bus network nodes
CN107203201A (en) * 2017-06-28 2017-09-26 吉林建筑大学 Elevator monitoring method based on CAN

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070230484A1 (en) * 2006-03-31 2007-10-04 Hu Carl C Message buffer for a receiver apparatus on a communications bus
CN101123487A (en) * 2007-09-29 2008-02-13 航天东方红卫星有限公司 An implementation for star network bus redundancy backup
CN102752180A (en) * 2012-06-18 2012-10-24 中国电子科技集团公司第十研究所 Method for achieving controller area network (CAN) bus network nodes
CN107203201A (en) * 2017-06-28 2017-09-26 吉林建筑大学 Elevator monitoring method based on CAN

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
佚名: ""CAN总线在嵌入式Linux下驱动程序的实现"", 《HTTPS://WWW.CNBLOGS.COM/GENERAL001/ARTICLES/2342728.HTML》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860321A (en) * 2022-04-06 2022-08-05 网易(杭州)网络有限公司 External device control method, device, equipment and medium based on raspberry pi

Similar Documents

Publication Publication Date Title
CN109144688B (en) Method and device for task scheduling on heterogeneous multi-core reconfigurable computing platform
US10956351B2 (en) Dynamic configuration of input/output controller access lanes
US20160147540A1 (en) Server system
CN108279935A (en) A kind of os starting bootstrap technique for system on chip
CN103207797A (en) Capsule type custom-made updating method based on unified extensible firmware interface firmware system
CN1987793A (en) Methods and arrangements for dynamically active processors
CN103530164A (en) Method and device for remote updating of field programmable gate array (FPGA) configuration files
CN104750510A (en) Chip start method and multi-core processor chip
CN103995939A (en) Dynamic reconfigurable embedded system based on ARM and FPGA
CN102308280A (en) Basic input/output system BIOS configuration data management method and system
CN108737499A (en) server configuration method and device
CN109408297A (en) A kind of method, apparatus of main and standby competition, equipment and storage medium
CN110119222A (en) Touch-control module switching method, device, equipment and readable medium based on dual system
US20200351155A1 (en) Base station configuration method and apparatus
CN105468390A (en) BOOT online upgrade apparatus and method
CN102253844B (en) Method and device for starting processor
CN108958817A (en) Bus driver method, apparatus and storage medium
CN114185607A (en) Starting control method, device and equipment for PCI (peripheral component interconnect) equipment in ARM (advanced RISC machines) server
KR102485288B1 (en) Controller for vehicle and operating system scheduling method thereof
CN116841728A (en) Cluster resource scheduling method and device, electronic equipment and storage medium
CN108572831B (en) Software online updating and upgrading system and method
CN107341024A (en) Method for upgrading system and system upgrade device
CN106484492A (en) The method and system of configuration interface
CN105094947B (en) The quota management method and system of a kind of virtual computing resource
US9311117B2 (en) System and method of capacity management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20181207

RJ01 Rejection of invention patent application after publication