CN103914309A - Method for setting IP (Internet Protocol) and MAC (Media Access Control) addresses based on embedded system platform - Google Patents

Method for setting IP (Internet Protocol) and MAC (Media Access Control) addresses based on embedded system platform Download PDF

Info

Publication number
CN103914309A
CN103914309A CN201210591908.5A CN201210591908A CN103914309A CN 103914309 A CN103914309 A CN 103914309A CN 201210591908 A CN201210591908 A CN 201210591908A CN 103914309 A CN103914309 A CN 103914309A
Authority
CN
China
Prior art keywords
address
mac address
target machine
mac
nonvolatile 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.)
Pending
Application number
CN201210591908.5A
Other languages
Chinese (zh)
Inventor
徐�明
黄保垒
赵根学
徐宁
董延军
韩春阳
郝玉锴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
AVIC No 631 Research Institute
Original Assignee
AVIC No 631 Research Institute
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 AVIC No 631 Research Institute filed Critical AVIC No 631 Research Institute
Priority to CN201210591908.5A priority Critical patent/CN103914309A/en
Publication of CN103914309A publication Critical patent/CN103914309A/en
Pending legal-status Critical Current

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention discloses a method for setting IP (Internet Protocol) and MAC (Media Access Control) addresses based on an embedded system platform. The method comprises the steps of: a) selecting an idle sector from a nonvolatile memory of a target machine; s) writing an IP address and an MAC address from the selected idle sector; 3) modifying an interface function for acquiring the address in the driving layer of the target machine, and the function of the modified interface function is that the CPU (Central Processing Unit) of the target machine reads the IP address and the MAC address from the idle sector; 4) generating a target code by compiling and connecting modified codes and curing the target code in the nonvolatile memory; and 5) electrifying the target machine, initializing a network card and finishing the address set. According to the method, the technical problem that an existing method for setting the IP and MAC addresses can waste time and influence the life of large areas of the nonvolatile memory, the IP and MAC addresses of the network card of the target machine can be quickly modified, a mass of debug time can be saved, and the life of the nonvolatile memory of the target machine can be prolonged.

Description

A kind of IP, MAC Address method to set up based on embedded system platform
Technical field
The invention belongs to embedded drive software development field, be specifically related to a kind of IP, MAC Address method to set up based on embedded system platform.
Background technology
In embedded system development, most of target machine all can configuration network function.Wherein in configuration network function, need to arrange IP and the MAC Address of network interface card.In current embedded OS platform if VxWorks, day arteries and veins etc. are to configure in Static Configuration Files to the configuration of network interface card IP and MAC Address, then build whole driver (have comprise whole OS layer) and by binary file be cured in target machine nonvolatile memory just can Offered target machine network interface card IP and MAC Address (as shown in Figure 1).But debugging or often wanting modifying target machine network interface card IP address or MAC Address during in user's outfield experiments, but modification IP address or MAC Address need to recompilate whole driver, and the binary file that need to solidify whole driver.This has not only wasted a large amount of time, and has a huge impact for the life-span of the nonvolatile memory large area region of target machine.
Summary of the invention
In order to solve existing IP, MAC Address method to set up is lost time, and can affect the technical matters in the life-span of nonvolatile memory large area region, the invention provides in a kind of IP based on embedded system platform, MAC Address method to set up, the method can Modify rapidly target machine network interface card IP and MAC Address, save a large amount of debug times, extended the life-span of target machine nonvolatile memory.
Technical solution of the present invention:
IP based on embedded system platform, a MAC Address method to set up, its special character is: comprise the following steps:
1] select a free sector from the nonvolatile memory of target machine;
2] write IP address and MAC Address in selected free sector;
3] modifying target machine drives the interface function that obtains address in layer, and the function of amended interface function is: target machine CPU reads IP address and MAC Address from free sector;
4] amended code compilation connects generation object code and is solidificated in non-volatile memory district;
5] target machine powers on, network interface card IP address and MAC Address setting:
5.1] target machine CPU reads the IP address and the MAC Address that write from free sector;
5.2] target machine reads CPU IP address and MAC Address write the configuration address in network interface card;
5.3] setting completed for the IP address of network interface card and MAC Address.
Above-mentioned steps 2] also comprise encryption:
Write IP address in selected free sector and MAC Address is encrypted;
Corresponding step 3] also comprise increase decrypted code:
Step 5.1] also comprise decryption processing:
Target machine CPU reads the IP address and the MAC Address that write from free sector, IP address and MAC Address are decrypted to processing.
Above-mentioned nonvolatile memory is FLASH storer.
The present invention has advantages of:
1, IP provided by the present invention address and MAC Address method, directly write IP address and MAC Address and can realize the setting of network interface card IP address and MAC Address by revising free sector, whole setting up procedure, only need to solidify once whole driving object code, save a large amount of debug times; Avoided in existing method, owing to repeatedly solidifying the damage that nonvolatile memory is produced, having extended the serviceable life of nonvolatile memory simultaneously.
2, the present invention has carried out encryption in the time writing IP address and MAC Address, and address setup procedure is safe and reliable.
Accompanying drawing explanation
Fig. 1 is existing embedded platform IP and MAC Address setting up procedure schematic diagram;
Fig. 2 is IP of the present invention address and MAC Address setting up procedure schematic diagram.
Embodiment
IP based on embedded system platform, a MAC Address method to set up, comprise the following steps:
1] select a free sector from the nonvolatile memory of target machine;
2] write IP address and MAC Address in selected free sector;
3] modifying target machine drives the interface function that obtains address in layer, generates amended code;
Wherein the function of amended interface function is: target machine CPU reads IP address and MAC Address from free sector;
4] amended code is compiled and connects generation driving object code and be solidificated in non-volatile memory district;
5] target machine powers on, network interface card IP address and MAC Address setting:
5.1] target machine CPU reads the IP address and the MAC Address that write from free sector;
5.2] target machine reads CPU IP address and MAC Address write the configuration address in network interface card;
5.3] setting completed for the IP address of network interface card and MAC Address.
Also can be optimized for:
Step 2] also comprise encryption: write IP address in selected free sector and MAC Address is encrypted;
Corresponding step 3] also comprise increase decrypted code:
Step 5.1] also comprise decryption processing: target machine CPU reads the IP address and the MAC Address that write from free sector, IP address and MAC Address are decrypted to processing.
Nonvolatile memory is generally preferably FLASH storer.
Drive before initialization network interface card the IP of target machine and MAC Address can be written in to nonvolatile memory in free sector.When at initialization network interface card, from nonvolatile memory, IP address and MAC Address are read in fixing address, carry out initialization.While revising IP and MAC, only need write corresponding IP address and MAC Address in free sector and without curing whole driving object code at every turn, target machine at every turn from the IP address that writes and MAC Address read and can realize NIC address setting.Detailed process as shown in Figure 2.

Claims (3)

1. the IP based on embedded system platform, a MAC Address method to set up, is characterized in that: comprise the following steps:
1] select a free sector from the nonvolatile memory of target machine;
2] write IP address and MAC Address in selected free sector;
3] modifying target machine drives the interface function that obtains address in layer, generates amended code;
Wherein the function of amended interface function is: target machine CPU reads IP address and MAC Address from free sector;
4] amended code is compiled and connects generation driving object code and be solidificated in nonvolatile memory;
5] target machine powers on, network interface card IP address and MAC Address setting:
5.1] target machine CPU reads the IP address and the MAC Address that write from free sector;
5.2] target machine reads CPU IP address and MAC Address write the configuration address in network interface card;
5.3] setting completed for the IP address of network interface card and MAC Address.
2. IP, the MAC Address method to set up based on embedded system platform according to claim 1, is characterized in that: described step 2] also comprise encryption: write IP address in selected free sector and MAC Address is encrypted;
Described step 3] also comprise increase decrypted code;
Described step 5.1] also comprise decryption processing: target machine CPU reads the IP address and the MAC Address that write from free sector, IP address and MAC Address are decrypted to processing.
3. IP, the MAC Address method to set up based on embedded system platform according to claim 1 and 2, described nonvolatile memory is FLASH storer.
CN201210591908.5A 2012-12-29 2012-12-29 Method for setting IP (Internet Protocol) and MAC (Media Access Control) addresses based on embedded system platform Pending CN103914309A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210591908.5A CN103914309A (en) 2012-12-29 2012-12-29 Method for setting IP (Internet Protocol) and MAC (Media Access Control) addresses based on embedded system platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210591908.5A CN103914309A (en) 2012-12-29 2012-12-29 Method for setting IP (Internet Protocol) and MAC (Media Access Control) addresses based on embedded system platform

Publications (1)

Publication Number Publication Date
CN103914309A true CN103914309A (en) 2014-07-09

Family

ID=51040014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210591908.5A Pending CN103914309A (en) 2012-12-29 2012-12-29 Method for setting IP (Internet Protocol) and MAC (Media Access Control) addresses based on embedded system platform

Country Status (1)

Country Link
CN (1) CN103914309A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106506714A (en) * 2016-09-30 2017-03-15 深圳市和芯润德科技有限公司 USB turns the collocation method of ethernet nic, the network equipment
CN107770299A (en) * 2017-10-24 2018-03-06 郑州云海信息技术有限公司 A kind of MAC Address writes with a brush dipped in Chinese ink method, system, device and storage medium
CN109345803A (en) * 2018-09-25 2019-02-15 浙江凯耀照明股份有限公司 A kind of fast automatic method and its mechanism for generating random address code
CN109451098A (en) * 2019-01-16 2019-03-08 郑州云海信息技术有限公司 FPGA accelerator card MAC Address configuration method, device and accelerator card
CN112231013A (en) * 2020-10-14 2021-01-15 天津津航计算技术研究所 Method for establishing target server after IP address is changed by embedded VxWorks system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1614937A (en) * 2004-11-29 2005-05-11 清华大学 Automatic distributing and acquiring method based on network computer configurating parameter
CN101135889A (en) * 2007-09-30 2008-03-05 重庆邮电大学 EPA on-site controller based on SOPC
CN101599033A (en) * 2009-07-15 2009-12-09 王颖 Method for restoring system backup and device
CN102542223A (en) * 2010-12-08 2012-07-04 中国电信股份有限公司 Card reader, and file transmission method and module

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1614937A (en) * 2004-11-29 2005-05-11 清华大学 Automatic distributing and acquiring method based on network computer configurating parameter
CN101135889A (en) * 2007-09-30 2008-03-05 重庆邮电大学 EPA on-site controller based on SOPC
CN101599033A (en) * 2009-07-15 2009-12-09 王颖 Method for restoring system backup and device
CN102542223A (en) * 2010-12-08 2012-07-04 中国电信股份有限公司 Card reader, and file transmission method and module

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李廷均: "嵌入式网络设备的MAC及IP地址设置", 《单片机与嵌入式系统应用》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106506714A (en) * 2016-09-30 2017-03-15 深圳市和芯润德科技有限公司 USB turns the collocation method of ethernet nic, the network equipment
CN106506714B (en) * 2016-09-30 2019-12-17 深圳市和芯润德科技有限公司 Configuration method for USB-to-Ethernet network card and network equipment
CN107770299A (en) * 2017-10-24 2018-03-06 郑州云海信息技术有限公司 A kind of MAC Address writes with a brush dipped in Chinese ink method, system, device and storage medium
CN109345803A (en) * 2018-09-25 2019-02-15 浙江凯耀照明股份有限公司 A kind of fast automatic method and its mechanism for generating random address code
CN109451098A (en) * 2019-01-16 2019-03-08 郑州云海信息技术有限公司 FPGA accelerator card MAC Address configuration method, device and accelerator card
CN112231013A (en) * 2020-10-14 2021-01-15 天津津航计算技术研究所 Method for establishing target server after IP address is changed by embedded VxWorks system
CN112231013B (en) * 2020-10-14 2023-06-02 天津津航计算技术研究所 Method for establishing target server after IP address is changed by embedded VxWorks system

Similar Documents

Publication Publication Date Title
CN103914309A (en) Method for setting IP (Internet Protocol) and MAC (Media Access Control) addresses based on embedded system platform
CN102236621B (en) Computer interface information configuration system and method
CN108345773B (en) Code protection method and device based on virtual machine, electronic equipment and storage medium
CN100570558C (en) A kind of chip firmware updating method
CN1288572C (en) Data processing unit and method for controlling overwrited by non-volatility storage device
CN103984910A (en) System partitioning hiding method
CN105302568A (en) Method for establishing Web development framework and Web development framework
CN104866778A (en) Document safety access control method and device based on Linux kernel
CN103645920A (en) Embedded system program burning method and system
CN104077118A (en) Resource customization method and resource customization device of application program
JP7012074B2 (en) Virtual disk expansion method and equipment
WO2016078263A1 (en) Upgrading control device and terminal, terminal upgrading method and system, and storage medium
JP5721901B2 (en) Encryption of memory devices with wear leveling
CN102479091B (en) Method and device for running software and moveable storage medium
CN103745167A (en) IAP method and device of single chip microcomputer
CN105159716A (en) Memory device initialization method and electronic equipment
CN104461859A (en) Emulator and method for supporting NVM soft breakpoint debugging
CN110716721A (en) TMS320C6748 program loading method compatible with network port and serial port
CN104133706A (en) Firmware modifying method and device
CN103593301A (en) Bad block management method and system
CN103761118B (en) A kind of smart card and the method for smartcard internal administration application
TW201003522A (en) Booting method of computer system
JP5759827B2 (en) MEMORY SYSTEM, INFORMATION PROCESSING DEVICE, MEMORY DEVICE, AND MEMORY SYSTEM OPERATION METHOD
US11003758B2 (en) Information processing method, information processing device, program, and recording medium
CN112912743B (en) Calculation force control method, device, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140709

WD01 Invention patent application deemed withdrawn after publication