CN106155961A - Pass the method and device of parameter to kernel based on BootLoader - Google Patents

Pass the method and device of parameter to kernel based on BootLoader Download PDF

Info

Publication number
CN106155961A
CN106155961A CN201610598689.1A CN201610598689A CN106155961A CN 106155961 A CN106155961 A CN 106155961A CN 201610598689 A CN201610598689 A CN 201610598689A CN 106155961 A CN106155961 A CN 106155961A
Authority
CN
China
Prior art keywords
physical memory
operating system
hardware parameter
crc check
memory
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.)
Granted
Application number
CN201610598689.1A
Other languages
Chinese (zh)
Other versions
CN106155961B (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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201610598689.1A priority Critical patent/CN106155961B/en
Publication of CN106155961A publication Critical patent/CN106155961A/en
Application granted granted Critical
Publication of CN106155961B publication Critical patent/CN106155961B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/38Information transfer, e.g. on bus

Abstract

The application provides a kind of method and device passing parameter based on BootLoader to kernel, and described method includes: the hardware parameter that needs transmit is stored in appointment physical memory by BootLoader, and the address information of described physical memory is sent to operating system;Wherein, the length of described physical memory is less than the length threshold preset, and described length threshold characterizes the maximum of the hardware parameter quantity of single transmission;Operating system based on the described address information received, described physical memory is limited to non-can committed memory;Operating system reads the described hardware parameter stored in described physical memory and performs startup, and sets up the physical address of described physical memory and the mapping relations of the logical address in operating system logical address space.The application embodiment of the present invention, owing to improve the quantity of BootLoader transmission hardware parameter, decreases the operating system access times to hardware chip, thus improves the speed that embedded device starts and runs.

Description

Pass the method and device of parameter to kernel based on BootLoader
Technical field
The application relates to computer communication field, particularly relates to pass to kernel method and the dress of parameter based on BootLoader Put.
Background technology
In embedded systems, BootLoader (start-up loading device) is that a section run during device power starts draws Helical pitch sequence, is mainly used in initiating hardware equipment, transmits hardware parameter to kernel and sets up the space mapping etc. of internal memory.Especially It is that BootLoader plays vital effect to the efficiency of kernel transmission hardware parameter to the toggle speed of embedded device.
But, in the operating system initialization stage, BootLoader transmission hardware parameter is limited in one's ability, and in operation system System run duration, when operating system needs the same hardware parameter that BootLoader transmission is used for multiple times, then needs frequently to visit Ask hardware chip, from this chip, read hardware parameter, thus reduce the speed that embedded device starts and runs.
Summary of the invention
In view of this, the application provides a kind of method and device passing parameter based on BootLoader to kernel, in order to carry The speed that high embedded device starts and runs.
First aspect according to embodiments of the present invention, it is provided that a kind of method passing parameter to kernel based on BootLoader, Described method is applied to embedded device, including:
The hardware parameter needing transmission is stored in appointment physical memory by BootLoader, and by described physical memory Address information is sent to operating system;Wherein, the length of described physical memory is less than the length threshold preset, described length threshold Value characterizes the maximum of the hardware parameter quantity of single transmission;
Operating system based on the described address information received, described physical memory is limited to non-can committed memory;
Operating system reads the described hardware parameter stored in described physical memory and performs startup, and sets up in described physics The mapping relations of the logical address in the physical address deposited and operating system logical address space.
Second aspect according to embodiments of the present invention, it is provided that a kind of device passing parameter based on BootLoader to kernel, Described device includes:
Transmitting element, is stored in the hardware parameter needing transmission in appointment physical memory for BootLoader, and will The address information of described physical memory is sent to operating system;Wherein, the length of described physical memory is less than the length preset Threshold value, described length threshold characterizes the maximum of the hardware parameter quantity of single transmission;
Limiting unit, for operating system based on the described address information received, is limited to non-by described physical memory Can committed memory;
Creating unit, reads, for operating system, the described hardware parameter stored in described physical memory and performs startup, and Set up the physical address of described physical memory and the mapping relations of the logical address in operating system logical address space.
The embodiment of the present invention proposes a kind of new method passing parameter to kernel based on BootLoader.By to based on BootLoader passes the improvement of parameter mechanism, and the hardware parameter needing transmission can be stored in appointment physics by BootLoader In depositing, it is possible to the address information of described physical memory is sent to operating system, the length of this physical memory is less than presetting Length threshold institute, and this length threshold characterizes the maximum of hardware parameter size of single transmission.Operating system can be with base In the described address information received, described physical memory is limited to non-can committed memory, and described physics can be read The described hardware parameter stored in internal memory performs startup, and sets up the physical address of described physical memory with operating system logically The mapping relations of the logical address in space, location.
On the one hand, before os starting, owing to the length of physical memory is by traditional regular length, change into length Less than the length threshold preset, length threshold characterizes the maximum of the hardware parameter quantity of single transmission, therefore can be effective Ground expands the quantity of transmission hardware parameter, improves the startup speed of operating system.
On the other hand, due to operating system this physical memory is limited to non-can committed memory, when after os starting, This physical memory will not be occupied, and the hardware parameter stored in physical memory is safeguarded.When operating system needs to be used for multiple times During this hardware parameter, can be obtained by this physical memory, without reading from hardware continually.This improves embedding Enter the operating rate of formula equipment.
Based on above-mentioned both sides reason, the method using the embodiment of the present invention to provide can improve embedded device and start With the speed run.
Accompanying drawing explanation
Fig. 1 is a kind of relevant skill passing parameter based on BootLoader to kernel shown in the application one exemplary embodiment The flow chart of art scheme;
Fig. 2 is a kind of method passing parameter to kernel based on BootLoader shown in the application one exemplary embodiment Flow chart;
Fig. 3 is the method that the another kind shown in the application one exemplary embodiment passes parameter based on BootLoader to kernel Flow chart;
Fig. 4 is a kind of device institute passing parameter based on BootLoader to kernel shown in the application one exemplary embodiment A kind of hardware structure diagram at equipment;
Fig. 5 is a kind of device passing parameter based on BootLoader to kernel shown in the application one exemplary embodiment Block diagram.
Detailed description of the invention
Here will illustrate exemplary embodiment in detail, its example represents in the accompanying drawings.Explained below relates to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they are only with the most appended The example of the apparatus and method that some aspects that described in detail in claims, the application are consistent.
It is only merely for describing the purpose of specific embodiment at term used in this application, and is not intended to be limiting the application. " a kind of ", " described " and " being somebody's turn to do " of singulative used in the application and appended claims is also intended to include majority Form, unless context clearly shows that other implications.It is also understood that term "and/or" used herein refers to and wraps Any or all containing one or more projects of listing being associated may combination.
Although should be appreciated that in the application possible employing term first, second, third, etc. to describe various information, but this A little information should not necessarily be limited by these terms.These terms are only used for same type of information is distinguished from each other out.Such as, without departing from In the case of the application scope, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depend on linguistic context, word as used in this " if " can be construed to " ... time " or " when ... Time " or " in response to determining ".
Seeing Fig. 1, Fig. 1 is that the one shown in the application one exemplary embodiment is hard to kernel transmission based on BootLoader The flow chart of the related art scheme of part parameter.
In embedded device, BootLoader is one section of bootstrap before os starting.It is similar to PC Bootstrap loader BIOS.
After embedded device starts, at operating system nucleus initial phase, BootLoader can be in operating system Core transmits hardware parameter, initiating hardware equipment and sets up the space mapping graph etc. of internal memory.Especially, BootLoader is to behaviour Make the quantity of system kernel transmission hardware parameter, determine the toggle speed of embedded device.BootLoader is to operating system The quantity of kernel transmission hardware parameter is the most, the quantity of the hardware parameter that operating system and other application programs can directly use The most, the toggle speed of embedded device is the fastest.
Transmitting in the mechanism of hardware parameter to kernel based on BootLoader relevant, BootLoader can be by needs The hardware parameter of transmission is saved in one section of fixing physical memory, it is possible to by the start physical address of this section of physical memory and Length is sent to operating system.Operating system can search this section of physics based on this start physical address received and length Internal memory, and use the hardware parameter stored in this physical memory, perform system start-up.
When realizing, as it is shown in figure 1, BootLoader can apply for one section of regular length physical memory, being used for storing needs Hardware parameter to be transmitted.BootLoader will need the memory storage of transmission in this physical memory, it is possible to calculates this hard The CRC check value of part parameter, and this CRC check value is pre-stored in this physical memory.After this hardware parameter is stored, The start physical address of this physical memory and length can be sent to operating system by BootLoader.Operating system is receiving After this start physical address and length, corresponding physical memory can be searched, it is possible to based on be pre-stored in this physics The algorithm that CRC check value in depositing is corresponding, the crc value of the hardware parameter preserved in Computational Physics internal memory.Operating system can compare The CRC check value relatively calculated and the CRC check value prestored, when two crc values are consistent, operating system may determine that this hardware Parameter has passed through CRC check.After by CRC check, operating system can read this hardware stored in this physical memory Parameter, performs system start-up operation.
But, on the one hand, owing to BootLoader is the physics that the hardware parameter needing transmission is stored in regular length In internal memory, owing to the length of this physical memory is fixed, so the hardware parameter that stores in this physical memory of BootLoader Quantity is restricted, and then have impact on the BootLoader quantity to operating system nucleus transmission hardware parameter, reduces embedding Enter the startup speed of formula equipment.
On the other hand, owing to, after os starting, the hardware parameter of this section of physical memory will be by other guide Cover.If in the operating system stage, when needing to be used for multiple times above-mentioned hardware parameter, operating system can only be by continually Access hardware chip, read this hardware parameter.Owing to operating system needs to access the hardware in above-mentioned embedded device continually Chip, therefore reduces the operating rate of this embedded device.
Therefore, based on above-mentioned two aspect reasons, use based on BootLoader to the relevant skill of kernel transmission hardware parameter Art, can reduce startup and the operating rate of embedded device.
The embodiment of the present invention proposes a kind of new method passing parameter to kernel based on BootLoader.By to based on BootLoader passes the improvement of parameter mechanism, and the hardware parameter needing transmission can be stored in appointment physics by BootLoader In depositing, it is possible to the address information of described physical memory is sent to operating system, the length of this physical memory is less than presetting Length threshold institute, and this length threshold characterizes the maximum of hardware parameter size of single transmission.Operating system can be with base In the described address information received, described physical memory is limited to non-can committed memory, and described physics can be read The described hardware parameter stored in internal memory performs startup, and sets up the physical address of described physical memory with operating system logically The mapping relations of the logical address in space, location.
On the one hand, before os starting, owing to the length of physical memory is by traditional regular length, change into length Less than the length threshold preset, length threshold characterizes the maximum of the hardware parameter quantity of single transmission, therefore can be effective Ground expands the quantity of transmission hardware parameter, improves the startup speed of operating system.
On the other hand, due to operating system this physical memory is limited to non-can committed memory, when after os starting, This physical memory will not be occupied, and the hardware parameter stored in physical memory is safeguarded.When operating system needs to be used for multiple times During this hardware parameter, can be obtained by this physical memory, without reading from hardware continually.This improves embedding Enter the operating rate of formula equipment.
Based on above-mentioned both sides reason, the method using the embodiment of the present invention to provide can improve embedded device and start With the speed run.
Seeing Fig. 2, Fig. 2 is that the one shown in the application one exemplary embodiment passes parameter based on BootLoader to kernel The flow chart of method, the method is applied to embedded device, comprises the following steps:
The hardware parameter needing transmission is stored in appointment physical memory by step 201:BootLoader, and by described thing The address information of reason internal memory is sent to operating system;Wherein, the length of described physical memory is less than the length threshold preset, institute State the maximum that length threshold characterizes the hardware parameter quantity of single transmission.
In embedded device, BootLoader is the one section of bootstrap run before os starting, is mainly used in Hardware parameter is transmitted, initiating hardware equipment and set up the space mapping etc. of internal memory to operating system nucleus.
Pass in the mechanism of parameter based on BootLoader to kernel relevant, after embedded device starts, in operation system System initial phase, BootLoader can transmit hardware parameter to operating system nucleus.When realizing, BootLoader is permissible The hardware parameter needing transmission is stored in the physical memory of one section of regular length, and the address information of this physical memory is passed Pass operating system.Operating system, based on this address information received, obtains the hardware parameter stored in this physical memory, holds Row system start-up.
Owing to the length of the physical memory of above-mentioned storage hardware parameter is fixed, therefore limit BootLoader to operation system The quantity of system kernel transmission hardware parameter, reduces the startup speed of embedded device.
In the present embodiment, the hardware parameter needing transmission is stored in one section of physical memory by BootLoader, this thing The length of reason internal memory is less than the length threshold preset, and this length threshold characterizes the maximum of the hardware parameter quantity of single transmission Value.Due in the present embodiment, the length threshold preset is more than above-mentioned regular length, so BootLoader is at application physics During internal memory, the length of physical memory to be applied for can be determined according to the number of transmitted hardware parameter quantity.Due to storage The length of the physical memory depositing hardware parameter is become less than the length threshold preset from regular length, to a certain extent, increases The big length of this physical memory, have also been enlarged the BootLoader quantity to operating system nucleus transmission hardware parameter, improves The startup speed of embedded device.
When realizing, the hardware parameter quantity that BootLoader can transmit as required, apply for one section of physical memory, should The length of physical memory is less than the length threshold preset.BootLoader can calculate the CRC of the hardware parameter needing transmission Check value, it is possible to this CRC check value calculated is pre-stored in initial front 4 bytes of this physical memory, and this is hard Part parameter is stored in this physical memory.The CRC check value needing the hardware parameter of transmission is pre-stored in this thing by BootLoader The purpose of reason internal memory, is in order to operating system can carry out the CRC check of hardware parameter, it is ensured that the hardware parameter of transmission reliable Property.
Wherein, BootLoader calculates read from physical memory in CRC check and the operating system of computing hardware parameter The CRC check value of hardware parameter time, the algorithm used is identical.
After the hardware parameter and CRC check value that need transmission are pre-stored in above-mentioned physical memory, BootLoader The address information of this physical memory can be sent to operating system.
Wherein, described address information includes the length etc. of the start physical address of physical memory, physical memory, here, not Repeat one by one.
Step 202: described physical memory, based on the described address information received, is limited to non-taking by operating system Internal memory.
Step 203: operating system reads the described hardware parameter stored in described physical memory and performs startup, and sets up institute State the physical address of physical memory and the mapping relations of the logical address in operating system logical address space.
Passing in the mechanism of parameter to kernel based on BootLoader relevant, operating system is receiving BootLoader After the address information of the above-mentioned physical memory of transmission, the hardware in above-mentioned physical memory can be used to join by this address information Number.But, after os starting, the hardware parameter in this physical memory will be covered by other guide, this hardware parameter Can not be safeguarded.If operating system needs this hardware parameter is used for multiple times, operating system can only access embedded continually The hardware chip of equipment, reads this hardware parameter.Owing to operating system access hardware chip is excessively frequent, so it is embedding to reduce this Enter the operating rate of formula equipment.
And in the present embodiment, operating system is in the address information of the above-mentioned physical memory receiving BootLoader transmission After, can based on this address information, this physical memory is limited to non-can committed memory so that the hardware ginseng in this physical memory Number will not be covered by other guide.Operating system can read the hardware ginseng in this physical memory based on this physical address information Number, performs system start-up operation.After os starting, if this operating system needs to use this hardware parameter, operation system System can read this hardware parameter from this section of physical memory, without accessing the hardware chip of embedded device continually, Read this hardware parameter.Therefore, the operating rate of embedded device is improved.
When realizing, operating system can receive the address information of the above-mentioned physical memory of BootLoader transmission, and Can based on this address information, this section of physical memory is limited to non-can committed memory.
Operating system can be by the address information of this physical memory from deleting committed memory white list.In operating system During operation, if operating system needs to apply for that physical memory carries out other work, only meeting foundation can the white name of committed memory In list, the physical memory of record is applied for, without taking the above-mentioned physical memory storing hardware parameter, therefore, above-mentioned thing Hardware parameter in reason internal memory will not be covered by other guide, and hardware parameter is safeguarded.
Operating system can physical address information based on this physical memory, read in this physical memory store hardware ginseng Number, performs system start-up operation.
After os starting, in order to repeatedly access the hardware parameter in this physical memory, in this physics After depositing into row restriction, operating system can be set up the internal memory of this physical memory and map.
Operating system can be set up in the physical address of this physical memory and operating system logical address space logically The mapping relations of location.After setting up mapping relations, after os starting, if operating system needs to use above-mentioned hardware to join Number, operating system can obtain the physical address that this logical address is corresponding, it is possible to base based on this logical address and mapping relations This physical memory is found, it is thus achieved that the hardware parameter stored in this physical memory in this physical address.
The most correct in order to determine the hardware parameter that BootLoader transmits, operating system can be to the hardware in this internal memory Parameter carries out CRC check.When realizing, operating system can calculate this thing based on the algorithm corresponding with the CRC check value prestored The CRC check value of reason internal memory, and the CRC check value calculated can be compared initiate front 4 words with being pre-stored in this physical memory CRC check value in joint is the most consistent, and when two CRC check values are consistent, the CRC check of hardware parameter is passed through.
After by the CRC check of hardware parameter, operating system, at run duration, can be used for multiple times this physical memory Hardware parameter, without repeatedly obtaining from hardware, improves the speed of service of this embedded device.
Wherein, above-mentioned can committed memory white list, including the address information that can take physical memory.Address above mentioned information bag Include the start physical address of physical memory and the length etc. of physical memory, here, repeat the most one by one.Aforesaid operations system is set up should The internal memory of physical memory maps and hardware parameter is carried out CRC check, is not limited by sequential.
The embodiment of the present invention proposes a kind of new method passing parameter to kernel based on BootLoader.By to based on BootLoader passes the improvement of parameter mechanism to kernel, and the hardware parameter needing transmission can be stored in appointment by BootLoader In physical memory, it is possible to the CRC check value of this parameter that prestores in this physical memory.The length of this physical memory is less than pre- If length threshold, and this length threshold characterizes the maximum of hardware parameter size of single transmission.BootLoader is permissible Start physical address and the length of described physical memory are sent to operating system.Operating system can based on receive this Beginning physical address and length, described physical memory is limited to non-can committed memory, it is possible to set up operating system and set up described The mapping relations of the logical address in the physical address of physical memory and operating system logical address space, it is possible to pre-based on this The CRC check value deposited, carries out CRC check to this hardware parameter.After by the CRC check of this hardware parameter, in operation system The system operation phase, operating system repeatedly can read in described physical memory based on described mapping relations and described logical address The parameter stored.
On the one hand, before os starting, owing to the length of physical memory is by traditional regular length, change into length Less than the length threshold preset, length threshold characterizes the maximum of the hardware parameter quantity of single transmission, therefore can be effective Ground expands the quantity of transmission hardware parameter, improves the startup speed of operating system.
On the other hand, due to operating system this physical memory is limited to non-can committed memory, when after os starting, This physical memory will not be occupied, and the hardware parameter stored in physical memory is safeguarded.When operating system needs to be used for multiple times During this hardware parameter, can be obtained by this physical memory, without reading from hardware continually.This improves embedding Enter the operating rate of formula equipment.
Additionally, operating system carries out CRC check to parameter may determine that the parameter of transmission is the most correct, enhance BootLoader passes the reliability of parameter to operating system nucleus.
Based on above-mentioned factor, the method using the embodiment of the present invention to provide can improve embedded device and starts and run Speed.
Seeing Fig. 3, Fig. 3 is that the another kind shown in the application one exemplary embodiment passes ginseng based on BootLoader to kernel The flow chart of the method for number, described method is applied to embedded device, comprises the following steps:
The hardware parameter needing transmission is stored in one section of physical memory by step 301:BootLoader, this physical memory Length less than preset length threshold.
Step 302:BootLoader calculates the crc value of this hardware parameter, and this crc value is pre-stored in this physical memory In initial front 4 bytes.
Start physical address and the length of physical memory are sent to operating system by step 303:BootLoader.
In embedded device, BootLoader is the one section of bootstrap run before os starting, is mainly used in Hardware parameter is transmitted, initiating hardware equipment and set up the space mapping etc. of internal memory to operating system nucleus.
Pass in the mechanism of parameter based on BootLoader to kernel relevant, after embedded device starts, in operation system System initial phase, BootLoader can transmit hardware parameter to operating system nucleus.When realizing, BootLoader is permissible The hardware parameter needing transmission is stored in the physical memory of one section of regular length, and initiateing this physical memory physically Location and length pass to operating system.Operating system, based on this start physical address received and length, obtains in this physics Deposit the hardware parameter of middle storage, perform system start-up.
Owing to the length of the physical memory of above-mentioned storage hardware parameter is fixed, therefore limit BootLoader to operation system The quantity of system kernel transmission hardware parameter, reduces the startup speed of embedded device.
In the present embodiment, the hardware parameter needing transmission is stored in one section of physical memory by BootLoader, this thing The length of reason internal memory is less than the length threshold preset, and this length threshold characterizes the maximum of the hardware parameter quantity of single transmission Value.Due in the present embodiment, the length threshold preset is more than above-mentioned regular length, so BootLoader is at application physics During internal memory, the length of physical memory to be applied for can be determined according to the number of transmitted hardware parameter quantity.Due to storage The length of the physical memory depositing hardware parameter is become less than the length threshold preset from regular length, to a certain extent, increases The big length of this physical memory, have also been enlarged the BootLoader quantity to operating system nucleus transmission hardware parameter, improves The startup speed of embedded device.
When realizing, the hardware parameter quantity that BootLoader can transmit as required, apply for one section of physical memory, should The length of physical memory is less than the length threshold preset.BootLoader can calculate the CRC of the hardware parameter needing transmission Check value, it is possible to this CRC check value calculated is pre-stored in initial front 4 bytes of this physical memory, and this is hard Part parameter is stored in this physical memory.The CRC check value needing the hardware parameter of transmission is pre-stored in this thing by BootLoader The purpose of reason internal memory, is in order to operating system can carry out the CRC check of hardware parameter, it is ensured that the hardware parameter of transmission reliable Property.
Wherein, BootLoader calculates read from physical memory in CRC check and the operating system of computing hardware parameter The CRC check value of hardware parameter time, the algorithm used is identical.
After the hardware parameter and CRC check value that need transmission are pre-stored in above-mentioned physical memory, BootLoader The length of the start physical address of this physical memory He this physical memory can be sent to operating system.
Step 304. operating system based on the start physical address received and length, this physical memory is limited to non-can Committed memory.
Passing in the mechanism of parameter to kernel based on BootLoader relevant, operating system is receiving BootLoader After the start physical address of the above-mentioned physical memory of transmission and length, can be used by this start physical address and length State the hardware parameter in physical memory.But, after os starting, the hardware parameter in this physical memory will be by other Content covers, and this hardware parameter can not be safeguarded.If operating system needs this hardware parameter is used for multiple times, operating system is only The hardware chip of embedded device can be accessed continually, read this hardware parameter.Due to operating system access hardware chip excessively Frequently, so the operating rate of this embedded device can be reduced.
And in the present embodiment, operating system is at the initial physics of the above-mentioned physical memory receiving BootLoader transmission Behind address and length, can based on this start physical address and length, this physical memory is limited to non-can committed memory so that Hardware parameter in this physical memory will not be covered by other guide.After os starting, if this operating system needs Using this hardware parameter, operating system can read this hardware parameter from this section of physical memory, without by continually Access the hardware chip of embedded device, read this hardware parameter.It is thus possible to improve the operating rate of embedded device.
When realizing, operating system can receive BootLoader transmission above-mentioned physical memory start physical address and Length, and can based on this start physical address and length, this section of physical memory is limited to non-can committed memory.
Operating system can be by the start physical address of this physical memory and length from deleting committed memory white list. During operating system, if operating system needs to apply for that physical memory carries out other work, only can be according to accounting for Apply for the physical memory of record in internal memory white list, without taking the above-mentioned physical memory storing hardware parameter, Therefore, the hardware parameter in above-mentioned physical memory will not be covered by other guide, and hardware parameter is safeguarded.
Operating system can read the hardware parameter in this physical memory based on this physical address information, performs system start-up Operation.
Wherein, above-mentioned can committed memory white list, including start physical address and the length that can take physical memory.
Step 305: operating system sets up the physical address of this physical memory and patrolling in operating system logical address space Collect the mapping relations of address
In the present embodiment, operating system can set up physical address and the operating system logical address sky of this physical memory The mapping relations of the logical address between.After setting up mapping relations, after os starting, if operating system needs to use Above-mentioned hardware parameter, operating system can obtain this logical address corresponding physically based on this logical address and mapping relations Location, it is possible to find this physical memory based on this physical address, it is thus achieved that the hardware parameter stored in this physical memory.
Whether what step 306. operating system judged hardware parameter passes through CRC check.
Step 307. operating system uses this hardware parameter.
Step 308. operating system terminates this flow process.
The most correct in order to determine the hardware parameter that BootLoader transmits, operating system can be to the hardware in this internal memory Parameter carries out CRC check.When realizing, operating system can calculate this thing based on the algorithm corresponding with the CRC check value prestored The CRC check value of reason internal memory, and the CRC check value calculated can be compared initiate front 4 words with being pre-stored in this physical memory CRC check value in joint is the most consistent, and when two CRC check values are consistent, the CRC check of hardware parameter is passed through.
After by the CRC check of hardware parameter, performing step 307, operating system, at run duration, can be used for multiple times The hardware parameter of this physical memory, without repeatedly obtaining from hardware, improves the speed of service of this embedded device.As Fruit, not over the CRC check of hardware parameter, performs step 308, and operating system determines that the hardware parameter of this transmission is incorrect, and Terminate this flow process.
Aforesaid operations system is set up the internal memory of this physical memory and is mapped and hardware parameter is carried out CRC check, not by sequential Limit.
The embodiment of the present invention proposes a kind of new method passing parameter to kernel based on BootLoader.By to based on BootLoader passes the improvement of parameter mechanism to kernel, and the hardware parameter needing transmission can be stored in appointment by BootLoader In physical memory, it is possible to the CRC check value of this parameter that prestores in this physical memory.The length of this physical memory is less than pre- If length threshold, and this length threshold characterizes the maximum of hardware parameter size of single transmission.BootLoader is permissible Start physical address and the length of described physical memory are sent to operating system.Operating system can based on receive this Beginning physical address and length, described physical memory is limited to non-can committed memory, it is possible to set up operating system and set up described The mapping relations of the logical address in the physical address of physical memory and operating system logical address space, it is possible to pre-based on this The CRC check value deposited, carries out CRC check to this hardware parameter.After by the CRC check of this hardware parameter, in operation system The system operation phase, operating system repeatedly can read in described physical memory based on described mapping relations and described logical address The parameter stored.
On the one hand, before os starting, owing to the length of physical memory is by traditional regular length, change into length Less than the length threshold preset, length threshold characterizes the maximum of the hardware parameter quantity of single transmission, therefore can be effective Ground expands the quantity of transmission hardware parameter, improves the startup speed of operating system.
On the other hand, due to operating system this physical memory is limited to non-can committed memory, when after os starting, This physical memory will not be occupied, and the hardware parameter stored in physical memory is safeguarded.When operating system needs to be used for multiple times During this hardware parameter, can be obtained by this physical memory, without reading from hardware continually.This improves embedding Enter the operating rate of formula equipment.
Additionally, operating system carries out CRC check to parameter may determine that the parameter of transmission is the most correct, enhance BootLoader passes the reliability of parameter to operating system nucleus.
Based on above-mentioned factor, the method using the embodiment of the present invention to provide can improve embedded device and starts and run Speed.
The application embodiment based on the device that BootLoader passes parameter to kernel can be applied on embedded device. Device embodiment can be realized by software, it is also possible to realizes by the way of hardware or software and hardware combining.Implemented in software As a example by, as the device on a logical meaning, it is that the processor by its place embedded device is by nonvolatile memory The computer program instructions of middle correspondence reads and runs formation in internal memory.For hardware view, as shown in Figure 4, for this Shen Please pass a kind of hardware structure diagram of the device place embedded device of parameter to kernel based on BootLoader, shown in Fig. 4 Processor, internal memory, network interface and nonvolatile memory outside, in embodiment the embedded device at device place lead to Often according to the actual functional capability of the device that should pass parameter based on BootLoader to kernel, it is also possible to include other hardware, to this not Repeat again.
Seeing Fig. 5, Fig. 5 is that the one shown in the application one exemplary embodiment passes parameter based on BootLoader to kernel The block diagram of device, described device is applied to embedded device, and described device includes: transmitting element 510, limiting unit 520 and Creating unit 530.
Wherein, transmitting element 510, for BootLoader, the hardware parameter needing transmission is stored in appointment physical memory In, and the address information of described physical memory is sent to operating system;Wherein, the length of described physical memory is less than presetting Length threshold, described length threshold characterizes the maximum of hardware parameter quantity of single transmission;
Limiting unit 520, for operating system based on the described address information received, is limited to described physical memory Non-can committed memory;
Creating unit 530, reads, for operating system, the described hardware parameter stored in described physical memory and performs startup, And set up the physical address of described physical memory and the mapping relations of the logical address in operating system logical address space.
In an optional implementation:
Described device also includes (not shown in Fig. 5): determine unit, for when, after described os starting, searching institute State mapping relations, determine the described physical address corresponding with described logical address;Read unit, for operating system based on described Physical address, reads described hardware parameter from corresponding described physical memory.
In another optional implementation:
Described limiting unit 520 also includes: deletes subelement, for operating system based on described address information, can account for With internal memory white list is deleted the address information of described physical memory, wherein, described can include taking by committed memory white list The address information of physical memory.
In another optional implementation:
Described device also includes (not shown in Fig. 5): storage element, for BootLoader by the ground of described physical memory Before location information is sent to operating system, the CRC check value for described hardware parameter precomputed is pre-stored in described Specified bytes in physical memory;Verification unit, for operating system based on described physical address, reads in described physical memory The described CRC check value stored, and based on described CRC check value, for the hardware parameter read from described physical memory Carry out CRC check.
In another optional implementation:
Described verification unit includes: computation subunit, calculates the CRC check value of described hardware parameter for operating system; Relatively subelement, the CRC check value stored in the CRC check value that calculates described in comparing with described physical memory whether Cause;When the described CRC check value calculated is consistent with the CRC check value stored in described physical memory, determine described CRC school Test and pass through.
In said apparatus, the function of unit and the process that realizes of effect specifically refer to corresponding step in said method Realize process, do not repeat them here.
For device embodiment, owing to it corresponds essentially to embodiment of the method, so relevant part sees method in fact The part executing example illustrates.Device embodiment described above is only schematically, wherein said as separating component The unit illustrated can be or may not be physically separate, and the parts shown as unit can be or can also It not physical location, i.e. may be located at a place, or can also be distributed on multiple NE.Can be according to reality Need to select some or all of module therein to realize the purpose of the application scheme.Those of ordinary skill in the art are not paying In the case of going out creative work, i.e. it is appreciated that and implements.
The foregoing is only the preferred embodiment of the application, not in order to limit the application, all essences in the application Within god and principle, any modification, equivalent substitution and improvement etc. done, should be included within the scope of the application protection.

Claims (10)

1. the method passing parameter to kernel based on BootLoader, it is characterised in that described method is applied to embedded setting Standby, including:
The hardware parameter needing transmission is stored in appointment physical memory by BootLoader, and by the address of described physical memory Information is sent to operating system;Wherein, the length of described physical memory is less than the length threshold preset, described length threshold table Levy the maximum of the hardware parameter quantity of single transmission;
Operating system based on the described address information received, described physical memory is limited to non-can committed memory;
Operating system reads the described hardware parameter stored in described physical memory and performs startup, and sets up described physical memory The mapping relations of the logical address in physical address and operating system logical address space.
Method the most according to claim 1, it is characterised in that also include:
When, after described os starting, searching described mapping relations, determine corresponding with described logical address described in physically Location;
Operating system, based on described physical address, reads described hardware parameter from corresponding described physical memory.
Method the most according to claim 1, it is characterised in that described operating system is based on the described address letter received Breath, described physical memory is limited to non-can committed memory, including:
Operating system based on described address information, can delete the address information of described physical memory in committed memory white list, Wherein, described the address information that can take physical memory can be included by committed memory white list.
Method the most according to claim 1, it is characterised in that the address information of described physical memory is sent out by BootLoader Before giving operating system, also include:
The CRC check value for described hardware parameter precomputed is stored in described physical memory by BootLoader Specified bytes;
Described method also includes:
Operating system, based on described physical address, reads the described CRC check value stored in described physical memory, and based on described CRC check value, carries out CRC check for the hardware parameter read from described physical memory.
Method the most according to claim 4, it is characterised in that described for the hardware read from described physical memory Parameter carries out CRC check, including:
Operating system calculates the CRC check value of described hardware parameter;
The CRC check value calculated described in Bi compare is the most consistent with the CRC check value stored in described physical memory;When described meter When the CRC check value calculated is consistent with the CRC check value stored in described physical memory, determine that described CRC check is passed through.
6. the device passing parameter based on BootLoader to kernel, it is characterised in that described device includes:
Transmitting element, is stored in the hardware parameter needing transmission in appointment physical memory for BootLoader, and by described The address information of physical memory is sent to operating system;Wherein, the length of described physical memory is less than the length threshold preset, Described length threshold characterizes the maximum of the hardware parameter quantity of single transmission;
Limiting unit, for operating system based on the described address information received, is limited to non-accounting for by described physical memory Use internal memory;
Creating unit, reads, for operating system, the described hardware parameter stored in described physical memory and performs startup, and set up The mapping relations of the logical address in the physical address of described physical memory and operating system logical address space.
Device the most according to claim 6, it is characterised in that described device also includes:
Determine unit, for when, after described os starting, searching described mapping relations, determine corresponding with described logical address Described physical address;
Read unit, for operating system based on described physical address, from corresponding described physical memory, read described hardware Parameter.
Device the most according to claim 6, it is characterised in that described limiting unit, including:
Delete subelement, for operating system based on described address information, committed memory white list can delete described physics The address information of internal memory, wherein, described can include the address information that can take physical memory by committed memory white list.
Device the most according to claim 6, it is characterised in that described device also includes:
Storage element, before the address information of described physical memory is sent to operating system by BootLoader, will in advance The CRC check value for described hardware parameter calculated is stored in the specified bytes in described physical memory;
Verification unit, for operating system based on described physical address, reads the described CRC check stored in described physical memory Value, and based on described CRC check value, carry out CRC check for the hardware parameter read from described physical memory.
Device the most according to claim 9, it is characterised in that described verification unit, also includes:
Computation subunit, calculates the CRC check value of described hardware parameter for operating system;
Relatively subelement, for the CRC check value calculated described in comparing with the CRC check value of storage in described physical memory be No unanimously;When the described CRC check value calculated is consistent with the CRC check value stored in described physical memory, determine described CRC check is passed through.
CN201610598689.1A 2016-07-25 2016-07-25 The method and device of parameter is passed to kernel based on BootLoader Active CN106155961B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610598689.1A CN106155961B (en) 2016-07-25 2016-07-25 The method and device of parameter is passed to kernel based on BootLoader

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610598689.1A CN106155961B (en) 2016-07-25 2016-07-25 The method and device of parameter is passed to kernel based on BootLoader

Publications (2)

Publication Number Publication Date
CN106155961A true CN106155961A (en) 2016-11-23
CN106155961B CN106155961B (en) 2019-08-06

Family

ID=58060236

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610598689.1A Active CN106155961B (en) 2016-07-25 2016-07-25 The method and device of parameter is passed to kernel based on BootLoader

Country Status (1)

Country Link
CN (1) CN106155961B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334413A (en) * 2017-12-22 2018-07-27 天津麒麟信息技术有限公司 Information transmitting methods between a kind of firmware and operating system based on platform of soaring

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763279A (en) * 2010-01-15 2010-06-30 上海维宏电子科技有限公司 BootLoader architectural design method
US20110145807A1 (en) * 2008-06-02 2011-06-16 Awox Method and device for updating a computer application
CN104809013A (en) * 2015-04-21 2015-07-29 北京创毅视讯科技有限公司 Embedded system starting method and device
CN104915302A (en) * 2014-03-10 2015-09-16 华为技术有限公司 Data transmission processing method and data transmission unit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110145807A1 (en) * 2008-06-02 2011-06-16 Awox Method and device for updating a computer application
CN101763279A (en) * 2010-01-15 2010-06-30 上海维宏电子科技有限公司 BootLoader architectural design method
CN104915302A (en) * 2014-03-10 2015-09-16 华为技术有限公司 Data transmission processing method and data transmission unit
CN104809013A (en) * 2015-04-21 2015-07-29 北京创毅视讯科技有限公司 Embedded system starting method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周超: "Linux操作系统在ARM硬件平台上的移植", 《中国优秀硕士学位论文全文数据库》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334413A (en) * 2017-12-22 2018-07-27 天津麒麟信息技术有限公司 Information transmitting methods between a kind of firmware and operating system based on platform of soaring

Also Published As

Publication number Publication date
CN106155961B (en) 2019-08-06

Similar Documents

Publication Publication Date Title
CN104679540B (en) Computer system and computer system starting method
US8935473B2 (en) System and method for a portable memory device to access and acquire additional memory from a remote location
US20110302224A1 (en) Data storage device with preloaded content
CN103136024B (en) A kind of reliable discharging method of application program, device and mobile device
US9710340B2 (en) Replacement of a corrupt driver variable record
EP3543858B1 (en) Method for checking and compiling system start-up files
JP2009510544A (en) Decompression technology for generating software images
CN102163155A (en) Upgrade controlling device and method for upgrading memory device
CN106250125A (en) Obtain the method and device of daily record
CN105677409B (en) A kind of method for upgrading system and device
WO2019144621A1 (en) Method, apparatus, and server for acquiring uefi os startup item
CN106873970A (en) The installation method and device of a kind of operating system
CN103455750B (en) The high peace verification method of a kind of embedded device and device
CN114385251A (en) Operating system booting method, system, terminal and storage medium based on memory
KR20180096660A (en) Validating memory device actions using reference values
CN106155961A (en) Pass the method and device of parameter to kernel based on BootLoader
US20100050166A1 (en) Updating system and method of portable executable programs
CN100363893C (en) Loading system and method
CN110765125B (en) Method and device for storing data
CN106557572A (en) A kind of extracting method and system of Android application program file
CN109408265A (en) A kind of guard method, device, terminal device and storage medium that IOS is operating abnormally
CN106033398A (en) Data processing system, external device starting method, and data processing method
CN112583794B (en) Interface calling method and device, computer equipment and storage medium
CN105630991B (en) ID automatic generation method and device
CN107038021B (en) For accessing the methods, devices and systems of random access memory ram

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Binjiang District and Hangzhou city in Zhejiang Province Road 310051 No. 68 in the 6 storey building

Applicant after: Hangzhou Dipu Polytron Technologies Inc

Address before: Binjiang District and Hangzhou city in Zhejiang Province Road 310051 No. 68 in the 6 storey building

Applicant before: Hangzhou Dipu Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant