【正文】
e Erase functions, it make the boot loader can download and erase the image at same time, it can improve efficiency of system, but normally the writing is implemented after erasing. 5) Ether controller function 6) Timer function: The timer function is OEMEthGetSecs( ) function, This function returns the number of seconds that have passed since a specified fixed time. 7) Initialization function: The initialization functions are implemented as the Eboot setup. . Optional OEM function There are there optional OEM functions in Eboot, these are shown as the following table. All the optional OEM functions are defined with point. All the functions are shown as the follow. 1) OEMCheckSignature( ):This function verifies the signature in the .bin file. 2) OEMMultiBINNotify( ):This function saves the number of .bin files to be downloaded and their addresses and sizes. 3) OEMVerifyMemory( ):This function verifies that the address provided is in valid memory. 5. Configure and create Boot Loader The source code of the boot loader is made up of code editing in C language and assembly language, and these codes are piled by Platform Builder. need some file to determine what source code is need to be pile and how to pile and link the sources code, and the directories to traverse. Therefore, programmer should edit the sources file, makefile file, Dirs file and file[3]. 1) Sources file: A sources file is a text file that sets the macro definitions for the source code in a subdirectory. uses these macro definitions to determine how to pile and link the source code. 2) Dirs file: The dirs file is a text file that specifies the subdirectories that contain source code to be built. The dirs files specify the sources files that contain source code to be built, and information on additional subdirectories that contain sources files. As the dirs file is not the importance of this section, it would not be detailed here. 3) Makefile file: Each subdirectory in a source code tree that includes a sources file also includes a makefile file, and in Platform Builder, the makefile file contains only the mon makefile file, . contains some linking rules, using the rules, piles the source code specified in the sources files or it links object modules. 4) : As we know, the source code is plied to be an .exe file, but the file that burn to flash is a binary image file, namely, the .bib file or .nb0 file. Using the file, the is conversed to .bib file or .nb0 file. Eboot is built to run out of RAM, though initially the location of the image may be in flash. This .bib file will create two different Eboot images of interest[2]: 6. Conclusion In this design, serial port is used to debug boot loader with DNW software, just as shown as Figure 6. From this figure, boot loader configuration is exported from the serial port. After configuration, we choose “Download image now”, then set the “Connectivity Options” (in Platform Build Menu), execute “Attach Device” mand in order to download the image file, as shown as Figure 7. From Figure 7, we can know the boot loader designed in this paper runs well, it can plete the task of downloading image. Basing on Windows CE embedded operating system and S3C2410X processor boot loader have already worked in EPS system successfully now. The boot loader depends on CPU performance, the peripherals devices and the operating system adopted much, as a result, the design process above isn39。一個(gè)基于嵌入式處理器的電動(dòng)助力轉(zhuǎn)向系統(tǒng)和嵌入式操作系統(tǒng)已被開發(fā)。 啟動(dòng)加載器 主要是由 OEM啟動(dòng)代碼和主代碼為主,它是用來連接硬件和操作系統(tǒng)的。 介紹 由于 EPS系統(tǒng)有許多優(yōu)點(diǎn),例如:環(huán)保、節(jié)能、安全等,從液壓動(dòng)力轉(zhuǎn)向系統(tǒng)到電動(dòng)助力轉(zhuǎn)向系統(tǒng)的轉(zhuǎn)化將會(huì)很快。現(xiàn)在大量的第三供應(yīng)商為Windows CE 提供周邊發(fā)展套件。 啟動(dòng)加載器 通常從工作站下載操作系統(tǒng)圖片到目標(biāo)設(shè)備。當(dāng)車輪轉(zhuǎn)方向時(shí),傳感器收集扭矩信號和速度信號并將它們送到 S3C2410X,微控制器通過控制原則決定目標(biāo)電流和汽車旋轉(zhuǎn)的方向,并通過 H 橋電路驅(qū)動(dòng)汽車轉(zhuǎn)動(dòng)。 啟動(dòng)加載器 啟動(dòng)加載器 是在目標(biāo)設(shè)備的一些代碼。Eboot 有以太網(wǎng)功能,例如 UDP、 DHCP、TFTP程序等。 ( 1) 初始化硬件:包括初始化內(nèi)存,中斷控制器,時(shí)鐘和 MMU等。啟動(dòng)加載器將會(huì)使自己從一個(gè)地方移動(dòng)到另一個(gè)地方以便在這一部進(jìn)行更方便的訪問。盡早使用調(diào)試端口也可以幫助調(diào)試啟動(dòng)加載器本身。啟動(dòng)時(shí), NAND的第一個(gè) 4kb 內(nèi)存將會(huì)被加載到起步階段,且啟動(dòng)代碼也將被加載到起步階段。啟動(dòng)加載器的這一部分是用匯編語言。當(dāng)異常情況發(fā)生時(shí) ,程序跳到異常載體名單,同時(shí)切換到相應(yīng)的功能。如果中斷沒被應(yīng)用,則該功能應(yīng)當(dāng)被指向一個(gè)循環(huán)以便避免由錯(cuò)誤中斷引起的混亂。但是一般來說, Startup( )函數(shù)完成如下任務(wù): ( 1) 設(shè)置 CPU處于監(jiān)管模式,在這種模式下內(nèi)存和硬件可以沒有限制的訪問 ( 2) 保護(hù) CPU抵御所有中斷 ( 3) 關(guān)閉 MMU和 TLB ( 4) 是高速緩存和寫緩存失效 ( 5) 初始化內(nèi)存控制器 ( 6) 初始化芯片上的其他設(shè)備,如時(shí)鐘 ( 7) 設(shè)置并打開 MMU以映射物理地址到邏輯地址,并打開高速緩存 ( 8) 復(fù)制 Eboot代碼到 RAM,并跳到 RAM中的 Eboot代碼 ( 9) 跳到 main()函數(shù) Startup( )函數(shù)只執(zhí)行完成初始化任務(wù)的最基本任務(wù),然后跳到 main()函數(shù)。 BootloaderMain( )就是為啟動(dòng)加載器實(shí)現(xiàn)一個(gè)共同的、一致的框架。 OEMPlatformInit( )函數(shù)是用來完成特定平臺的初始化,如時(shí)鐘,驅(qū)動(dòng)程序和運(yùn)輸初始化。該函數(shù)與運(yùn)輸中介無關(guān)。 (8) OEMShowProgress:此功能是在一個(gè) LED 顯示視覺信息,例如,讓用戶知道下載正在進(jìn)行中。根據(jù)這個(gè)調(diào)用的結(jié)果,被下載的 OS 映像可能就是隱藏內(nèi)存,例如,閃存的更新是通過提供一個(gè)基于 RAM的文件緩存區(qū)支持下載來完成的。 (14) OEMContinueEraseFlash:被每 個(gè)運(yùn)行時(shí)圖像所調(diào)用。 OEM函數(shù)有兩個(gè)功能,一個(gè)是需要功能,另一個(gè)是可選功能。 ( 2)調(diào)試 功能 :調(diào)試 功能 的主要任務(wù)是傳送一些信息,并跟蹤程序的可執(zhí)行文件,同時(shí)與用戶溝通。 ( 5)以太網(wǎng)控制器功能 ( 6)定時(shí)器功能:定時(shí)器功能是 OEMEthGetSecs( )函數(shù),該函數(shù)返回由指定的固定時(shí)間開始所經(jīng) 過的秒數(shù)。這 需要一些文件以確定哪些源代碼需要被編 譯,以及如何編譯和鏈接源代碼、遍歷目錄。 ( 3) 工程文件:在包括一個(gè)源文件的源代碼樹中,每一個(gè)子目錄也包含一個(gè)工程文件,在創(chuàng)建平臺,工程文件只包含常見的工程文件 ,它包含一些鏈接規(guī)則,使用規(guī)則,源代碼中指定的源文件或者鏈接對象模塊。 從圖 7中,我們知道啟動(dòng)加載器運(yùn)行良好,它可以完成下載任