Design and Implementation of embedded BootLoader based on network loading (1)

Source: Internet
Author: User

From the perspective of software structure, an embedded system is generally composed of three parts: BootLoader, BSP, operating system, and application. However, in some embedded systems, operating systems and applications are stored on devices other than the system, such as networks and hard disks. The entire system only has Boot Loader programs. Therefore, BootLoader is an important part of embedded system design.

In the guidance of embedded systems, there are three different loading methods according to the application storage location: solid state storage media, disks, and networks, each method has its own unique configuration and usage. The three methods have their own advantages and disadvantages. The solid state storage media startup method is generally applicable to embedded systems with ROM/FLASH, and is the preferred solution for most embedded devices, such as mobile phones and mp3, however, when applications are large, the disk startup method is also widely used to reduce the unit price of embedded devices. Typical applications include SDH telecom transmission network equipment tester ANT-20, network-based loading is the cheapest embedded device application solution. Applications are stored on the network server. When an embedded device is started, it only needs to be sent to the memory and run through the network, on the one hand, it can quickly solve the problem of application upgrade, on the other hand, it can also reduce the overall cost of embedded devices, and in the early stages of development, this method can also greatly improve the debugging speed, typical applications such as thin clients of embedded devices.

1. Network-based BootLoader solution design

This solution focuses on solving two problems: communication and connection between the embedded device and the server before it starts after power-on, and application download during startup of the embedded device. The former must be driven by embedded devices to achieve communication capabilities. Nic drivers must be implemented. The latter must download applications to the system memory and run them through the relevant protocol stack. This article focuses on the design of UDP/IP protocol stack-based (DHCP, TFIP, NFS) Loading solutions.

1.1 Design of NIC Driver in BooiLoader

Network adapters (NICS) are generally composed of Programmable Data Link controllers, Manchester encoding/decoder, transceiver interfaces, and control circuits, the Programmable Data Link controller consists of a microprocessor and a network management department, as shown in figure 1.

In the design of the BootLoader NIC Driver, there are three basic operations (This article uses the Realtek8139 Nic as an instance for detailed analysis ):

1) Nic Initialization

The work to be done is to initialize related hardware in the NIC, including the NIC interrupt vector settings, the ing between the NIC receiving and sending buffer in the memory, and the NIC data structure initialization.

2) send data packets

The sending and sending control part is responsible for sending frames. The sending part accepts the Manchester code data from the NBZ Manchester converter and sends the data to the media as allowed by the sending control part. The sent data is called TxD. The sending control part determines whether to send the message. This determination is based on the LAN management part and TxD.

3) receive data packets

The receiving and receiving control part is responsible for receiving frames. This part generates a signal indicating whether the network has a carrier, which is obtained from RxD. Therefore, signals on the network are fed to the receiver, and those on the receiving control. The receiving control module determines whether to enable the receiver to work based on the signals received by the LAN Management Module and the media.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.