[go: up one dir, main page]

CN106843973B - A method of transplanting embedded system simultaneously starts in SD card - Google Patents

A method of transplanting embedded system simultaneously starts in SD card Download PDF

Info

Publication number
CN106843973B
CN106843973B CN201710052891.9A CN201710052891A CN106843973B CN 106843973 B CN106843973 B CN 106843973B CN 201710052891 A CN201710052891 A CN 201710052891A CN 106843973 B CN106843973 B CN 106843973B
Authority
CN
China
Prior art keywords
file
linux
kernel
card
subregion
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.)
Active
Application number
CN201710052891.9A
Other languages
Chinese (zh)
Other versions
CN106843973A (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.)
Beijing Jun Lan Network Technology Co Ltd
Original Assignee
Beijing Jun Lan Network Technology 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 Beijing Jun Lan Network Technology Co Ltd filed Critical Beijing Jun Lan Network Technology Co Ltd
Priority to CN201710052891.9A priority Critical patent/CN106843973B/en
Publication of CN106843973A publication Critical patent/CN106843973A/en
Application granted granted Critical
Publication of CN106843973B publication Critical patent/CN106843973B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system

Landscapes

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

Abstract

The invention discloses a kind of transplanting embedded system and in the method for SD card starting, including transplanting of the Linux on soft-core processor, the addition of self-defining device driving, configuration and the starting in SD card.Experiments have shown that can satisfy user's needs complicated and changeable using the SoPC that Linux is developed, and construct simply, quickly, shortens the development cycle of product.

Description

A method of transplanting embedded system simultaneously starts in SD card
Technical field
The present invention relates to embedded OS fields, more particularly to built-in Linux in particular hardware platform Transplanting and starting.
Background technique
Compared with other embedded OSs, built-in Linux have open source code, high stability, development cost are low, The features such as hardware supported multiplicity, portability, short development cycle, by academia, business circles, industry extensive concern.It is being embedded in Formula application aspect, 2.6 new version kernel of Linux provide stronger strong support, such as when to promotion, the response of break feature Between shortening, kernel seize the support of characteristic, the introducing of efficient dispatching algorithm etc., the especially promotion of real-time characteristic so that It is more widely applied in embedded systems.
SoPC (System On a Programmable Chip, programmable system on chip) is as a kind of special insertion Microsever system has merged the advantage of SoC and FPGA respectively, and has software and hardware in-system programmable components, can reduce, can expand It fills, scalable function, has been increasingly becoming an emerging technique direction.The core of SoPC be realized on FPGA it is embedded Microprocessor core, and how for specific microprocessor select suitable embedded OS be SoPC exploitation difficult point it One.
Summary of the invention
It is an object of the invention to propose a kind of method transplanting embedded system and starting in SD card, realize in Linux The additions of custom hardware device drives, the starting of system configuration and SD card.
It is as follows that the technical scheme adopted by the invention to solve the technical problem:
A method of transplanting embedded system simultaneously starts in SD card, comprising the following steps:
1) cross compilation environment is established
Using the method for cross compile, kernel and application program are compiled on host, generate target machine processing The executable binary digit stream file of device, this file download to target machine is run;It establishes to intersect for soft core microprocessor and compile Device is translated, source./settings.sh script is run, establishes cross compilation environment automatically;
2) hardware platform is established
A file is established for each application project, the hardware configuration of the engineering is saved, selects corresponding hardware platform, Kernel just can read the configuration file under project file folder, establish hardware platform using Linux-newplatform order, transport Row make menuconfig order, selects the hardware platform in Vendor/Product Selction option, will be at EDK The configuration file of generation is converted into the format that Linux can be identified, runs Linux-copy- under project file folder Autoconfig order is automatically performed format conversion, and copies under configuration file to selected project file folder;
3) addition self-defining device driving
Customized IP core is added in Linux configuration, key step is as follows:
Make equipment initialization function ddc.c associated with kernel setup first;
Then make device driver ddc_adapter.c associated with kernel setup;
The finally Kconfig file where modification device driver under catalogue, makes to can choose this when configuring kernel and sets Standby driving, thus selects customized device drives when configuring linux kernel;
4) linux kernel is configured
Graphical authoring tools make menuconfig order is run, kernel and system environments are configured.
In the device drives option of kernel setup, the consistent hardware device drivers of hardware configuration of selection and system, tool Body configures following items:
The selection of Block devices block device;
The selection of Misc device promiscuous device;
The selection of the Network device support network equipment;
The selection of Character devices character device;
The SD card of carry DOS file system, automatic log-on environment configurations, including following items:
The setting of System Settings system;
Core Applications kernel application;
Network Applications network application;
Miscellaneous Applications mixes application;
BusyBox configures the order in system kernel;
Successively execute order: make dep, make clean, make all establishes file dependence, removes old text Part compiles kernel, generates kernel image;
5) Linux configuration file is modified
The image file download that above-mentioned steps are generated normally logs in linux system, modification inittab text into SoPC Part directly initiates shell;Automatic running application program: modification rc file adds the order of application program herein, transports after starting The row order;Remove agetty option in customize Vendor/User Setting under Core Applications and Init option recompilates kernel, in the file system for making modification write-in Linux;
6) start Linux using SD card
Hardware bit stream file and image.elf are fabricated to ACE file, copied in SD card, configuration SD card starting Linux, by SD card subregion and formatting, then this file system of carry, steps are as follows:
(1) SD card being mounted in linux system, SD card is divided into 3 areas by operation order fdisk/dev/sda, and first Subregion stores system.ace file;Second subregion is the exchange partition Linux Swap, and third subregion stores root file system;
(2) it is ext2 file system, operation order: mke2fs/dev/sda3 that third subregion is formatted under Linux;/ Order :/dev/sda3/mnt/rootfs auto defaults, user, noauto 00 is inputted under etc/fstab;Carry should Catalogue: mount/mnt/rootfs copies root file system rootfs on the subregion of SD card to;
(3) it is FAT32 file system that the first subregion is formatted under Windows, and system.ace is copied to this subregion;
(4) it is exchange partition, operation order: mkswap/dev/sda2 that the second subregion is formatted under Linux.
(5) after ready, it is inserted into SD card, opens power supply, starts Linux from SD card.
Compared with the background technology, the present invention, what is had is following the utility model has the advantages that realizing Linux in the shifting of soft-core processor It plants, and successfully realizes the starting scheme of the addition of custom hardware device drives in Linux, system configuration and SD card.Pass through shifting Linux is planted, the SoPC developed herein is used directly for Practical Project;The transplanting of the embedded OS is quick, simple, and And since it is based on linux kernel, to ensure that the stability of system.
Specific embodiment
The preferred embodiment of the present invention is described further below.
After the completion of the building of SoPC hardware system, for the kernel of this structure configuration operating system, specific step is as follows:
1. establishing cross compilation environment
The method that embedded system development generally uses cross compile carries out kernel and application program that is, on host Compiling generates the executable binary digit stream file of target machine processor, this file download to target machine is run.Linux needle Cross-compiler is established to soft core microprocessor, runs source./settings.sh script, system can establish intersection automatically and compile Translate environment.
2. establishing hardware platform
A file is established for each application project, saves the hardware configuration of the engineering.When transplanting Linux, only need Corresponding hardware platform is selected, kernel just can read the configuration file under project file folder.Use Linux-newplatform Hardware platform is established in order, if using MMU (virtual memory management unit), then addition-m option after ordering herein.Hardware is flat After platform is set up, make menuconfig order is run, selects this hard in Vendor/Product Selction option Part platform.At this time, it also needs the configuration file generated at EDK being converted into the format that Linux can be identified.It is pressed from both sides in project file Lower operation Linux-copy-autoconfig order is automatically performed format conversion, and copies configuration file to selected engineering Under file.
3. adding self-defining device driving
The customized IP kernel of this system, therefore must develop driver and be added in Linux configuration.Addition is certainly It is as follows to define device drives key step:
Sentence is added in Makefile file under platform configuration catalogue first:
Platobj- $ (CONFIG_ETLOGIX_DDC) +=ddc.o
With
$(obj)/ddc.o:.config,
Keep equipment initialization function ddc.c associated with kernel setup;
Then sentence is added in the Makefile file under catalogue where driver:
Obj- $ (CONFIG_ETLOGIX_DDC) +=ddc_adapter.o,
Keep device driver ddc_adapter.c associated with kernel setup;
The finally Kconfig file where modification device driver under catalogue, makes to can choose this when configuring kernel and sets Standby driving, adds following sentence:
Shown option in config ETLOGIX_DDC//kernel setup catalogue
Bool " ETLogix DDC Driver " // config option is Boolean type, that is, has selection and do not select two states
Depends on MICROBLAZE//config option dependence
Pass through the modification of the above file, so that it may to select customized device drives when configuring linux kernel.
4. configuring linux kernel
The Scalability of linux kernel enables us to that kernel is easily passed through modification, cutting, Compiler to one In embedded system.Graphical authoring tools make menuconfig order is run, kernel and system environments are configured.
In the device drives option of kernel setup, has to selection and the consistent hardware device of hardware configuration of system drives It is dynamic, it will malfunction when otherwise kernel compiles.It is main to configure following items driving for the hardware configuration of this system:
[Block devices] block device selects Xilinx SystemACE support;
[Misc device] promiscuous device selects FSL FIFO driver, subsequently into FSL Channel Selection selects FIFO on FSL0;Device drives ETLogix DDC101Driver is added in selection certainly;[Network Device support] network equipment selection Ethernet (1000Mbit) submenu in Xilinx 10/100/1000LL TEMAC support;
[Character devices] character device selects the 8250/16550and in Serial drivers submenu Compatible serial support and Console on 8250/16550and compatible serial port;
In file system option, default choice ext2, romfs and cramfs file system, alternative document system can be with It voluntarily selects as needed.This system needs the SD card of carry DOS file system, therefore carries out following configuration:
[DOS/FAT/NT Filesystems] selects MSDOS fs support;
[Native Language Support] is selected Codepage 437 (United States, Canada);Kernel Other configurations in configuration can be saved after the completion of configuring and be exited according to the different flexible configurations of goal systems, automatically into System environments configuration menu.
System environments configuration is configured to the attribute of Linux, order, mainly there is following option:
The setting of [System Settings] system: network address, default username, the default modification logging of system are configured With the contents such as root file system used;
[Core Applications] kernel application: the common characteristic of main configuration kernel;
[Network Applications] network application: related command when Configuration network is applied;
[Miscellaneous Applications] mixes application: the order in configuration system kernel;
[BusyBox]: the order in configuration system kernel.
Linux has set compiling rule, therefore after the completion of configuration, successively executes order: make dep, make Clean, make all establish file dependence, remove old file, compile kernel, generate kernel image.
2.5 modification Linux configuration files
The image file download that above-mentioned steps generate can normally be logged in into linux system into SoPC, if using work Journey has particular/special requirement, can modify the file in generated file system.This system needs SoPC to power on rear automatic login system, and Therefore the application program of operation exploitation is configured as follows: modification inittab file, by ttyS0:vt100: latter modification For/bin/sh, in this way when kernel starts, there is no need to the username and passwords of input system to directly initiate shell;Automatic fortune Row application program: modification rc file adds the order of application program herein, will run the order after Linux starting.Modification Afterwards, also need to remove agetty option in customize Vendor/User Setting under Core Applications and Init option, otherwise, when recompilating kernel by the content of covering modification.After having modified configuration file, to recompilate interior Modification is written in the file system of Linux in core.
Linux kernel image file by compiling mainly has: image.bin, image.elf, image.ub.According to The difference of image file is selected, there are four types of start scheme by Linux: XMD downloading starting, TFTP network downloading starting, FLASH are opened The starting of dynamic and SD card.Wherein, XMD and TFTP network downloads starting scheme, must all re-download after each system electrification, fits For system debug;FLASH starting scheme reads configuration file, but FLASH programming speed from FLASH automatically upon power-up of the system Degree is slower, and change system configuration is more inconvenient;Therefore, this system selects SD card to start scheme.
Start Linux using SD card, is that hardware bit stream file and image.elf are fabricated to ACE file, copies to SD In card, configuration SD card starts Linux.ACE file is made, runs and orders in EDK Shell window:
Xmd-tcl genace.tcl (command tools)
- jprog-board ml402 (required development board)
- hw implementation/download.bit (the bitstream file of generation)
- elf image.elf (the executable net meter file that compiling linux kernel generates)
- ace system.ace (the ACE file that need to be generated)
After success, the ACE file for being suitable for ML-402 development board is just generated.
Linux, which is run, needs the support of root file system, it is the basic place of linux system, and when starting must load To support the operation of system.And do not include file system in image.elf, it therefore, must manual loading when being started using SD card File system.When compiling linux kernel, generated using romfs file as the file system of title, thus only need by SD card subregion and formatting, then this file system of carry, steps are as follows:
(1) SD card being mounted in linux system, SD card is divided into 3 areas by operation order fdisk/dev/sda, and first Subregion stores system.ace file;Second subregion is the exchange partition Linux Swap, and third subregion stores root file system.
(2) it is ext2 file system, operation order: mke2fs/dev/sda3 that third subregion is formatted under Linux;/ Order is inputted under etc/fstab :/dev/sda3/mnt/rootfs auto defaults, user, noauto 00 is (equipment Sda3 hangs over/mnt/rootfs file under, file system is the ext2 of default, ordinary user, can carry, not dump do not opening File system is scanned when dynamic);The carry catalogue: mount/mnt/rootfs can thus copy root file system rootfs On shellfish to the subregion of SD card.
(3) it is FAT32 file system that the first subregion is formatted under Windows, and system.ace is copied to this subregion.
(4) it is exchange partition, operation order: mkswap/dev/sda2 that the second subregion is formatted under Linux.
After ready, it is inserted into SD card, opens power supply, so that it may to start Linux from SD card.
A kind of built-in Linux operating system for soft-core processor is described herein, and is discussed in detail its kernel Configuration and starting scheme.By transplanting Linux, the SoPC developed herein is used directly for Practical Project;The embedded operation The transplanting of system is quick, simple, and since it is based on linux kernel, to ensure that the stability of system.Therefore, In There is great significance and good application prospect under the increasingly complicated background of SoPC application.
It should be understood that above-described embodiment is merely illustrative, the invention is not limited to the specific embodiments, are not taking off In the case where from spirit and scope of the invention, various improvement and modification can be made to the present invention.

Claims (1)

1. a kind of transplanting embedded system and the method started in SD card, comprising the following steps:
1) cross compilation environment is established
Using the method for cross compile, kernel and application program are compiled on host, generating target machine processor can The binary digit stream file of execution runs this file download to target machine;Cross-compiler is established for soft core microprocessor, Source./settings.sh script is run, establishes cross compilation environment automatically;
2) hardware platform is established
A file is established for each application project, the hardware configuration of the engineering is saved, selects corresponding hardware platform, kernel It just can read the configuration file under project file folder, establish hardware platform using Linux-newplatform order, run Make menuconfig order selects the hardware platform in Vendor/Product Selction option, will give birth at EDK At configuration file be converted into the format that Linux can identify, run Linux-copy-autoconfig under project file folder Order is automatically performed format conversion, and copies under configuration file to selected project file folder;
3) addition self-defining device driving
Customized IP core is added in Linux configuration, is had main steps that:
Make equipment initialization function ddc.c associated with kernel setup first;
Then make device driver ddc_adapter.c associated with kernel setup;
The finally Kconfig file under catalogue where modification device driver makes to can choose the equipment drive when configuring kernel It is dynamic, thus customized device drives are selected when configuring linux kernel;
4) linux kernel is configured
Graphical authoring tools make menuconfig order is run, kernel and system environments are configured;
In the device drives option of kernel setup, the consistent hardware device drivers of hardware configuration of selection and system are specifically matched Set following items:
The selection of Block devices block device;
The selection of Misc device promiscuous device;
The selection of the Network device support network equipment;
The selection of Character devices character device;
The SD card of carry DOS file system, automatic log-on environment configurations, including following items:
The setting of System Settings system;
Core Applications kernel application;
Network Applications network application;
Miscellaneous Applications mixes application;
BusyBox configures the order in system kernel;
Successively execute order: make dep, make clean, make all establishes file dependence, removes ancient deed, compiles Kernel is translated, kernel image is generated;
5) Linux configuration file is modified
The image file download that above-mentioned steps are generated normally logs in linux system into SoPC, modifies inittab file, Directly initiate shell;Automatic running application program: modification rc file adds the order of application program herein, and operation should after starting Order;Remove the agetty option and init in customize Vendor/User Setting under Core Applications Option recompilates kernel, in the file system for making modification write-in Linux;
6) start Linux using SD card
Hardware bit stream file and image.elf are fabricated to ACE file, copied in SD card, configuration SD card starts Linux, By SD card subregion and formatting, then this file system of carry, steps are as follows:
(1) SD card is mounted in linux system, SD card is divided into 3 areas, the first subregion by operation order fdisk/dev/sda Store system.ace file;Second subregion is the exchange partition Linux Swap, and third subregion stores root file system;
(2) it is ext2 file system, operation order: mke2fs/dev/sda3 that third subregion is formatted under Linux;In/etc/ Order :/dev/sda3/mnt/rootfs auto defaults, user, noauto 00 is inputted under fstab;The carry mesh Record: mount/mnt/rootfs copies root file system rootfs on the subregion of SD card to;
(3) it is FAT32 file system that the first subregion is formatted under Windows, and system.ace is copied to this subregion;
(4) it is exchange partition, operation order: mkswap/dev/sda2 that the second subregion is formatted under Linux;
(5) after ready, it is inserted into SD card, opens power supply, starts Linux from SD card.
CN201710052891.9A 2017-01-22 2017-01-22 A method of transplanting embedded system simultaneously starts in SD card Active CN106843973B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710052891.9A CN106843973B (en) 2017-01-22 2017-01-22 A method of transplanting embedded system simultaneously starts in SD card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710052891.9A CN106843973B (en) 2017-01-22 2017-01-22 A method of transplanting embedded system simultaneously starts in SD card

Publications (2)

Publication Number Publication Date
CN106843973A CN106843973A (en) 2017-06-13
CN106843973B true CN106843973B (en) 2019-11-19

Family

ID=59119714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710052891.9A Active CN106843973B (en) 2017-01-22 2017-01-22 A method of transplanting embedded system simultaneously starts in SD card

Country Status (1)

Country Link
CN (1) CN106843973B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502961A (en) * 2016-10-26 2017-03-15 合肥润客软件科技有限公司 A kind of operational approach for dsp software development system
CN107729091A (en) * 2017-11-30 2018-02-23 天津光电通信技术有限公司 Embedded system platform and linux kernel associated documents generation method based on Zynq
CN115238621B (en) * 2022-09-22 2023-01-20 深圳市国电科技通信有限公司 Migration method, migration apparatus, electronic device, and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202870301U (en) * 2012-10-24 2013-04-10 陕西科技大学 Embedded type portable combined navigation system
CN106293916A (en) * 2016-08-09 2017-01-04 中国地质大学(武汉) A kind of camera for multinuclear embedded platform drives implantation method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020083427A1 (en) * 2000-12-26 2002-06-27 Chen-Pang Li Embedded system capable of rapidly updating software and method for rapidly updating software of embedded system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202870301U (en) * 2012-10-24 2013-04-10 陕西科技大学 Embedded type portable combined navigation system
CN106293916A (en) * 2016-08-09 2017-01-04 中国地质大学(武汉) A kind of camera for multinuclear embedded platform drives implantation method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
U-Boot SD卡启动方式的移植分析与功能扩展;梁超, 杨峰, 雷鹏, 徐志刚;《现代电子技术》;20131015;全文 *

Also Published As

Publication number Publication date
CN106843973A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN100403258C (en) Embedded device integrated development system and using method thereof
Beckhoff et al. Go ahead: A partial reconfiguration framework
US20090064196A1 (en) Model based device driver code generation
CN102880498B (en) The method of virtual SD card on the device of Android system
US9459842B1 (en) Multivariable transfer functions
JP2008509483A5 (en)
JP2008509483A (en) Adapting software and firmware to unexpected / changing hardware environments
CN106843973B (en) A method of transplanting embedded system simultaneously starts in SD card
US8448151B2 (en) Method for binarizing initial script on operating system and operating method of binary script
CN103514018A (en) Method for remotely downloading programs based on STM32F4 controller
CN112415943A (en) IO port configuration device and method and PLC configuration software
Rothman et al. Harnessing the UEFI Shell: Moving the platform beyond DOS
KR20020032256A (en) Integrated Embedded System and Method for Realizing thereof
Beierlein et al. UML-based co-design for run-time reconfigurable architectures
Reznikov Creating tailored OS images for embedded systems using Buildroot
Sundararajan et al. XVPI: A portable hardware/software interface for virtex
Horta et al. Accelerating linux bash commands on fpgas using partial reconfiguration
DePriest A practical approach to rapid prototyping of sca waveforms
CN109388576A (en) A kind of artificial debugging tool based on AGDI interface
Zhou et al. Port embedded Linux to XUP Virtex-II Pro development board
KR100860991B1 (en) Method and apparatus for building media components and computer readable storage media used therefor
Koch et al. Hardware-acceleration of Java-implemented experiments on an open satellite.
Giometti Linux Device Driver Development Cookbook: Develop Custom Drivers for Your Embedded Linux Applications
Dillier A Boot-Manager Core for a Processor Network on FPGA
CN115525359A (en) Unified configuration system and method for domestic embedded operating system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant