CN104123381A - Automatic matching method of hardware board card - Google Patents

Automatic matching method of hardware board card Download PDF

Info

Publication number
CN104123381A
CN104123381A CN201410375928.8A CN201410375928A CN104123381A CN 104123381 A CN104123381 A CN 104123381A CN 201410375928 A CN201410375928 A CN 201410375928A CN 104123381 A CN104123381 A CN 104123381A
Authority
CN
China
Prior art keywords
board
hardware
register
kernel
file
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
CN201410375928.8A
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.)
Wuhan Research Institute of Posts and Telecommunications Co Ltd
Original Assignee
Wuhan Research Institute of Posts and Telecommunications Co Ltd
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 Wuhan Research Institute of Posts and Telecommunications Co Ltd filed Critical Wuhan Research Institute of Posts and Telecommunications Co Ltd
Priority to CN201410375928.8A priority Critical patent/CN104123381A/en
Publication of CN104123381A publication Critical patent/CN104123381A/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
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Abstract

Provided is an automatic matching method of a hardware board card. In the uboot starting stage, board card information of current hardware is acquired and saved in the environment variable bootargs of linuxuboot in the mode of character strings; the character strings saved in the environment variable bootargs are copied to a heap address space to which a kernel pointer saved_command_line points by a kernel, and the copied and saved character strings are saved in a cmdline file by establishing a proc folder; a file system is started, the cmdline file in the proc folder is analyzed to obtain the edition type boardtype and the slot position identification slotid of the current hardware, corresponding software is loaded according to an analysis result, and configuration needed by different board cards is completed. Through the method, software can be configured on the same platform, different hardware board cards can be automatically matched, the requirement for hardware can be lowered, and manpower and resource waste can be avoided.

Description

A kind of automatic matching method of hardware board
Technical field
The present invention relates to a kind of automatic matching method of hardware board, referring to especially the general boot of a kind of linux of utilization uboot() environmental variance for the method for software Auto-matching hardware board, can be applicable to multiple hardwares board altogether in the system of software platform to kernel transmission plate card hardware information.
Background technology
In built-in field, the hardware board of various functions emerges in an endless stream.Same company, along with the development of company grows, various hardware is close, derivative or the renewal product that software difference is little is more and more, how to allow different hardware board realize Development of Software Platform altogether, avoid numerous and diverse multi-platform software administration work, and software version issuing the problems such as chaotic, is that a lot of companies all need the problem of facing.Many hardware altogether software platform grows up gradually exactly under this needs.Mainly contain at present two kinds of platform schemes altogether.
1. adopt macro definition to distinguish different hardware boards
Software altogether platform is distinguished different boards by macro definition, distinguishes although this method can realize hardware board, need to first switch board macro definition, and then compile out software version during to different hardware board composing software version.Every board is all distinguished a corresponding software version, and time long products is many will cause version management complicated disorderly, and the time of product software development and maintenance and human cost also can be increasing.
2. adopt hardware register to distinguish different boards
Software altogether platform board differentiation is after kernel and file system startup, the register that identifies board information by reading on hardware device is distinguished board, this method can meet general needs substantially, to different board composing software versions without switch macro definition, only need to compile the board that a software version can be compatible all, can be at last software platform altogether truly.But will be more difficult when need to customizing some board uboot or kernel in this case.
Summary of the invention
For prior art defect, the invention provides a kind of automatic matching method of hardware board.
Technical scheme of the present invention provides a kind of automatic matching method of hardware board, carries out following steps based on linux system,
Step 1, the unloading phase of uboot, obtains the board information of current hardware, and corresponding release type boardtype and groove bit-identify slotid information are kept in linux uboot environmental variance bootargs with the form of character string; Described uboot is the boot that linux system is general;
Step 2, after uboot has started, entering kernel starts, kernel copies the character string of preserving in environmental variance bootargs to kernel pointer saved_command_line heap address space pointed, then the character string that copy is preserved is kept in cmdline file by creating proc file;
Step 3, after kernel has started, start startup file system, resolve release type boardtype and the groove bit-identify slotid of the current hardware of cmdline file acquisition under proc file, load corresponding software according to analysis result, complete the required configuration of different boards.
And the board of described current hardware comprises cpld device, in cpld device, the address offset of boardtype register, pcbversion register, slotid register is fixing reservation.
And, in step 1, obtain the board information of current hardware, comprise and read boardtype register, the pcbversion register of cpld, the value of slotid register, the register value obtaining comprises corresponding release type boardtypep, hardware version pcbversion and groove bit-identify slotid, in the time that the register value getting can match known board type, enter step 2, start otherwise enter acquiescence board configuration mode.
In technology provided by the present invention, hardware board information runs through three necessary processes that linux board starts, can complete three Auto-matching hardware board operations in process, degree realizes the common platform development of software at most, reduce development and maintenance cost, also reduce the requirement to hardware, avoid the waste of manpower and resource simultaneously.The present invention adopts hardware register to distinguish different hardware, except realizing the common platform on configuration service software, also can realize customization to uboot and kernel.
Brief description of the drawings
Fig. 1 is the process flow diagram of the embodiment of the present invention.
Fig. 2 is that the uboot of the embodiment of the present invention obtains the preservation of board information and conveying flow figure.
Fig. 3 is that the kernel of the embodiment of the present invention obtains the preservation of board information and conveying flow figure.
Fig. 4 is that the rootfs of the embodiment of the present invention obtains board information use process flow diagram.
embodiment
Describe technical solution of the present invention in detail below in conjunction with drawings and Examples.
For this software Auto-matching hardware board method, its objective is in order to realize altogether platform of software, and software altogether the key of platform how to be compatible many boards in a set of source code.In order to reach compatible object, can distinguish hardware board by macro definition, if but cause product software version lengthy and jumbled, just lose more than gain.In linux field, it is three necessary processes that linux board starts that uboot startup, kernel loads and file system start, the present invention directly obtains hardware board information in uboot, and board information is run through to whole device start operational scheme, equipment is distinguished no matter can realize hardware board in that flow process like this.
As shown in Figure 1, embodiment adopts linux uboot environmental variance to kernel transmission plate card information, then offers system software and read voluntarily and resolve coupling software corresponding to hardware board and complete relevant configuration.Concrete described hardware board Auto-matching is realized and being comprised the following steps,
Step 1, the unloading phase of uboot, read CPLD (Complex Programmable Logic Device, CPLD) boardtype register(release type register), pcbversion register(hardware version register), slotid register(groove bit-identify register) obtain the board information of current hardware, corresponding release type boardtype and groove bit-identify slotid information are remained on to bootargs(boot parameter with the form of character string) in environmental variance;
Under uboot, can read boardtype register, the pcbversion register of cpld, the value of slotid register, obtain the information of hardware board, in the time that the register value getting can match known board type, after uboot customizes configuration, proceed kernel(kernel) and rootfs(file system) load, start otherwise can enter acquiescence board configuration mode.
Accompanying drawing 2 has provided uboot and has obtained the preservation of board information and conveying flow figure, board starts in the initialized process of ram (random access memory) at uboot, read three cpld registers and obtain boardtype, the value of pcbversion and slotid, mate one by one in known board type according to the value of 3 registers again, find corresponding board type, if match correct board, just can carry out corresponding uboot configuration according to board type, after having configured, boardtype and slotid changed information are kept in bootargs environmental variance, then carry out subsequent step 2, 3, can start successively kernel and file system by environmental variance bootcmd configuration, if do not match known board, have unsuccessful the reporting an error of serially printing output matching board, then directly give tacit consent to board configuration mode, start successively kernel and file system by the mode of acquiescence, instead of execution step 2,3.
Step 2, after uboot has started, enter kernel(kernel) start, kernel can copy the character string of preserving in bootargs to a global pointer variable in the kernel of kernel pointer saved_command_line(linux system, point to a dynamically buffer area address for application) heap address space pointed, the character string information that kernel is preserved saved_command_line address is again by creating proc(pseudo-file system) file is kept at cmdline(command line parameter) in file, this file can be preserved in file system root directory proc file, conventionally be designated as/proc/cmdline file,
The present invention reads the board information that cpld acquires, and in remain in bootargs environmental variance, and bootargs can be created and is kept at by kernel/proc/cmdline file, resolves and calls for software in step 1 with the form of character string.
Accompanying drawing 3 has provided kernel and has obtained the preservation of board information and conveying flow figure, and in the run function (start_kernel) of kernel, kernel copies bootargs to the address space of saved_command_line pointed.After having copied, in kernel code, just can obtain board type by resolving the character string (the board type identification of character string forms) of preserving saved_command_line address, just can carry out the Custom Kernelization configuration of board according to board type, kernel also can load establishment/proc/cmdline file and preserve the information that saved_command_line pointer is preserved again.
Step 3, after kernel has started, start to start rootfs(file system), now can resolve boardtype and the slotid of the current hardware of cmdline file acquisition under proc file, load different software according to analysis result and complete the required configuration of different boards.
Accompanying drawing 4 has provided rootfs and has obtained board information use process flow diagram, after rootfs file system has started, can resolve cmdline file acquisition boardtype and slotid, can load the needed device Drivers file of different boards according to boardtype, also can configure according to slotid the configuration of same hardware different slots position.At user's space, also can move the required upper level applications of different boards according to boardtype.
When concrete enforcement, based on linux system, all hardware board must comprise cpld device, cpld device needs the different cpld file of programming according to board difference conventionally, the address offset of its boardtype register, pcbversion register, slotid register is fixing reservation, can not be used as other.How board information is transmitted most important in uboot, kernel kernel and rootfs file system, take full advantage of/proc/cmdline of the present invention fileinfo forms feature: cmdline information source is in uboot, be kept in uboot bootargs environmental variance, in kernel, inherited again, and be kept in cmdline file, after system has started, directly can in the cmdline of file system file, read and obtain.
Specific embodiment described herein is only to the explanation for example of the present invention's spirit.Those skilled in the art can make various amendments or supplement or adopt similar mode to substitute described specific embodiment, but can't depart from spirit of the present invention or surmount the defined scope of appended claims.

Claims (3)

1. an automatic matching method for hardware board, is characterized in that: carry out following steps based on linux system,
Step 1, the unloading phase of uboot, obtains the board information of current hardware, and corresponding release type boardtype and groove bit-identify slotid information are kept in linux uboot environmental variance bootargs with the form of character string; Described uboot is the boot that linux system is general;
Step 2, after uboot has started, entering kernel starts, kernel copies the character string of preserving in environmental variance bootargs to kernel pointer saved_command_line heap address space pointed, then the character string that copy is preserved is kept in cmdline file by creating proc file;
Step 3, after kernel has started, start startup file system, resolve release type boardtype and the groove bit-identify slotid of the current hardware of cmdline file acquisition under proc file, load corresponding software according to analysis result, complete the required configuration of different boards.
2. the automatic matching method of hardware board according to claim 1, it is characterized in that: the board of described current hardware comprises cpld device, in cpld device, the address offset of boardtype register, pcbversion register, slotid register is fixing reservation.
3. the automatic matching method of hardware board according to claim 2, it is characterized in that: in step 1, obtain the board information of current hardware, comprise and read boardtype register, the pcbversion register of cpld, the value of slotid register, the register value obtaining comprises corresponding release type boardtypep, hardware version pcbversion and groove bit-identify slotid, in the time that the register value getting can match known board type, enter step 2, start otherwise enter acquiescence board configuration mode.
CN201410375928.8A 2014-08-01 2014-08-01 Automatic matching method of hardware board card Pending CN104123381A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410375928.8A CN104123381A (en) 2014-08-01 2014-08-01 Automatic matching method of hardware board card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410375928.8A CN104123381A (en) 2014-08-01 2014-08-01 Automatic matching method of hardware board card

Publications (1)

Publication Number Publication Date
CN104123381A true CN104123381A (en) 2014-10-29

Family

ID=51768792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410375928.8A Pending CN104123381A (en) 2014-08-01 2014-08-01 Automatic matching method of hardware board card

Country Status (1)

Country Link
CN (1) CN104123381A (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484211A (en) * 2014-12-29 2015-04-01 广东欧珀移动通信有限公司 Method and device for sharing mirror image document
CN104572238A (en) * 2015-01-23 2015-04-29 烽火通信科技股份有限公司 Method and system for generating executable software package efficiently
CN105785824A (en) * 2016-04-12 2016-07-20 上海斐讯数据通信技术有限公司 Method and system for transmitting memory size parameters to Linux core
CN106095687A (en) * 2016-06-22 2016-11-09 西安电子科技大学 A kind of LinuxPCI trawl performance error-detecting method and device
CN106354541A (en) * 2016-10-25 2017-01-25 杭州迪普科技有限公司 Method and device for loading logical files
CN107357619A (en) * 2017-07-07 2017-11-17 广州视源电子科技股份有限公司 A kind of generation method, device, equipment and the storage medium of board configuration file
CN107577477A (en) * 2017-09-06 2018-01-12 武汉虹信通信技术有限责任公司 A kind of multi-platform software version adaptive approach and system based on DTB files
CN109933495A (en) * 2018-12-13 2019-06-25 英业达科技有限公司 Detect control circuit and detection control method
CN110008073A (en) * 2019-04-11 2019-07-12 苏州浪潮智能科技有限公司 Hardware platform differentiation screen method, device, equipment and readable storage medium storing program for executing
CN110366038A (en) * 2019-07-11 2019-10-22 四川长虹电器股份有限公司 The method of multiversion software hardware compatibility multiple technologies state
CN110708193A (en) * 2019-09-27 2020-01-17 烽火通信科技股份有限公司 Ethernet service board card starting method and system
CN111290982A (en) * 2020-02-20 2020-06-16 深圳震有科技股份有限公司 Slot state control method, intelligent terminal and storage medium
CN111897577A (en) * 2020-07-28 2020-11-06 厦门亿联网络技术股份有限公司 Master-slave distinguishing method and device of CPU (Central processing Unit) and computer terminal equipment
CN112015478A (en) * 2020-08-26 2020-12-01 北京字节跳动网络技术有限公司 Kernel loading method, server, device, computer device and storage medium
CN112463236A (en) * 2020-11-30 2021-03-09 福州汇思博信息技术有限公司 Single-soft multi-hard implementation method and terminal
CN112487738A (en) * 2020-11-19 2021-03-12 苏州浪潮智能科技有限公司 Signal control method, system, terminal and storage medium in board design stage
CN115827080A (en) * 2023-02-15 2023-03-21 南方电网产业投资集团有限责任公司 Embedded equipment adaptation method and device based on serial port communication and computer equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174699A1 (en) * 2006-01-05 2007-07-26 Honeywell International Inc. Automated generation of operational monitor platform for computer boards
CN102541572A (en) * 2010-12-08 2012-07-04 中兴通讯股份有限公司 Method, system and device for realizing guide of operating system kernel
US20120208619A1 (en) * 2010-10-25 2012-08-16 Wms Gaming, Inc. Computer bios protection and authentication
CN103702193A (en) * 2013-12-23 2014-04-02 乐视致新电子科技(天津)有限公司 Method and device for identifying and recognizing type of intelligent television
CN103929676A (en) * 2014-04-30 2014-07-16 广州视源电子科技股份有限公司 Method for testing function of smart television board card in remote-control mode and smart television board card

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174699A1 (en) * 2006-01-05 2007-07-26 Honeywell International Inc. Automated generation of operational monitor platform for computer boards
US20120208619A1 (en) * 2010-10-25 2012-08-16 Wms Gaming, Inc. Computer bios protection and authentication
CN102541572A (en) * 2010-12-08 2012-07-04 中兴通讯股份有限公司 Method, system and device for realizing guide of operating system kernel
CN103702193A (en) * 2013-12-23 2014-04-02 乐视致新电子科技(天津)有限公司 Method and device for identifying and recognizing type of intelligent television
CN103929676A (en) * 2014-04-30 2014-07-16 广州视源电子科技股份有限公司 Method for testing function of smart television board card in remote-control mode and smart television board card

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104484211B (en) * 2014-12-29 2017-07-28 广东欧珀移动通信有限公司 The method and device of shared image file
CN104484211A (en) * 2014-12-29 2015-04-01 广东欧珀移动通信有限公司 Method and device for sharing mirror image document
CN104572238A (en) * 2015-01-23 2015-04-29 烽火通信科技股份有限公司 Method and system for generating executable software package efficiently
CN105785824A (en) * 2016-04-12 2016-07-20 上海斐讯数据通信技术有限公司 Method and system for transmitting memory size parameters to Linux core
CN105785824B (en) * 2016-04-12 2020-02-11 上海斐讯数据通信技术有限公司 Method and system for transmitting memory size parameters to Linux kernel
CN106095687B (en) * 2016-06-22 2018-06-15 西安电子科技大学 A kind of Linux PCI trawl performances error-detecting method and device
CN106095687A (en) * 2016-06-22 2016-11-09 西安电子科技大学 A kind of LinuxPCI trawl performance error-detecting method and device
CN106354541A (en) * 2016-10-25 2017-01-25 杭州迪普科技有限公司 Method and device for loading logical files
CN107357619A (en) * 2017-07-07 2017-11-17 广州视源电子科技股份有限公司 A kind of generation method, device, equipment and the storage medium of board configuration file
CN107357619B (en) * 2017-07-07 2020-06-26 广州视源电子科技股份有限公司 Method, device, equipment and storage medium for generating card configuration file
CN107577477A (en) * 2017-09-06 2018-01-12 武汉虹信通信技术有限责任公司 A kind of multi-platform software version adaptive approach and system based on DTB files
CN107577477B (en) * 2017-09-06 2021-09-14 武汉虹信科技发展有限责任公司 DTB file-based multi-platform software version self-adaption method and system
CN109933495A (en) * 2018-12-13 2019-06-25 英业达科技有限公司 Detect control circuit and detection control method
CN110008073A (en) * 2019-04-11 2019-07-12 苏州浪潮智能科技有限公司 Hardware platform differentiation screen method, device, equipment and readable storage medium storing program for executing
CN110366038B (en) * 2019-07-11 2021-08-06 四川长虹电器股份有限公司 Method for multi-version software equipment to be compatible with multiple technical states
CN110366038A (en) * 2019-07-11 2019-10-22 四川长虹电器股份有限公司 The method of multiversion software hardware compatibility multiple technologies state
CN110708193A (en) * 2019-09-27 2020-01-17 烽火通信科技股份有限公司 Ethernet service board card starting method and system
CN111290982A (en) * 2020-02-20 2020-06-16 深圳震有科技股份有限公司 Slot state control method, intelligent terminal and storage medium
CN111897577A (en) * 2020-07-28 2020-11-06 厦门亿联网络技术股份有限公司 Master-slave distinguishing method and device of CPU (Central processing Unit) and computer terminal equipment
CN111897577B (en) * 2020-07-28 2023-10-13 厦门亿联网络技术股份有限公司 Master-slave distinguishing method and device for CPU and computer terminal equipment
CN112015478A (en) * 2020-08-26 2020-12-01 北京字节跳动网络技术有限公司 Kernel loading method, server, device, computer device and storage medium
CN112015478B (en) * 2020-08-26 2023-09-22 抖音视界有限公司 Kernel loading method, server, device, computer device and storage medium
CN112487738A (en) * 2020-11-19 2021-03-12 苏州浪潮智能科技有限公司 Signal control method, system, terminal and storage medium in board design stage
CN112487738B (en) * 2020-11-19 2022-10-18 苏州浪潮智能科技有限公司 Signal control method, system, terminal and storage medium in board design stage
CN112463236A (en) * 2020-11-30 2021-03-09 福州汇思博信息技术有限公司 Single-soft multi-hard implementation method and terminal
CN115827080A (en) * 2023-02-15 2023-03-21 南方电网产业投资集团有限责任公司 Embedded equipment adaptation method and device based on serial port communication and computer equipment

Similar Documents

Publication Publication Date Title
CN104123381A (en) Automatic matching method of hardware board card
CN107632828B (en) Multi-dts file supporting method, compiling device and embedded equipment
US5745679A (en) Method and device for file transfer by cascade release
CN106897072B (en) Service engineering calling method and device and electronic equipment
US7778983B2 (en) Application migration file scanning and conversion
CN107577477B (en) DTB file-based multi-platform software version self-adaption method and system
CN102567053A (en) Method and device for downgrading software version
US10248409B1 (en) Limiting the effects of source code patches on corresponding native-code patches
CN105511936A (en) Test system, method and device
CN109614325B (en) Method and device for determining control attribute, electronic equipment and storage medium
CN108255735B (en) Associated environment testing method, electronic device and computer readable storage medium
CN111144839A (en) Project construction method, continuous integration system and terminal equipment
CN111782276A (en) Method and terminal for automatically identifying hardware version
CN110990051B (en) Maintenance method, device, medium and equipment for software package dependency relationship
CN110083366B (en) Application running environment generation method and device, computing equipment and storage medium
WO2017201564A1 (en) Wipedrive native apple netbooting
CN114385196A (en) Software deployment method and device combining RPA and AI
CN111045717B (en) Method, device, computer equipment and storage medium for acquiring project dependent package
CN108255549B (en) Server program visual control method and device
US9727344B2 (en) Mining dependencies from disk images
CN105512168A (en) Cluster database composite data loading method and apparatus
CN112463596B (en) Test case data processing method, device and equipment and processing equipment
CN103914304A (en) Method for converting different structure type parameters on basis of SAP (service access point) platforms
CN114564210A (en) Copy deployment method, device, system, electronic equipment and storage medium
CN114371762A (en) Method and device for printing customized label and storage medium

Legal Events

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

Application publication date: 20141029

RJ01 Rejection of invention patent application after publication