WO2017202128A1 - 非linux系统软件boot参数传递方法及系统 - Google Patents

非linux系统软件boot参数传递方法及系统 Download PDF

Info

Publication number
WO2017202128A1
WO2017202128A1 PCT/CN2017/077986 CN2017077986W WO2017202128A1 WO 2017202128 A1 WO2017202128 A1 WO 2017202128A1 CN 2017077986 W CN2017077986 W CN 2017077986W WO 2017202128 A1 WO2017202128 A1 WO 2017202128A1
Authority
WO
WIPO (PCT)
Prior art keywords
system software
boot parameter
memory address
boot
parameter
Prior art date
Application number
PCT/CN2017/077986
Other languages
English (en)
French (fr)
Inventor
黄利雄
Original Assignee
深圳创维数字技术有限公司
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 深圳创维数字技术有限公司 filed Critical 深圳创维数字技术有限公司
Publication of WO2017202128A1 publication Critical patent/WO2017202128A1/zh

Links

Images

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/445Program loading or initiating
    • 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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Definitions

  • the present disclosure relates to the field of embedded system technologies, for example, to a non-linux system software boot (boot) parameter transfer method and system.
  • boot non-linux system software boot
  • Embedded systems are widely used in a variety of electronic products.
  • the BootLoader (boot loader) runs before the system software runs.
  • the hardware device can be initialized and a memory space map can be created to bring the system's hardware and software environment to a suitable state in order to prepare the correct environment for the final running system software.
  • BIOS Basic Input Output System
  • the Boot parameter is a popular type of BootLoader, which is usually combined with a Linux system to form the entire embedded system software.
  • the boot parameter loads the kernel according to the description of its own parameters, and passes the relevant parameters to the kernel, thus maintaining the consistency of the relevant information in the boot parameters with the system software.
  • the system software is a non-linux system, it is not so convenient to keep the information and data in the BootLoader and the system software consistent, because the non-linux system software related technology does not support the BootLoader to pass parameters to the system software.
  • flash memory flash memory
  • other storage are generally divided into multiple partitions. This information should keep BootLoader consistent with system software.
  • the kernel For Linux system software, pass the boot parameter (cmd line) to the kernel (operation System kernel), then the kernel knows the partition information according to the description of the cmd line, but for non-linux system software, the current practice is to compile the partition and other information into the program at compile time, and it is fixed. In the case of a program, configuration information such as partitions cannot be modified.
  • the related technology does not have a parameter transfer method for non-linux systems.
  • the system software uses non-linux systems (such as UCOS, ECOS, OS21, etc.)
  • the system software can only obtain relevant information and data through other means, such as curing in the code.
  • Related information The address of the storage device such as flash memory is read by the system software and read from the flash memory and other storage devices. For example, the relevant information is solidified in the code during compilation.
  • the present disclosure provides a non-linux system software boot parameter transfer method and system, which realizes the transfer of boot parameters to non-linux system software through BootLoader, maintains the consistency of related information and data in BootLoader and non-linux system software, and facilitates uniformity. Manage related information and data, reducing maintenance costs.
  • a non-linux system software boot parameter delivery method including:
  • the system software After the system software is running, the system software obtains the boot parameter from the set memory address.
  • the method further includes:
  • the boot parameter passed to the system software is written into the set memory address, including: according to the memory address description of the boot parameter in the boot parameter list, the boot parameter passed to the system software is written. Enter the set memory address.
  • system software obtains the boot parameter from the set memory address, including:
  • the system software obtains the boot parameter passed from the BootLoader from the set memory address, and analyzes the boot parameter to obtain the corresponding information and data.
  • the system allocates a set memory address to the boot parameter in the system software, including:
  • the memory address assigned to the boot parameter is defined by the C language keyword;
  • the -D of the CGLAGS in the C language compile option defines the memory address assigned to the boot parameter.
  • Another aspect provides a non-linux system software boot parameter delivery system, the system comprising:
  • the memory address writing module is set to write the boot parameter passed to the system software to the set memory address in the BootLoader code before the system software runs;
  • the Boot parameter gets the module, set to the system software from the set memory location after the system software is running.
  • the address gets the boot parameter.
  • it also includes:
  • the memory space setting module is set to set a memory space for storing the boot parameter according to the memory layout of the system software
  • a memory address allocation module configured to allocate a set memory address to the boot parameter in the system software
  • the memory address description is added to the module and is set to include the memory address description of the boot parameter in the boot parameter list.
  • the boot parameter passed to the system software is written into the set memory address in the BootLoader code, including:
  • the boot parameter passed to the system software is written to the set memory address.
  • system software obtains the boot parameter from the set memory address, including:
  • the system software obtains the boot parameter passed from the BootLoader from the set memory address, and analyzes the boot parameter to obtain the corresponding information and data.
  • the system allocates a preset memory address to the boot parameter in the system software, including:
  • the default memory address assigned to the boot parameter is defined by the C language keyword;
  • the -D in the CGLAGS of the C language compile option defines the default memory address assigned to the boot parameter.
  • a non-transitory computer readable storage medium stored with computer executable instructions for performing the non-linux system software boot parameter transfer method of any of the above.
  • the disclosure writes the boot parameter passed to the system software in the BootLoader code to the memory address before the system software runs; after the system software runs, the system software obtains the boot parameter according to the memory address.
  • the disclosure provides a way for BootLoader and non-linux system software information and data sharing based on the embedded system software of BootLoader and non-linux system, realizes the delivery of boot parameters to non-linux system software through BootLoader, and maintains BootLoader and non-linux.
  • the consistency of relevant information and data in the system software facilitates unified management of related information and data, reducing maintenance costs.
  • FIG. 1 is a flowchart of a method of a first embodiment of a non-linux system software boot parameter delivery method provided in a specific embodiment.
  • FIG. 2 is a flow chart of a method of a second embodiment of a non-linux system software boot parameter delivery method provided in a specific embodiment.
  • FIG. 3 is a structural block diagram of a first embodiment of a non-linux system software boot parameter delivery system provided in a specific embodiment.
  • FIG. 4 is a structural block diagram of a second embodiment of a non-linux system software boot parameter delivery system provided in a specific embodiment.
  • FIG. 5 is a structural block diagram of an electronic device provided in a specific embodiment.
  • FIG. 1 is a flowchart of a method for a first embodiment of a non-linux system software boot parameter delivery method provided in a specific implementation manner. As shown, the method includes:
  • step S110 the boot parameter passed to the system software is written to the set memory address in the BootLoader code before the system software is run.
  • step S120 after the system software is running, the system software obtains the boot parameter from the set memory address.
  • the processing of the boot parameter is added. After the system software runs, the system software obtains the boot parameter from the set memory address, and analyzes the boot parameter to obtain the corresponding information and data.
  • this embodiment provides a way for BootLoader and non-linux system software information and data sharing based on the embedded system software of BootLoader and non-linux system, and passes the boot parameter to the non-linux system software through the BootLoader, and maintains the BootLoader is related to non-linux system software Consistency of information and data facilitates unified management of related information and data, reducing maintenance costs.
  • FIG. 2 is a flowchart of a method for a second embodiment of a non-linux system software boot parameter delivery method provided in a specific implementation manner. As shown, the method includes:
  • step S201 according to the memory layout of the system software, a memory space is set for storing the boot parameter.
  • the memory space for storing the boot parameter can be set to 0x87f80000-0x87f8ffff.
  • step S202 the boot parameter is assigned a set memory address in the system software; a memory address description of the boot parameter is added to the boot parameter list.
  • the memory address assigned to the boot parameter in the system software includes:
  • A1 In the system software, modify the link script file .ld of the program, and add the memory address assigned to the boot parameter to the link script file .ld as follows:
  • A2 In the system software, the memory address assigned to the boot parameter is defined by the C language keyword as follows:
  • the -D in the CGLAGS of the C language compile option defines the memory address assigned to the boot parameter, as shown below:
  • the set memory address is the starting point of the memory space set in step S201.
  • the memory address description corresponds to a starting point of the memory space set in step S201.
  • step S203 the boot parameter passed to the system software is written to the set memory address in the BootLoader code before the system software is run.
  • the boot parameter passed to the system software in the BootLoader code is written into the set memory address, including: according to the memory address description of the boot parameter in the boot parameter list, the boot parameter passed to the system software is written into the set Memory address.
  • step S204 after the system software is running, the system software obtains the boot parameter from the set memory address.
  • the processing of the boot parameter is added. After the system software is running, the system software obtains the boot parameter according to the set memory address, and analyzes the boot parameter to obtain corresponding information and data.
  • the system software obtains the boot parameter from the set memory address, including: the system software obtains the boot parameter passed by the BootLoader from the set memory address, and analyzes the boot parameter to obtain corresponding information and data.
  • the system software obtains the boot parameter passed by the BootLoader from the set memory address, and analyzes the boot parameter to obtain corresponding information and data.
  • This embodiment provides a way for BootLoader and non-linux system software information and data sharing based on the embedded system software of BootLoader and non-linux system.
  • the BootLoader delivers boot parameters to non-linux system software, and maintains BootLoader and non-linux systems.
  • the consistency of relevant information and data in the software facilitates the unified management of relevant information and data, reducing maintenance costs.
  • the following is an embodiment of a non-linux system software boot parameter delivery system provided in the specific implementation manner.
  • the embodiment of the system is implemented based on the embodiment of the foregoing method. For the description in the system, refer to the embodiment of the foregoing method. .
  • FIG. 3 is a structural block diagram of a first embodiment of a non-linux system software boot parameter delivery system provided in a specific implementation manner. As shown, the system includes:
  • the memory address writing module 31 is configured to write the boot parameter passed to the system software to the set memory address in the BootLoader code before the system software runs. as well as
  • the Boot parameter obtaining module 32 is configured to obtain the boot parameter from the set memory address after the system software is running.
  • this embodiment implements the Boot parameter to pass the boot parameters to the non-linux system software, so that the related information and data sharing between the BootLoader and the non-linux system software are more comprehensive, and the consistency of related information and data is maintained. Convenient management of related information and data, reducing maintenance costs.
  • FIG. 4 is a structural block diagram of a second embodiment of a non-linux system software boot parameter delivery system provided in a specific implementation manner. As shown, the system includes:
  • the memory space setting module 41 is configured to set a memory space for storing the boot parameter according to the system software memory layout.
  • the memory address assignment module 42 is configured to assign a set memory address to the boot parameter in the system software.
  • the memory address assigned to the boot parameter in the system software includes:
  • the memory address assigned to the boot parameter is defined by the C language keyword;
  • the -D of the CGLAGS in the C language compile option defines the memory address assigned to the boot parameter.
  • the memory address description is added to the module 43 and is set to add a memory address description of the boot parameter to the boot parameter list.
  • the memory address writing module 44 is configured to write the boot parameter passed to the system software to the set memory address in the BootLoader code before the system software runs.
  • the boot parameter passed to the system software in the BootLoader code is written into the set memory address, including: according to the memory address description of the boot parameter in the boot parameter list, the boot parameter passed to the system software is written into the set Memory address.
  • the Boot parameter obtaining module 45 is configured to obtain the boot parameter from the set memory address after the system software is running.
  • the system software obtains the boot parameter from the set memory address, including: the system software obtains the boot parameter passed by the BootLoader from the set memory address, and analyzes the boot parameter to obtain corresponding information and data.
  • this embodiment provides a non-linux system software boot parameter delivery system to achieve the boot parameters passed to the non-linux system software through the BootLoader, maintaining the consistency of related information and data in the BootLoader and non-linux system software, convenient and unified Manage related information and data, reducing maintenance costs.
  • This embodiment provides a non-transitory computer readable storage medium storing computer executable instructions for executing the non-linux system software boot parameter transfer method described in any of the above embodiments.
  • FIG. 5 is a structural block diagram of an electronic device provided in a specific embodiment.
  • the electronic device provided by the embodiment of the present disclosure may include a processor 51 and a memory 53, and may further include a communication interface 52 and a bus 54.
  • the processor 51, the communication interface 52, and the memory 53 can complete communication with each other through the bus 54.
  • Communication interface 52 can be used for information transmission.
  • the processor 51 can call the logic instructions in the memory 53 to execute the non-linux system software boot parameter transfer method of the above embodiment.
  • the logic instructions in the memory 53 described above may be implemented in the form of a software functional unit and sold or used as a stand-alone product, and may be stored in a computer readable storage medium.
  • the technical solution of the present disclosure may be embodied in the form of a software product stored in a storage medium, including a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network) The device or the like) performs all or part of the steps of the method described in various embodiments of the present disclosure.
  • the foregoing storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disk.
  • a medium that can store program code or a transient storage medium including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disk.
  • the disclosure writes the boot parameter passed to the system software in the BootLoader code to the memory address before the system software runs; after the system software runs, the system software obtains the location according to the memory address. Said boot parameters.
  • the disclosure provides a way for BootLoader and non-linux system software information and data sharing based on the embedded system software of BootLoader and non-linux system, realizes the delivery of boot parameters to non-linux system software through BootLoader, and maintains BootLoader and non-linux.
  • the consistency of relevant information and data in the system software facilitates unified management of related information and data, reducing maintenance costs.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

一种非linux系统软件boot参数传递方法及系统。该方法包括:在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址;以及在系统软件运行后,系统软件从设定的内存地址得到所述boot参数。

Description

非linux系统软件boot参数传递方法及系统 技术领域
本公开涉及嵌入式系统技术领域,例如涉及一种非linux系统软件boot(启动)参数传递方法及系统。
背景技术
嵌入式系统广泛应用于多种电子产品,在嵌入式操作系统中,BootLoader(启动加载程序)是在系统软件运行之前运行。可以初始化硬件设备、建立内存空间映射图,从而将系统的软硬件环境带到一个合适状态,以便为最终运行系统软件准备好正确的环境。在嵌入式系统中,通常并没有像BIOS(Basic Input Output System,基本输入输出系统)那样的固件程序,因此整个系统的加载启动任务就完全由BootLoader来完成。Boot参数是目前比较流行的一类BootLoader,它通常与Linux系统搭配组成整个嵌入式系统软件。boot参数根据自身参数的描述进行加载内核,并把相关的参数传递给内核,这样保持了boot参数中的相关信息与系统软件的一致性。然而当系统软件为非linux系统时,要保持BootLoader与系统软件中的信息及数据一致就没有那么方便了,因为非linux系统软件相关技术不支持BootLoader给系统软件传参数。比如嵌入式系统中一般都会把flash memory(闪存)等存储区分成多个分区,这些信息要保持BootLoader与系统软件一致,对于linux系统软件来说,把boot参数(cmd line)传给kernel(操作系统内核),然后kernel根据cmd line的描述就知道分区信息了,但是对于非linux系统软件来说,目前的做法都是在编译时就把分区等信息编译进程序里固定死了,在不修改程序的情况下无法修改分区等配置信息。
相关技术没有针对非linux系统的参数传递方法,当系统软件采用非linux系统(比如UCOS、ECOS、OS21等)时,系统软件就只能通过其他方式来获取相关信息和数据,比如在代码里固化相关信息在flash memory等存储设备的地址,由系统软件运行起来后从flash memory等存储设备上读取,又比如编译时把相关信息固化在代码里,这些方法在BootLoader与系统软件之间共享相关信息及数据并保持一致都不是那么灵活,不方便软件的后期维护,增加了维护成本。
发明内容
本公开提供了一种非linux系统软件boot参数传递方法及系统,实现了通过BootLoader给非linux系统软件传递boot参数,保持了BootLoader与非linux系统软件里的相关信息及数据的一致性,方便统一管理相关信息和数据,降低了维护成本。
本公开采用以下技术方案:
一方面,提供了一种非linux系统软件boot参数传递方法,包括:
在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址;以及
在系统软件运行后,系统软件从设定的内存地址得到所述boot参数。
可选地,所述在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址之前,还包括:
根据系统软件内存布局情况,设定一个内存空间用于存放boot参数;
在系统软件中给boot参数分配设定的内存地址;在boot参数列表中加入boot参数的内存地址描述。
可选地,所述在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址,包括:根据boot参数列表中的boot参数的内存地址描述,把传递给系统软件的boot参数写入设定的内存地址。
可选地,所述系统软件从设定的内存地址得到所述boot参数,包括:
系统软件从设定的内存地址得到BootLoader传递过来的boot参数,分析boot参数得到相应的信息和数据。
可选地,所述在系统软件中给boot参数分配设定的内存地址,包括:
在系统软件中,修改程序的链接脚本文件.ld,把分配给boot参数的设定的内存地址加入所述链接脚本文件.ld中;或
在系统软件中,通过C语言关键字定义分配给boot参数的设定的内存地址;或
在系统软件中,通过C语言编译选项的CGLAGS中的-D定义分配给boot参数的设定的内存地址。
另一方面提供了一种非linux系统软件boot参数传递系统,该系统,包括:
内存地址写入模块,设置为在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址;以及
Boot参数得到模块,设置为在系统软件运行后,系统软件从设定的内存地 址得到所述boot参数。
可选地,还包括:
内存空间设定模块,设置为根据系统软件内存布局情况,设定一个内存空间用于存放boot参数;
内存地址分配模块,设置为在系统软件中给boot参数分配设定的内存地址;以及
内存地址描述加入模块,设置为在boot参数列表中加入boot参数的内存地址描述。
可选地,所述在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址,包括:
根据boot参数列表中的boot参数的内存地址描述,把传递给系统软件的boot参数写入设定的内存地址。
可选地,所述系统软件从设定的内存地址得到所述boot参数,包括:
系统软件从设定的内存地址得到BootLoader传递过来的boot参数,分析boot参数得到相应的信息和数据。
可选地,所述在系统软件中给boot参数分配预设的内存地址,包括:
在系统软件中,修改程序的链接脚本文件.ld,把分配给boot参数的预设的内存地址加入所述链接脚本文件.ld中;或
在系统软件中,通过C语言关键字定义分配给boot参数的预设的内存地址;或
在系统软件中,通过C语言编译选项的CGLAGS中的-D定义分配给boot参数的预设的内存地址。
另一方面,提供了一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述任一项所述的非linux系统软件boot参数传递方法。
本公开通过在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入内存地址;在系统软件运行后,系统软件根据所述内存地址得到所述boot参数。本公开为基于BootLoader与非linux系统的嵌入式系统软件提供了一种BootLoader与非linux系统软件信息及数据共享的方式,实现了通过BootLoader给非linux系统软件传递boot参数,保持了BootLoader与非linux系统软件里的相关信息及数据的一致性,方便统一管理相关信息和数据,降低了维护成本。
附图概述
下面将对本公开实施例描述中所需要使用的附图作简单的介绍,下面描述中的附图仅仅是本公开的一些实施例。
图1是具体实施方式中提供的一种非linux系统软件boot参数传递方法的第一实施例的方法流程图。
图2是具体实施方式中提供的一种非linux系统软件boot参数传递方法的第二实施例的方法流程图。
图3是具体实施方式中提供的一种非linux系统软件boot参数传递系统的第一实施例的结构方框图。
图4是具体实施方式中提供的一种非linux系统软件boot参数传递系统的第二实施例的结构方框图。
图5是具体实施方式中提供的一种电子设备的结构框图。
具体实施方式
下面将结合附图对实施例的技术方案作详细描述,所描述的实施例仅仅是一部分实施例,而不是全部的实施例。在不冲突的情况下,以下实施例和实施例中的特征可以相互组合。
请参考图1,是具体实施方式中提供的一种非linux系统软件boot参数传递方法的第一实施例的方法流程图。如图所示,该方法,包括:
在步骤S110中,在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址。
在系统软件运行之前,在BootLoader代码里增加boot参数传递的处理,把需要传递给系统软件的boot参数写入设定的内存地址中。
在步骤S120中,在系统软件运行后,系统软件从设定的内存地址得到所述boot参数。
在系统软件代码里增加boot参数的处理,在系统软件运行后,系统软件从设定的内存地址得到boot参数,分析boot参数得到相应的信息和数据。
综上所述,本实施例为基于BootLoader与非linux系统的嵌入式系统软件提供了一种BootLoader与非linux系统软件信息及数据共享的方式,通过BootLoader给非linux系统软件传递boot参数,保持了BootLoader与非linux系统软件里的相关 信息及数据的一致性,方便统一管理相关信息和数据,降低了维护成本。
请参考图2,是具体实施方式中提供的一种非linux系统软件boot参数传递方法的第二实施例的方法流程图。如图所示,该方法,包括:
在步骤S201中,根据系统软件内存布局情况,设定一个内存空间用于存放boot参数。
例如,假设嵌入式系统的内存大小为128M,可设定用于存放boot参数的内存空间为0x87f80000-0x87f8ffff。
在步骤S202中,在系统软件中给boot参数分配设定的内存地址;在boot参数列表中加入boot参数的内存地址描述。
所述在系统软件中给boot参数分配设定的内存地址,包括:
A1:在系统软件中,修改程序的链接脚本文件.ld,把分配给boot参数的设定的内存地址加入所述链接脚本文件.ld中,如下所示:
SECTIONS
{
...;//其他链接信息
_cmd_line_addr=0x87f80000;//要与boot参数里的地址一致
};或
A2:在系统软件中,通过C语言关键字定义分配给boot参数的设定的内存地址,如下所示:
#define CMD_LINE_ADDR 0x87f80000;或
A3:在系统软件中,通过C语言编译选项的CGLAGS中的-D定义分配给boot参数的设定的内存地址,如下所示:
CFLAGS+=-D CMD_LINE_ADDR=0x87f80000。
可以选择A1-A3中的任意一种方式在系统软件中给boot参数分配内存地址。所述设定的内存地址为步骤S201中设定的内存空间的起始点。
所述在boot参数列表中加入boot参数的内存地址描述,例如:设定一个参数用来描述boot参数的内存地址cmd_line_addr=0x87f80000,如下所示:
bootcmd=mtdparts=spi0.0:256k(boot),64k(bootargs),2944k(app),2432k(rootfs),1280k(data),64k(logo)
cmd_line_addr=0x87f80000。
所述内存地址描述对应于步骤S201中设定的内存空间的起始点。
在步骤S203中,在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址。
在系统软件运行之前,在BootLoader代码里增加boot参数传递的处理,把需要传递给系统软件的boot参数写入设定的内存地址中。
所述在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址,包括:根据boot参数列表中的boot参数的内存地址描述,把传递给系统软件的boot参数写入设定的内存地址。对应地,如下所示:
char*p_cmd_line_addr_value=NULL;
unsigned int cmd_line_addr=0;
p_cmd_line_addr_value=getenv(“cmd_line_addr”);
if(p_cmd_line_addr_value)
{
cmd_line_addr=simple_strtoul(p_cmd_line_addr_value);
}
if(0!=cmd_line_addr)
{
strcpy((char*)cmd_line_addr,getenv(“bootcmd”));
}。
在步骤S204中,在系统软件运行后,系统软件从设定的内存地址得到所述boot参数。
在系统软件代码里增加boot参数的处理,在系统软件运行后,系统软件根据所述设定的内存地址得到boot参数,分析boot参数得到相应的信息和数据。
所述系统软件从设定的内存地址得到所述boot参数,包括:系统软件从设定的内存地址得到BootLoader传递过来的boot参数,分析boot参数得到相应的信息和数据。对应地,如下所示:
extern char_cmd_line_addr[];
parse_cmd_line(_cmd_line_addr);//怎么解析需要根据需求进行。
本实施例为基于BootLoader与非linux系统的嵌入式系统软件提供了一种BootLoader与非linux系统软件信息及数据共享的方式,通过BootLoader给非linux系统软件传递boot参数,保持了BootLoader与非linux系统软件里的相关信息及数据的一致性,方便统一管理相关信息和数据,降低了维护成本。
以下是具体实施方式中提供的一种非linux系统软件boot参数传递系统的实施例,系统的实施例基于上述的方法的实施例实现,在系统中未尽的描述,请参考前述方法的实施例。
请参考图3,是具体实施方式中提供的一种非linux系统软件boot参数传递系统的第一实施例的结构方框图。如图所示,该系统,包括:
内存地址写入模块31,设置为在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址。以及
Boot参数得到模块32,设置为在系统软件运行后,系统软件从设定的内存地址得到所述boot参数。
综上所述,本实施例实现了通过BootLoader给非linux系统软件传递boot参数,使BootLoader与非linux系统软件之间相关信息及数据的共享更方面,并保持了相关信息及数据的一致性,方便统一管理相关信息和数据,降低了维护成本。
请参考图4,是具体实施方式中提供的一种非linux系统软件boot参数传递系统的第二实施例的结构方框图。如图所示,该系统,包括:
内存空间设定模块41,设置为根据系统软件内存布局情况,设定一个内存空间用于存放boot参数。
内存地址分配模块42,设置为在系统软件中给boot参数分配设定的内存地址。
所述在系统软件中给boot参数分配设定的内存地址,包括:
在系统软件中,修改程序的链接脚本文件.ld,把分配给boot参数的设定的内存地址加入所述链接脚本文件.ld中;或
在系统软件中,通过C语言关键字定义分配给boot参数的设定的内存地址;或
在系统软件中,通过C语言编译选项的CGLAGS中的-D定义分配给boot参数的设定的内存地址。
内存地址描述加入模块43,设置为在boot参数列表中加入boot参数的内存地址描述。
内存地址写入模块44,设置为在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址。
所述在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址,包括:根据boot参数列表中的boot参数的内存地址描述,把传递给系统软件的boot参数写入设定的内存地址。
Boot参数得到模块45,设置为在系统软件运行后,系统软件从设定的内存地址得到所述boot参数。
所述系统软件从设定的内存地址得到所述boot参数,包括:系统软件从设定的内存地址得到BootLoader传递过来的boot参数,分析boot参数得到相应的信息和数据。
综上所述,本实施例提供非linux系统软件boot参数传递系统实现了通过BootLoader给非linux系统软件传递boot参数,保持了BootLoader与非linux系统软件里的相关信息及数据的一致性,方便统一管理相关信息和数据,降低了维护成本。
本实施例提出了一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述任一实施例所述的非linux系统软件boot参数传递方法。
图5是具体实施方式中提供的一种电子设备的结构框图。本公开实施例提供的电子设备可以是包括:处理器(processor)51和存储器(memory)53,还可以包括通信接口(Communications Interface)52和总线54。其中,处理器51、通信接口52、存储器53可以通过总线54完成相互间的通信。通信接口52可以用于信息传输。处理器51可以调用存储器53中的逻辑指令,以执行上述实施例的非linux系统软件boot参数传递方法。
此外,上述的存储器53中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、磁碟或者光盘等各种可以存储程序代码的介质,也可以是暂态存储介质。
工业实用性
本公开通过在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入内存地址;在系统软件运行后,系统软件根据所述内存地址得到所 述boot参数。本公开为基于BootLoader与非linux系统的嵌入式系统软件提供了一种BootLoader与非linux系统软件信息及数据共享的方式,实现了通过BootLoader给非linux系统软件传递boot参数,保持了BootLoader与非linux系统软件里的相关信息及数据的一致性,方便统一管理相关信息和数据,降低了维护成本。

Claims (11)

  1. 一种非linux系统软件boot参数传递方法,包括:
    在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址;以及
    在系统软件运行后,系统软件从设定的内存地址得到所述boot参数。
  2. 根据权利要求1所述的一种非linux系统软件boot参数传递方法,其中,所述在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址之前,还包括:
    根据系统软件内存布局情况,设定一个内存空间用于存放boot参数;
    在系统软件中给boot参数分配设定的内存地址;以及
    在boot参数列表中加入boot参数的内存地址描述。
  3. 根据权利要求2所述的一种非linux系统软件boot参数传递方法,其中,所述在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址,包括:根据boot参数列表中的boot参数的内存地址描述,把传递给系统软件的boot参数写入设定的内存地址。
  4. 根据权利要求2所述的一种非linux系统软件boot参数传递方法,其中,所述系统软件从设定的内存地址得到所述boot参数,包括:
    系统软件从设定的内存地址得到BootLoader传递过来的boot参数,分析boot参数得到相应的信息和数据。
  5. 根据权利要求2所述的一种非linux系统软件boot参数传递方法,其中,所述在系统软件中给boot参数分配设定的内存地址,包括:
    在系统软件中,修改程序的链接脚本文件.ld,把分配给boot参数的设定的内存地址加入所述链接脚本文件.ld中;或
    在系统软件中,通过C语言关键字定义分配给boot参数的设定的内存地址;或
    在系统软件中,通过C语言编译选项的CGLAGS中的-D定义分配给boot参数的设定的内存地址。
  6. 一种非linux系统软件boot参数传递系统,包括:
    内存地址写入模块,设置为在系统软件运行前,在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址;以及
    Boot参数得到模块,设置为在系统软件运行后,系统软件从设定的内存地址得到所述boot参数。
  7. 根据权利要求6所述的一种非linux系统软件boot参数传递系统,还包括:
    内存空间设定模块,设置为根据系统软件内存布局情况,设定一个内存空间用于存放boot参数;
    内存地址分配模块,设置为在系统软件中给boot参数分配设定的内存地址;以及
    内存地址描述加入模块,设置为在boot参数列表中加入boot参数的内存地址描述。
  8. 根据权利要求7所述的一种非linux系统软件boot参数传递系统,其中,所述在BootLoader代码里把传递给系统软件的boot参数写入设定的内存地址,包括:
    根据boot参数列表中的boot参数的内存地址描述,把传递给系统软件的boot参数写入设定的内存地址。
  9. 根据权利要求7所述的一种非linux系统软件boot参数传递系统,其中,所述系统软件从设定的内存地址得到所述boot参数,包括:
    系统软件从设定的内存地址得到BootLoader传递过来的boot参数,分析boot参数得到相应的信息和数据。
  10. 根据权利要求7所述的一种非linux系统软件boot参数传递系统,其中,所述在系统软件中给boot参数分配预设的内存地址,包括:
    在系统软件中,修改程序的链接脚本文件.ld,把分配给boot参数的预设的内存地址加入所述链接脚本文件.ld中;或
    在系统软件中,通过C语言关键字定义分配给boot参数的预设的内存地址;或
    在系统软件中,通过C语言编译选项的CGLAGS中的-D定义分配给boot参数的预设的内存地址。
  11. 一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1-5任一项所述的方法。
PCT/CN2017/077986 2016-05-26 2017-03-24 非linux系统软件boot参数传递方法及系统 WO2017202128A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610356969.1 2016-05-26
CN201610356969.1A CN106020892A (zh) 2016-05-26 2016-05-26 一种非linux系统软件boot参数传递方法及系统

Publications (1)

Publication Number Publication Date
WO2017202128A1 true WO2017202128A1 (zh) 2017-11-30

Family

ID=57094322

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/077986 WO2017202128A1 (zh) 2016-05-26 2017-03-24 非linux系统软件boot参数传递方法及系统

Country Status (2)

Country Link
CN (1) CN106020892A (zh)
WO (1) WO2017202128A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162779A (zh) * 2020-09-23 2021-01-01 龙芯中科技术有限公司 参数传递的方法、装置、设备及计算机可读存储介质
CN112988133A (zh) * 2021-03-12 2021-06-18 麒麟软件有限公司 一种在引导阶段实现定制化功能及固定化函数地址的方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020892A (zh) * 2016-05-26 2016-10-12 深圳创维数字技术有限公司 一种非linux系统软件boot参数传递方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477471A (zh) * 2009-01-07 2009-07-08 杭州海康威视数字技术股份有限公司 一种嵌入式系统固件在线升级方法
CN101763279A (zh) * 2010-01-15 2010-06-30 上海维宏电子科技有限公司 一种BootLoader架构设计方法
US20110145807A1 (en) * 2008-06-02 2011-06-16 Awox Method and device for updating a computer application
CN102662717A (zh) * 2012-04-27 2012-09-12 深圳市掌讯通讯设备有限公司 一种嵌入式系统自引导启动方法
CN106020892A (zh) * 2016-05-26 2016-10-12 深圳创维数字技术有限公司 一种非linux系统软件boot参数传递方法及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541572B (zh) * 2010-12-08 2015-09-16 中兴通讯股份有限公司 一种实现操作系统内核引导的方法、系统及装置
US20140032826A1 (en) * 2012-07-25 2014-01-30 Samsung Electronics Co., Ltd. Method of training memory core and memory system
CN104216721A (zh) * 2013-05-31 2014-12-17 上海博达数据通信有限公司 一种在操作系统启动之前下发配置的方法

Patent Citations (5)

* 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
CN101477471A (zh) * 2009-01-07 2009-07-08 杭州海康威视数字技术股份有限公司 一种嵌入式系统固件在线升级方法
CN101763279A (zh) * 2010-01-15 2010-06-30 上海维宏电子科技有限公司 一种BootLoader架构设计方法
CN102662717A (zh) * 2012-04-27 2012-09-12 深圳市掌讯通讯设备有限公司 一种嵌入式系统自引导启动方法
CN106020892A (zh) * 2016-05-26 2016-10-12 深圳创维数字技术有限公司 一种非linux系统软件boot参数传递方法及系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162779A (zh) * 2020-09-23 2021-01-01 龙芯中科技术有限公司 参数传递的方法、装置、设备及计算机可读存储介质
CN112988133A (zh) * 2021-03-12 2021-06-18 麒麟软件有限公司 一种在引导阶段实现定制化功能及固定化函数地址的方法

Also Published As

Publication number Publication date
CN106020892A (zh) 2016-10-12

Similar Documents

Publication Publication Date Title
US10296217B2 (en) Techniques to configure a solid state drive to operate in a storage mode or a memory mode
US9880859B2 (en) Boot image discovery and delivery
US9933968B2 (en) Method, system, and device for modifying a secure enclave configuration without changing the enclave measurement
US20170277530A1 (en) Technologies for securing a firmware update
US10594800B2 (en) Platform runtime abstraction
WO2020001112A1 (zh) 一种支持多类型设备的平台的应用方法、移动终端
WO2017202128A1 (zh) 非linux系统软件boot参数传递方法及系统
CN109656844B (zh) 一种AT24xx EEPROM驱动方法和装置
CN110716845B (zh) 一种Android系统的日志信息读取的方法
CN109828774B (zh) 一种服务器系统及其启动方法
CN108021405B (zh) 一种soc系统启动过程中存储介质的驱动方法和装置
CN116382880B (zh) 任务执行方法、装置、处理器、电子设备及存储介质
CN103677745B (zh) 一种在龙芯主板中写入和读取设备标识的方法
CN110515671A (zh) 初始化方法、初始化装置、终端设备及可读存储介质
CN104714792A (zh) 多进程共享数据处理方法和装置
CN111913753A (zh) 一种windows系统云迁移中启动方式的变更方法及系统
US9003364B2 (en) Overriding system attributes and function returns in a software subsystem
WO2023060893A1 (zh) 存储空间管理方法、装置、设备及存储介质
CN111142972B (zh) 用于扩展应用程序的功能的方法、装置、系统及介质
US10216524B2 (en) System and method for providing fine-grained memory cacheability during a pre-OS operating environment
CN112540857B (zh) 处理工作量证明计算任务的方法、装置和系统
US10402454B1 (en) Obtaining platform-specific information in a firmware execution environment
CN110532040A (zh) 固件程序的加载方法及装置、存储介质和电子设备
WO2020221161A1 (zh) 计算作业处理方法、系统、移动设备及加速设备
CN114297135B (zh) 动态调整高速输入输出通道分配的方法、装置及存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17801975

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17801975

Country of ref document: EP

Kind code of ref document: A1