CN109857422A - The method of USB flash disk upgrading kernel and file system - Google Patents

The method of USB flash disk upgrading kernel and file system Download PDF

Info

Publication number
CN109857422A
CN109857422A CN201811543071.0A CN201811543071A CN109857422A CN 109857422 A CN109857422 A CN 109857422A CN 201811543071 A CN201811543071 A CN 201811543071A CN 109857422 A CN109857422 A CN 109857422A
Authority
CN
China
Prior art keywords
flash disk
usb flash
kernel
file system
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
CN201811543071.0A
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.)
Aisino Corp
Original Assignee
Aisino 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 Aisino Corp filed Critical Aisino Corp
Priority to CN201811543071.0A priority Critical patent/CN109857422A/en
Publication of CN109857422A publication Critical patent/CN109857422A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of method and devices of USB flash disk upgrading kernel and file system.This method is applied to the embedded type Linux equipment of ARM9 platform, comprising: 1) initializes USB driving;2) the specific upgrade script file in USB flash disk is enumerated;3) whether the CRC for verifying the specific upgrade script file is complete and correct, if so, thening follow the steps 4), if not, terminating;4) every line code in automatic running script is completed to upgrade kernel and file system automatically.According to the method for the present invention and device, it can be realized the function of upgrading kernel and file system automatically using USB flash disk in the embedded type Linux equipment of any ARM9 platform.This has better convenience for the kernel and file system for being only capable of upgrading embedded device by PC host in the past, and has quickly solveed matching and supported the problem that upgrading is inconvenient brought by new peripheral hardware accessory.

Description

The method of USB flash disk upgrading kernel and file system
Technical field
The present invention relates to USB flash disk upgrade technique fields, and in particular, to a kind of method of USB flash disk upgrading kernel and file system.
Background technique
Be widely used at home now with built-in Linux, its own agreement also development at full speed with Meet various hardware devices and business demand.Consequent is a large amount of innovative peripheral hardware and embedded device carries out pair It connects, this is user group extension function in order to cater to mainstream and business demand is source.But currently as built-in Linux The widely used ARM9 platform of equipment institute, the Bootloader U-boot of initial start are not support USB flash disk upgrading kernel and text Part system, can only be by TFTP or the method for host programming mode, this will lead to conveniently and efficiently change kernel And file system, to cause the problem of peripheral module newly connected can not work normally.Therefore, it is necessary to develop based on ARM9 The method that the U-boot of platform supports USB flash disk upgrading kernel and file system.
The information for being disclosed in background of invention part is merely intended to deepen the reason to general background technique of the invention Solution, and it is known to those skilled in the art existing to be not construed as recognizing or imply that the information is constituted in any form Technology.
Summary of the invention
In order to solve user can in the case where no host to the embedded device of ARM platform carry out quick kernel and The upgrading of file system, the invention proposes under the built-in Linux environment based on ARM9 chip, in the start-up course of U-boot The middle automatic method for executing USB flash disk upgrading of addition, this method can be added arbitrarily in any built-in Linux based on ARM9 platform Seamless operation in the hardware carrier of operating system.
According to an aspect of the invention, it is proposed that a kind of method of USB flash disk upgrading kernel and file system, flat applied to ARM9 The embedded type Linux equipment of platform.This method comprises:
1) initialization USB driving;
2) the specific upgrade script file in USB flash disk is enumerated;
3) whether the CRC for verifying the specific upgrade script file is complete and correct, if so, then follow the steps 4), if not, Then terminate;
4) every line code in automatic running script is completed to upgrade kernel and file system automatically.
Preferably, specific by adding inquiry in the function reading in the file configuration table of U-boot in step 2) The code of upgrade script file enumerates the specific upgrade script file in USB flash disk.
Preferably, described specific to verify by adding verification function in the general purpose function of U-boot in step 3) Whether the CRC of upgrade script file is complete and correct.
Preferably, in step 4), function is run by adding script in the general purpose function of U-boot, with automatic running Every line code in script is completed to upgrade kernel and file system automatically.
According to another aspect of the invention, it is proposed that a kind of device of USB flash disk upgrading kernel and file system, is applied to ARM9 The embedded type Linux equipment of platform.The device includes:
Initialization module, for initializing USB driving;
Enumeration module, for enumerating the specific upgrade script file in USB flash disk;
Whether correction verification module, the CRC for verifying the specific upgrade script file are complete and correct;
Module is run, when complete and correct for the CRC in the specific upgrade script file, in automatic running script Every line code is completed to upgrade kernel and file system automatically.
Preferably, the enumeration module is specific by adding inquiry in the function reading in the file configuration table of U-boot The code of upgrade script file enumerates the specific upgrade script file in USB flash disk.
Preferably, the correction verification module is described specific to verify by adding verification function in the general purpose function of U-boot Whether the CRC of upgrade script file is complete and correct.
Preferably, the operation module runs function by adding script in the general purpose function of U-boot, to transport automatically Every line code for traveling far and wide in this is completed to upgrade kernel and file system automatically.
According to the method for the present invention and device, can be realized makes in the embedded type Linux equipment of any ARM9 platform Upgrade the function of kernel and file system automatically with USB flash disk.This was for being only capable of upgrading embedded device by PC host in the past For kernel and file system, there is better convenience, and quickly solveed matching and supported new peripheral hardware accessory institute band The inconvenient problem of the upgrading come.
Method of the invention has other characteristics and advantages, these characteristics and advantages from the attached drawing being incorporated herein and with Will be apparent in specific embodiment afterwards, or by the attached drawing and subsequent specific embodiment being incorporated herein into Row statement, these the drawings and specific embodiments in detail are used together to explain specific principle of the invention.
Detailed description of the invention
Exemplary embodiment of the present is described in more detail in conjunction with the accompanying drawings, of the invention is above-mentioned and other Purpose, feature and advantage will be apparent, wherein in exemplary embodiments of the present invention, identical reference label is usual Represent same parts.
Fig. 1 shows the system sequence figure of U-boot program electrifying startup;
Fig. 2 shows the work flow diagrams of main_loop function;
Fig. 3 shows the method flow diagram of the upgrading kernel and file system of USB flash disk in accordance with an exemplary embodiment of the invention.
Specific embodiment
The present invention will be described in more detail below with reference to accompanying drawings.Although showing the preferred embodiment of the present invention in attached drawing, However, it is to be appreciated that may be realized in various forms the present invention and should not be limited by the embodiments set forth herein.On the contrary, providing These embodiments are and the scope of the present disclosure completely can be communicated to ability to keep the disclosure more thorough and complete The technical staff in domain.
It, will certainly be comprising as hardware-initiated initialization since hardware carrier operates in embedded Linux system Bootloader U-boot, therefore open source operating system Linux is using preferable selection of the invention.
The system architecture of Linux is made of 5 parts, is respectively: application program (User Applications), the library C (Library), system call interfaces (System Call Interface), kernel (Kernel), framework relevant kernel code (Architecture-Dependent Kernel Code).The present invention is by powering on the initial stage in embedded device Increase in U-boot and supports what USB flash disk upgrading kernel and the function of file system and the code of corresponding USB flash disk compatibility were realized. Because addition the method involves Linux U-boot, kernel, driving various factors such as layer and application layer, more multiple Miscellaneous, involved knowledge point and difficult point are more in compiling procedure.It focuses on bottom U-boot auto-upgrade program and patrols The considerations of integrality and robustness for collecting: it provides meet the logic that USB flash disk upgrading corresponding kernel and file system are handled upwards Judge the requirement of integrality, the fault-tolerant processing of USB flash disk and various Read-write Catrol functions are packaged downwards.
The present invention can arbitrarily operate in the embedded Linux system for supporting ARM9 platform and be risen automatically by U-boot Kernel and file system inside grade USB flash disk.The realization of the function is mainly for the embedded Linux system for running ARM9 platform All hardware devices.For concrete example, MCU processor is the NUC977 chip of new Tang's science and technology, it is to be with ARM926EJS The system-level single-chip of core contains 16kB I-Cache and 16kB D-Cache and MMU memory management module.Highest It supports the frequency of 300MHz, and provides Peripheral Interface feature abundant.
The reason of U-boot is as Bootloader why is selected, is primarily due to U-boot in various bootloader Comprehensive advantage is strongest in version, and following table has absolutely proved where the advantage of U-boot.
Table 1
Bootloader Monitor Description X86 ARM PowerPC
LILO It is no Linux disk bootstrap program It is It is no It is no
GRUB It is no The LILO alternative program of GNU It is It is no It is no
Loadlin It is no Linux is guided from DOS It is It is no It is no
ROLO It is no From rom boot Linux without BIOS It is It is no It is no
U-boot It is Generic Bootstrap It is It is It is
RedBoot It is Bootstrap based on eCos It is It is It is
Vivi It is For the bootstrap of ARM CPU design It is no It is It is no
In conclusion final U-boot tool version selection is 2013-04 version.It supports open source code, supports a variety of Embedded operating system kernel supports the storing mode of a variety of environmental variances and the open approach of a variety of kernels starting.U-boot Subdirectory can classify 4 classes:
1, platform is related or development board is related;
2, general purpose function;
3, generic device driver;
4, U-boot tool, example procedure and document.Method of the invention is driven in general purpose function, that is, to next layer Dynamic program carries out in abstract package, and the code of USB flash disk upgrading kernel and file system is supported in addition.
Fig. 1 shows the system sequence figure of U-boot program electrifying startup.Top institute frame portion is divided into Lib_arm/board.c Init_sequence array in initialization function predetermined;Lower part institute frame portion is divided into Lib_arm/board.c's The initialization function of start_armboot function subsequent calls.
From the foregoing, it will be observed that the key point of the present invention program is main_loop function, which is exactly to need to add to hold automatically Where the method for row USB flash disk upgrading.
Fig. 2 shows the work flow diagrams of main_loop function.In main_loop function, need to add several necessary Function, principle are exactly the loop circulation by starting U-boot, enumerate the USB flash disk of support, and the spy of definition is found in USB flash disk Different script, then called by scripted code the system of U-boot itself call a function to realize USB flash disk upgrade automatically kernel and The function of file system.
The example of its special script is as follows:
fatload usb 0 0xXXX Kernel
nand erase 0xXXX 0xXXX
nand write 0xXXX 0xXXX 0xXXX
fatload usb 0 0xXXX rootfs
nand erase 0xXXX 0xXXX
nand write 0xXXX 0xXXX 0xXXX。
Two parts of implementation above respectively correspond the reading, identification and programming of kernel and file system.
Fig. 3 shows the method flow diagram of the upgrading kernel and file system of USB flash disk in accordance with an exemplary embodiment of the invention. This method is applied to the embedded type Linux equipment of ARM9 platform, as shown in figure 3, the method comprising the steps of S1~S4.
In step sl, initialization USB driving.
USB driving can be initialized using existing method.
In step s 2, the specific upgrade script file in USB flash disk is enumerated.
In one example, by adding inquiry specific upgrade foot in the function reading in the file configuration table of U-boot The code of this document enumerates the specific upgrade script file in USB flash disk.
Specifically, the generation of inquiry particular script file can be added in the do_fat_read_at of U-boot/fs/fat.c Code.
In step s3, whether the CRC for verifying the specific upgrade script file is complete and correct.If so, then executing step Rapid S4;If not, terminating.
In one example, the specific upgrade foot is verified by adding verification function in the general purpose function of U-boot Whether the CRC of this document is complete and correct.
Specifically, check_script function can be added in U-boot/common/main.c.
In step s 4, every line code in automatic running script is completed to upgrade kernel and file system automatically.
In one example, function is run by adding script in the general purpose function of U-boot, with automatic running script In every line code complete to upgrade kernel and file system automatically.
Specifically, run_script_cmd function is added in U-boot/common/main.c.
The invention also provides a kind of devices of USB flash disk upgrading kernel and file system, are applied to the insertion of ARM9 platform Formula Linux equipment.The device includes:
Initialization module, for initializing USB driving;
Enumeration module, for enumerating the specific upgrade script file in USB flash disk;
Whether correction verification module, the CRC for verifying the specific upgrade script file are complete and correct;
Module is run, when complete and correct for the CRC in the specific upgrade script file, in automatic running script Every line code is completed to upgrade kernel and file system automatically.
In one example, the enumeration module is looked by adding in the function reading in the file configuration table of U-boot The code of specific upgrade script file is ask to enumerate the specific upgrade script file in USB flash disk.
In one example, the correction verification module is by adding verification function in the general purpose function of U-boot to verify Whether the CRC for stating specific upgrade script file is complete and correct.
In one example, the operation module runs function by adding script in the general purpose function of U-boot, with Every line code in automatic running script is completed to upgrade kernel and file system automatically.
Various embodiments of the present invention are described above, above description is exemplary, and non-exclusive, and It is not limited to disclosed each embodiment.Without departing from the scope and spirit of illustrated each embodiment, for this skill Many modifications and changes are obvious for the those of ordinary skill in art field.The selection of term used herein, purport In the principle, practical application or improvement to the technology in market for best explaining each embodiment, or make the art Other those of ordinary skill can understand each embodiment disclosed herein.

Claims (8)

1. a kind of method of USB flash disk upgrading kernel and file system, applied to the embedded type Linux equipment of ARM9 platform, feature It is, comprising:
1) initialization USB driving;
2) the specific upgrade script file in USB flash disk is enumerated;
3) whether the CRC for verifying the specific upgrade script file is complete and correct, if so, thening follow the steps 4), if not, knot Beam;
4) every line code in automatic running script is completed to upgrade kernel and file system automatically.
2. the method for USB flash disk upgrading kernel and file system according to claim 1, which is characterized in that in step 2), lead to The code of the addition inquiry specific upgrade script file in the function reading in the file configuration table of U-boot is crossed to enumerate in USB flash disk Specific upgrade script file.
3. the method for USB flash disk upgrading kernel and file system according to claim 1, which is characterized in that in step 3), lead to Addition verification function is crossed in the general purpose function of U-boot whether completely and just to verify the CRC of the specific upgrade script file Really.
4. the method for USB flash disk upgrading kernel and file system according to claim 1, which is characterized in that in step 4), lead to It crosses and adds script operation function in the general purpose function of U-boot, it is automatic to complete with every line code in automatic running script Upgrade kernel and file system.
5. a kind of device of USB flash disk upgrading kernel and file system, applied to the embedded type Linux equipment of ARM9 platform, feature It is, comprising:
Initialization module, for initializing USB driving;
Enumeration module, for enumerating the specific upgrade script file in USB flash disk;
Whether correction verification module, the CRC for verifying the specific upgrade script file are complete and correct;
Module is run, it is each in automatic running script when complete and correct for the CRC in the specific upgrade script file Line code is completed to upgrade kernel and file system automatically.
6. the device of USB flash disk upgrading kernel and file system according to claim 5, is characterized in that, the enumeration module altogether USB flash disk is enumerated by adding the code of inquiry specific upgrade script file in the function reading in the file configuration table of U-boot In specific upgrade script file.
7. the device of USB flash disk upgrading kernel and file system according to claim 5, is characterized in that, the correction verification module altogether Verified by adding verification function in the general purpose function of U-boot the specific upgrade script file CRC it is whether complete and Correctly.
8. the device of USB flash disk upgrading kernel and file system according to claim 5, is characterized in that, the operation module altogether By in the general purpose function of U-boot add script run function, with every line code in automatic running script come complete from Dynamic upgrading kernel and file system.
CN201811543071.0A 2018-12-17 2018-12-17 The method of USB flash disk upgrading kernel and file system Pending CN109857422A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811543071.0A CN109857422A (en) 2018-12-17 2018-12-17 The method of USB flash disk upgrading kernel and file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811543071.0A CN109857422A (en) 2018-12-17 2018-12-17 The method of USB flash disk upgrading kernel and file system

Publications (1)

Publication Number Publication Date
CN109857422A true CN109857422A (en) 2019-06-07

Family

ID=66891469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811543071.0A Pending CN109857422A (en) 2018-12-17 2018-12-17 The method of USB flash disk upgrading kernel and file system

Country Status (1)

Country Link
CN (1) CN109857422A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110271270A1 (en) * 2010-04-28 2011-11-03 Novell, Inc. System and method for upgrading kernels in cloud computing environments
CN103136002A (en) * 2011-11-25 2013-06-05 航天信息股份有限公司 Automatic upgrade control method based on UBoot instruction and system
CN104581397A (en) * 2014-12-29 2015-04-29 四达时代通讯网络技术有限公司 System upgrade method and device for android set-top box

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110271270A1 (en) * 2010-04-28 2011-11-03 Novell, Inc. System and method for upgrading kernels in cloud computing environments
CN103136002A (en) * 2011-11-25 2013-06-05 航天信息股份有限公司 Automatic upgrade control method based on UBoot instruction and system
CN104581397A (en) * 2014-12-29 2015-04-29 四达时代通讯网络技术有限公司 System upgrade method and device for android set-top box

Similar Documents

Publication Publication Date Title
CN106528106B (en) A kind of embedded system start method of adaptive various different Flash chip types
US10613773B2 (en) Backing up firmware during initialization of device
US6725178B2 (en) Use of hidden partitions in a storage device for storing BIOS extension files
CN106990958B (en) Expansion assembly, electronic equipment and starting method
US20100318961A1 (en) Parametric Build of UEFI Firmware
KR100704629B1 (en) Apparatus and method for protecting virus at the master boot recode located in altered position
CN100353320C (en) Boot process
US20090094447A1 (en) Universal serial bus flash drive for booting computer and method for loading programs to the flash drive
US7356684B2 (en) Booting system and/or method for initializing peripherals
CN111857776A (en) Online upgrading method for application programs of DSP (digital Signal processor) board cards
CN105760191A (en) Embedded system equipment programming mass production method
US20100049961A1 (en) Update method for basic input/output system and update system thereof
US20030110370A1 (en) Supporting legacy operating system booting in a legacy-free system
CN101299189A (en) DOS method of one of self-startup and multiple operating systems
TWI478061B (en) Method for updating firmware
EP2645239A1 (en) Electronic apparatus and booting method
CN114528557A (en) Self-adaptive starting method of embedded SOC chip
CN101281485B (en) Computer testing method without hard disc
CN109857422A (en) The method of USB flash disk upgrading kernel and file system
CN100465894C (en) Class loading method for starting Java Processor
US7406549B2 (en) Support for non-standard device containing operating system data
CN116302122A (en) Multi-core heterogeneous domain controller, peripheral adaptation method and storage medium
CN108052337A (en) A kind of firmware upgrade method and device of eMMC production tools
CN102346676B (en) Multiple starting management method for computer
US11775284B2 (en) Electronic device and code patching method

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: 20190607

RJ01 Rejection of invention patent application after publication