日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
使用Uboot引導vmlinux的簡易教程(uboot引導vmlinux)

在嵌入式開發(fā)中,Uboot作為一個開源的引導載入程序,其功能不僅僅是引導系統(tǒng),還可以下載內(nèi)核代碼,配置系統(tǒng)參數(shù),并進行其他關鍵性操作。在實際項目中,Uboot被廣泛使用,特別是在Linux嵌入式開發(fā)領域中。

本文將簡單介紹如何使用Uboot引導vmlinux。本文概述如下:

1. 準備工作

2. 下載vmlinux

3. 下載交叉編譯工具鏈

4. 編譯生成Uboot

5. 編寫Uboot腳本

6. 運行Uboot

7. 結論

1. 準備工作

請確保您已經(jīng)安裝了以下開發(fā)平臺:

? Ubuntu 16.04 64-bit 操作系統(tǒng)

? TFTP和DHCP服務器

? 串口終端

? JTAG調(diào)試器

我們將使用這些工具來下載內(nèi)核代碼、交叉編譯工具鏈和Uboot源代碼,以及執(zhí)行Uboot腳本。

2. 下載vmlinux

接下來,請下載你需要引導的內(nèi)核代碼,比如vmlinux。

3. 下載交叉編譯工具鏈

接下來,你需要下載交叉編譯工具鏈,這個工具鏈可以幫助你將x86或者其他主機編譯出來的代碼編譯成嵌入式設備可執(zhí)行的代碼。

以ARM平臺為例,您可能需要下載arm-linux-gcc交叉編譯工具鏈。通過以下命令下載交叉編譯工具鏈:

sudo apt-get install gcc-arm-linux-gnueabi

4. 編譯生成Uboot

接下來,請下載一個Uboot源代碼。你需要從Uboot的官方網(wǎng)站上下載最新的源代碼,并使用交叉編譯工具鏈編譯成可執(zhí)行的二進制文件。

以ARM平臺為例,您可以使用以下命令生成Uboot:

$ make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm distclean

$ make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm mx6ull_14x14_evk_defconfig

$ make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm

運行上述命令,就可以在Uboot文件夾下生成一個名為“u-boot.bin”的二進制文件。

5. 編寫Uboot腳本

接下來,您需要編寫一個Uboot腳本,以便將Uboot拷貝到目標設備上,并引導vmlinux。

一個簡單的Uboot腳本可能類似于以下內(nèi)容:

tftp 0x202300 /tftpboot/u-boot.bin

nand erase 0 80000

nand write 0x202300 0 80000

tftp 0x300000 /tftpboot/vmlinux.bin

bootm 0x300000

請確保你的腳本中的命令正確,檢查路徑和IP地址是否正確。

6. 運行Uboot

現(xiàn)在,您可以將Uboot二進制文件和Uboot腳本拷貝到目標設備上,并啟動目標設備。具體的啟動過程因設備而異,可能需要您參考設備手冊。

當您成功運行Uboot,并通過它引導vmlinux內(nèi)核時,屏幕或串口終端上應該顯示出Linux內(nèi)核的啟動日志。

7. 結論

以上介紹了如何使用Uboot引導vmlinux內(nèi)核的簡易教程。雖然本文提供的是一個簡單的例子,但這可以幫助您在實際嵌入式開發(fā)項目中更好地使用Uboot,以便正確引導Linux內(nèi)核并運行項目。如果需要做更詳細和復雜的操作,還需要進一步掌握Uboot的使用和配置。

成都網(wǎng)站建設公司-創(chuàng)新互聯(lián),建站經(jīng)驗豐富以策略為先導10多年以來專注數(shù)字化網(wǎng)站建設,提供企業(yè)網(wǎng)站建設,高端網(wǎng)站設計,響應式網(wǎng)站制作,設計師量身打造品牌風格,熱線:028-86922220

mkimage制作linux內(nèi)核映像 即uImage是怎么制作的

bootm命令是用來引導經(jīng)過u-boot的工具mkimage打包后的kernel image的,什么叫做經(jīng)過u-boot的工具mkimage打包后的kernel image,這個就要看mkimage的代碼,看看它做了些什么,雖然我很希望大家不要偷懶,認真地去看看,但是我知道還是有很多人懶得去做這件,那么我就j將分析mkimage代碼后得到的總結告訴大家,mkimage做了些什巧梁么,怎么用這個工具。

mkimage的用法

uboot源代碼的tools/目錄下有mkimage工具,這個工具可以用來制作不壓縮或者壓縮的多種可啟動映象文件。

mkimage在制作映象文件的時候,是在原來的可執(zhí)行映象文件的前面加上一個0x40字節(jié)的頭,記錄參數(shù)所指定的信息,這樣uboot才能識別這個映象是針對哪個CPU體系結構的,哪個OS的,哪種類型,加載內(nèi)存中的哪個位置, 入口點在內(nèi)存的那個位置以及映象名是什么

root@Glym:/tftpboot# ./mkimage

Usage: ./mkimage -l image

-l ==> list image header information

./mkimage -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file image

-A ==> set architecture to ‘a(chǎn)rch’

-O ==> set operating system to ‘os’

-T ==> set image type to ‘type’

-C ==> set compression type ‘comp’

-a ==> set load address to ‘a(chǎn)ddr’ (hex)

-e ==> set entry point to ‘ep’ (hex)

-n ==> set image name to ‘name’

-d ==> use image data from ‘datafile’

-x ==> set XIP (execute in place)

參數(shù)說明:

-A 指定CPU的體系結構:

取值 表示的體系結構

alpha Alpha

arm ARM

x86 Intel x86

ia64 IA64

mips MIPS

mips64 MIPS 64 Bit

ppc PowerPC

s390 IBM S390

sh SuperH

sparc SPARC

sparc64 SPARC 64 Bit

m68k MC68000

-O 指定操作系統(tǒng)類型正缺,可以取以下值:

openbsd、netbsd、freebsd、4_4bsd、linux、svr4、esix、solaris、irix、sco、dell、ncr、lynxos、vxworks、psos、qnx、u-boot、rtems、artos

-T 指定映象類型,可以取以下值舉寬辯:

standalone、kernel、ramdisk、multi、firmware、script、filesystem

-C 指定映象壓縮方式,可以取以下值:

none 不壓縮

gzip 用gzip的壓縮方式

bzip2 用bzip2的壓縮方式

-a 指定映象在內(nèi)存中的加載地址,映象下載到內(nèi)存中時,要按照用mkimage制作映象時,這個參數(shù)所指定的地址值來下載

-e 指定映象運行的入口點地址,這個地址就是-a參數(shù)指定的值加上0x40(因為前面有個mkimage添加的0x40個字節(jié)的頭)

-n 指定映象名

-d 指定制作映象的源文件

mkimage

解壓內(nèi)核源碼包,編輯Makefile

設置 cross_compile:= ;這個絕對路徑既上面2.95.3放到的路徑

進入內(nèi)核文件夾,執(zhí)行下面命令

# make clean

# make dep

# make

# /bin/arm-linux-objcopy -O binary -S vmlinux linux.bin ;編譯器的絕對路徑也是上面說到的路徑

# gzip linux.bin

下面的比較重要了,主要是u-boot的安裝,這個在H9200的手冊上說的很不清楚

# tar xzvf u-boot-1.0.0.tar.gz ;解壓u-boot

# cd u-boot-1.0.0

# make distclean

# make at91rm9200dk_config

# make all

然后在/usr/local下建立uboot文件夾將u-boot-1.0.0下的所有文件都復制到uboot下

# /tools/mkimage -A arm -O linux -C gzip -a 0xe 0xd linux.bin.gz uImage;這里的絕對路徑是/usr/local/uboot

vmlinux linux.bin linux.bin.gz uImage(uboot制作的image)

mkimage -a -e

-a參數(shù)后是內(nèi)核的運行地址,-e參數(shù)后是入口地址。

1)如果我們沒用mkimage對內(nèi)核進行處理的話,那直接把內(nèi)核下載到0x再運行就行,內(nèi)核會自解壓運行(不過內(nèi)核運行需要一個tag來傳遞參數(shù),而這個tag建議是由bootloader提供的,在u-boot下默認是由bootm命令建立的)。

2)如果使用mkimage生成內(nèi)核鏡像文件的話,會在內(nèi)核的前頭加上了64byte的信息,供建立tag之用。bootm命令會首先判斷bootm xxxx 這個指定的地址xxxx是否與-a指定的加載地址相同。

(1)如果不同的話會從這個地址開始提取出這個64byte的頭部,對其進行分析,然后把去掉頭部的內(nèi)核復制到-a指定的load地址中去運行之

(2)如果相同的話那就讓其原封不同的放在那,但-e指定的入口地址會推后64byte,以跳過這64byte的頭部。

QUESTIONS

1. I have built a vmlinux image but I can boot it.

2: The mkimage tool, ARMboot’s tftp command, and the bootm command require

certain load and entry addresses. I’m confused which ones to chose.

ANSWERS

1. I have built a vmlinux image but I can boot it.

ARMboot is designed to boot Images as created by the mkimage tool, that

comes with ARMboot and is automatically built, too. You cannot directly load

the vmlinux image, as it expects a number of prerequisits such as special

register contents etc.

2. The mkimage tool, ARMboot’s tftp command, and the bootm command require

certain load and entry addresses. I’m confused which ones to chose.

—-

Well, there are 3 different addresses:

1. Kernel Load Address. This is the address, where the kernel was linked

to when you built the vmlinux and can be found in arch/arm/Makefile.

The default for it is:

ifeq ($(CONFIG_CPU_32),y)

PROCESSOR = armv

TEXTADDR = 0xC

LDSCRIPT = arch/arm/vmlinux-armv.lds.in

endif

Provide this as “-a” parameter to mkimage.

2. Kernel Entry Point. This is the address, where ARMboot jumps to to

enter the Kernel. It usually is the same as the kernel load address.

Provide this as “-e” parameter to mkimage.

3. The Network Download Address. This is where you download the mkimage

File. This address MUST BE different to the Kernel Load Address, and

should be sufficiently far away to allow ARMboot to relocate the

image to the final Kernel Load Address. Loading to the 5th MB

within the RAM is usually a good idea, eg. if the RAM begins at

0xc, you can do this:

LART # tftp clinux.img

ARP broadcast 1

eth addr: 00:02:03:04:05:06

TFTP from server 192.168.1.1; our IP address is 192.168.1.2

Filename ‘image.img’.

Load address: 0xc

Loading:

##################################################################done

Bytes transferred =(8a7d4 hex)

LART # bootm c

Image Name: Linux 2.4.18

Created: Mon Jun 24 12:00:

Image Type: ARM Linux Kernel Image (gzip compressed)

Data Size:Bytes = 553 kB = 0 MB

Load Address: 0xc

Entry Point: 0xc

Verifying Checksum … OK

Loading Kernel Image … OK

Starting kernel …

如何直接啟動 vmlinuxz

vmlinux是未壓縮的內(nèi)核,vmlinux是ELF文件,即編譯出來的最原始的文件。用于kernel-debug,產(chǎn)生system.map符號表,不能用于直接加載,不可以作為啟動內(nèi)核。只是啟動過程中的中間媒體vmlinuz是可引導的、壓縮的內(nèi)核?!皏m”代表“VirtualMemory”。Linux支持虛擬內(nèi)存,不像老的操作系統(tǒng)比如DOS有640KB內(nèi)存的限制以是我在CSDN中看到的,可以使用反匯編查看這個文件:arm-eabi-objdump-dkernel/vmlinux>1.S

關于uboot 引導 vmlinux的介紹到此就結束了,不知道你從中找到你需要的信息了嗎 ?如果你還想了解更多這方面的信息,記得收藏關注本站。

成都網(wǎng)站建設選創(chuàng)新互聯(lián)(?:028-86922220),專業(yè)從事成都網(wǎng)站制作設計,高端小程序APP定制開發(fā),成都網(wǎng)絡營銷推廣等一站式服務。


網(wǎng)站題目:使用Uboot引導vmlinux的簡易教程(uboot引導vmlinux)
轉載來源:http://m.5511xx.com/article/dhdchep.html