WinCE Eboot network function

WinCE Eboot network function

by: iSee

EBOOT generally used to download WinCE image through the network, means of Ethernet, of course, download through USB, but the network is the most commonly used to download the. In fact download BLCOMMON of the work is completed module, it will call OEMReadData function to download data, OEMReadData by the user to achieve the general network if it is downloaded directly OEMReadData will EbootEtherReadData function call to read data from the network, the function from Microsoft to achieve this function will OEMEthGetFrame function call to read data from the card, this function is to use a user card according to their own chip-driven part of the card.

Do not know if I did not understand the above said, in fact, in the EBOOT in, BLCOMMON is the top, in order to achieve the download, we need to achieve the related OEM download function, which function will be called OEM network WinCE functions to provide these functions in the "WINCE600publiccommonoakdriversethdbgeboot "Now, the code below this directory will be compiled into a library eboot.lib to provide a small TCP / IP protocol stack and TFTP services. Eboot.lib will call the underlying function of the network card driver card data transmission, and the bottom of the card driver or a number of OEM functions actually function to the user to achieve.

First to introduce the relevant OEM download EBOOT function:

1. LPBYTE OEMMapMemAddr (DWORD dwImageStart, DWORD dwAddr)

The flash function mainly alluding to the address RAM. WinCE image in the download time is written into the side edge of the download, due to slow write Flash, may affect the download, so the function of a buffer RAM, Flash address is mapped to RAM, so download was first on the RAM data buffer, and then write inside Flash. The function will be called OEMWriteFlash. dwImageStart written for WinCE image in the Flash of the starting address, dwAddr for the Bin file to write the initial address, the return value is mapped in RAM after the address.

2. BOOL OEMReadData (DWORD cbData, LPBYTE pbData)

This function in WinCE image, when downloaded for reading downloaded data, the general network to download, in which the function can be called directly EbootEtherReadData function. Of course, you can add the function to read and write the other way, for example, read from the SD card. cbData is the number of bytes to read, pbData is a Buffer, return TRUE for success.

3. Void OEMShowProgress (DWORD dwPacketNum)

The function used to display download progress is mainly a message to the user. Function which can be printed in the serial LED operation information or to tell users the status of the current download. dwPacketNum for the current packet has been downloaded a few.

To introduce the following network control functions:

1. BOOL EbootEtherReadData (DWORD cbData, LPBYTE pbData)

To read data from the network, it will be OEMReadData call, cbData is the number of bytes to read, pbData is a Buffer, return TRUE for success.

2. BOOL EbootInitEtherTransport (EDBG_ADDR * pEdbgAddr, LPDWORD pdwSubnetMask, BOOL * pfJumping, DWORD * pdwDHCPLeaseTime, UCHAR VersionMajor, UCHAR VersionMinor, char * szPlatformString, char * szDeviceName, UCHAR CPUId, DWORD dwBootFlags)

Used to initialize the network function, it will be OEMPreDownload function call. Address pEdbgAddr structure as a network adapter, including the IP address, mac address and port number. pdwSubnetMask for the subnet mask. Jump pfJumping for markers used to determine or direct download Jump implementation. pdwDHCPLeaseTime extension of time for the DHCP. VersionMinor for VersionMajor and version number. szPlatformString name as a platform. szDeviceName for the device name, the download time will be displayed in Platform Builder. CPUId for the processor Id. dwBootFlags should be set to 0.

3. EDBG_OS_CONFIG_DATA * EbootWaitForHostConnect (EDBG_ADDR * pDevAddr, EDBG_ADDR * pHostAddr)

The client PC function for waiting for the Platform Builder connection, and receive related services for the IP address and port number information, including the marker KITL, the function will be OEMLaunch calls. pDevAddr client's address for equipment, including IP address, MAC address and port number. Host-side pHostAddr for address information, including IP address, MAC address and port number. EDBG_OS_CONFIG_DATA return a structure, which contains address information of the various services and user configuration settings and other information.

Here are some of the OEM to achieve the network card driver function:

1. BOOL OEMEthSendFrame (BYTE * pData, DWORD dwLength)

The function used to send a data, it will be eboot.lib call to send data to the card. pData data buffer, dwLength for length. Return TRUE for success.

2. BOOL OEMEthGetFrame (BYTE * pData, UINT16 * pwLength)

The function for receiving a data call eboot.lib it will be to receive the data card. pData data buffer, dwLength for length. Return TRUE for success.

WinCE drivers for the card provides a template, the general development of the network card driver EBOOT will be packaged in accordance with the template to a function related to the specific card driver template function is defined as follows:

PFN_EDBG_INIT        pfnEDbgInit;       //
PFN_EDBG_ENABLE_INTS    pfnEDbgEnableInts;    //
PFN_EDBG_DISABLE_INTS    pfnEDbgDisableInts;   //
PFN_EDBG_GET_PENDING_INTS  pfnEDbgGetPendingInts;  //
PFN_EDBG_GET_FRAME     pfnEDbgGetFrame;     //
PFN_EDBG_SEND_FRAME     pfnEDbgSendFrame;    //
PFN_EDBG_READ_EEPROM    pfnEDbgReadEEPROM;    //eeprom
PFN_EDBG_WRITE_EEPROM    pfnEDbgWriteEEPROM;   //eeprom

The above definition can be found in the document halether.h is some function pointer, of course, there are some not listed, those used to support KITL, not introduced here. Generally in the EBOOT in the network adapter driver file ether.c to achieve, according to the need to achieve the above-mentioned template function related entities. OEMEthSendFrame and OEMEthGetFrame actually directly call pfnEdbgSendFrame and two pfnEdbgGetFrame function pointer to a function, at present, the majority of BSP achieved in the same way. pfnEdbgInit a function of the point usually used to initialize the network card has been called in OEMPlatformInit.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值