linux vim编辑kconfig 无法wq,Linux-4.9.2内核在mini2440上的移植(三)——编译环境测试...
原因:沒有安裝make工具,安裝一下
root@ubuntu:~/linux-4.9.2#apt? install? make
再重試,又出錯
root@ubuntu:~/linux-4.9.2#make? mini2440_defconfig
HOSTCC scripts/basic/fixdep
/bin/sh: 1: gcc: not found
scripts/Makefile.host:107:recipe for target 'scripts/basic/fixdep' failed
make[1]: ***[scripts/basic/fixdep] Error 127
Makefile:448: recipe fortarget 'scripts_basic' failed
make: *** [scripts_basic]Error 2
原因:缺少32位的庫
解決方法:安裝libncurses5等關鍵庫
root@ubuntu:~/linux-4.9.2#apt? install? libncurses5-dev
root@ubuntu:~/linux-4.9.2# apt-get? install? libx11-dev:i386 libreadline6-dev:i386
root@ubuntu:~/linux-4.9.2#apt-get install build-essential
root@ubuntu:~/linux-4.9.2# apt-get? install? lib32stdc++6
root@ubuntu:~/linux-4.9.2# apt-get? install? lib32z1
再次運行
root@ubuntu:~/linux-4.9.2# make? mini2440_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to.config
#
OK,可以了,開始編譯測試,這里使用-j8表示使用8個線程進行編譯,可以大幅加快編譯的速度,-j后面的數值可以根據你的虛擬機設置的實際情況進行選擇,一般等于虛擬機的cpu核心數即可,我的虛擬機設置了8個CPU核心,所以-j8
root@ubuntu:~/linux-4.9.2# make? -j8
又報錯
/bin/sh: 1: bc: not found
Kbuild:67: recipe fortarget 'include/generated/timeconst.h' failed
解決方法:安裝bc
root@ubuntu:~/linux-4.9.2#apt? install? bc
再次編譯,可以運行
可以看到編譯過程中CPU已經滿載
3.3 為uImage創建腳本
查看zImage生成情況
root@ubuntu:~/linux-4.9.2# cd? arch/arm/boot/
root@ubuntu:~/linux-4.9.2/arch/arm/boot#? ls
bootp? compressed dts? Image? install.sh Makefile? zImage
可以看到,生成了zImage
我們的平臺使用uboot作為BootLoader,所以需要轉換為uImage使用。
(1)先安裝u-boot轉換uimage工具
root@ubuntu:~/linux-4.9.2/arch/arm/boot#? apt-get? ?install? ?u-boot-tools
(2)再到Linux源碼根目錄
root@ubuntu:~/linux-4.9.2/arch/arm/boot#? cd? ?../../..
(3)創建腳本
root@ubuntu:~/linux-4.9.2 #? vim? ?mkuImage.sh
(4)粘貼如下內容
mkimage -A arm -O linux -Tkernel -C none -a 0x30008000 -e 0x30008040 -n mini2440 -d /root/linux-4.9.2/arch/arm/boot/zImage? /root/tftp/uImage
(5)賦予可執行權限
root@ubuntu:~/linux-4.9.2# chmod? ?a+x? ?mkuImage.sh
(6)運行
root@ubuntu:~/linux-4.9.2#? ./mkuImage.sh
(7)查看,確認腳本有效
root@ubuntu:~/linux-4.9.2# ls? ?/root/tftp/
uImage
可以看到,tftp文件夾下面已經存在了一個uImage
3.4運行測試
在本系統中,使用了uboot引導,所以要先將uboot燒寫進入到nand flash中,然后打開secureCRT,設置好串口。
將開發板上電,按空格進入到uboot控制臺,查看一下環境變量
[U-boot@mini2440A]#printenv
bootdelay=1
baudrate=115200
ethaddr=08:00:3e:26:0a:5b
gatewayip=192.168.1.1
netmask=255.255.255.0
xujun=bmp d 70000
stdin=serial
ethact=dm9000
ipaddr=192.168.2.188
serverip=192.168.2.123
bootcmd=tftp 0x30008000uImage;bootm 0x30008000
bootargs=console=ttySAC0,115200n8root=/dev/nfs nfsroot=192.168.2.123:/home/ubuntu/NFS/myrootfs/rootfsip=192.168.2.188:192.168.2.123:192.168.2.1:255.255.255.0:SMDK2440A.arm9.net:eth0:offinit=/linuxrc
stdin=serial
stdout=serial
stderr=serial
Environment size:479/131068 bytes
我們的目的是上電之后,uboot直接從tftp文件夾內讀取uImage,并啟動內核,所以需要配置以下幾點
1、設置開發板的ip(根據你的路由網段設置)
[U-boot@mini2440A]# setenv? ipaddr? 192.168.2.188
2、設置服務器的ip(根據實際ip設置)
[U-boot@mini2440A]# setenv? serverip? 192.168.2.104
3、設置uboot,tftp加載內核(tftp 是你的tftp文件夾名字)
[U-boot@mini2440A]# setenv? bootcmd? 'tftp 0x30008000 uImage;bootm 0x30008000'
4、保存參數
[U-boot@mini2440A]# saveenv
Saving Environment toNAND...
Erasing Nand...
Erasing at 0x4000000000002--? ?0% complete.
Writing to Nand... done
啟動測試
[U-boot@mini2440A]# boot
dm9000 i/o: 0x20000300, id:0x90000a46
DM9000: running in 16 bitmode
MAC: 08:00:3e:26:0a:5b
could not establish link
Using dm9000 device
TFTP from server192.168.2.104; our IP address is 192.168.2.188
Filename 'uImage'.
Load address: 0x30008000
Loading: #################################################################
#################################################################
#################################################################
##########
done
Bytes transferred = 3006872(2de198 hex)
## Booting kernel fromLegacy Image at 30008000 ...
Image Name:? mini2440
Created:? ? ?2017-09-27? ?7:06:46 UTC
Image Type:? ARM Linux Kernel Image (uncompressed)
Data Size:? ?3006808 Bytes =? 2.9 MB
Load Address: 30008000
Entry Point: 30008040
Verifying Checksum ... OK
XIP Kernel Image ... OK
OK
Starting kernel ...
Booting Linux on physicalCPU 0x0
Linux version 4.9.2(root@ubuntu) (gcc version 6.3.0 20170406 (Ubuntu/Linaro 6.3.0-12ubuntu2) ) #1Tue Sep 26 23:51:32 PDT 2017
CPU: ARM920T [41129200]revision 0 (ARMv4T), cr=c000717f
CPU: VIVT data cache, VIVTinstruction cache
Machine: MINI2440
Memory policy: Data cachewriteback
CPU S3C2440A (id0x32440001)
Built 1 zonelists in Zoneorder, mobility grouping on.? Totalpages: 16256
Kernel command line:console=ttySAC0,115200n8 root=/dev/nfsnfsroot=192.168.2.123:/home/ubuntu/NFS/myrootfs/rootfsip=192.168.2.188:192.168.2.123:192.168.2.1:255.255.255.0:SMDK2440A.arm9.net:eth0:offinit=/linuxrc
PID hash table entries: 256(order: -2, 1024 bytes)
Dentry cache hash tableentries: 8192 (order: 3, 32768 bytes)
Inode-cache hash tableentries: 4096 (order: 2, 16384 bytes)
Memory: 58868K/65536Kavailable (4309K kernel code, 180K rwdata, 976K rodata, 176K init, 258K bss,6668K reserved, 0K cma-reserved)
Virtual kernel memorylayout:
vector : 0xffff0000 - 0xffff1000? ?(? ?4 kB)
fixmap : 0xffc00000 - 0xfff00000? ?(3072kB)
vmalloc : 0xc4800000 - 0xff800000? ?( 944 MB)
lowmem : 0xc0000000 - 0xc4000000? ?(? 64 MB)
modules : 0xbf000000 - 0xc0000000? ?(? 16MB)
.text : 0xc0008000 - 0xc043d660? ?(4310 kB)
.init : 0xc0552000 - 0xc057e000? ?( 176 kB)
.data : 0xc057e000 - 0xc05ab320? ?( 181 kB)
.bss : 0xc05ab320 - 0xc05ebf00? ?( 259 kB)
SLUB: HWalign=32,Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:103
S3C2440: IRQ Support
irq: clearing pendingstatus 00000003
irq: clearing pendingstatus 00000002
sched_clock: 16 bits at1012kHz, resolution 987ns, wraps every 32362962ns
clocksource:samsung_clocksource_timer: mask: 0xffff max_cycles: 0xffff, max_idle_ns:28803037 ns
Console: colour dummydevice 80x30
Calibrating delay loop...201.52 BogoMIPS (lpj=503808)
pid_max: default: 32768minimum: 301
Mount-cache hash tableentries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash tableentries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffercoherency: ok
Setting up static identitymap for 0x300081e0 - 0x30008238
clocksource: jiffies: mask:0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302231375000 ns
NET: Registered protocolfamily 16
DMA: preallocated 256 KiBpool for atomic coherent allocations
cpuidle: using governorladder
MINI2440: Option stringmini2440=0tb
MINI2440: 't' ignored,touchscreen not compiled in
MINI2440: LCD
[0:240x320]
1:800x480
2:1024x768
3:320x240
S3C2440: Initialisingarchitecture
usbcore: registered newinterface driver usbfs
usbcore: registered newinterface driver hub
usbcore: registered newdevice driver usb
s3c-i2c s3c2440-i2c.0:slave address 0x10
s3c-i2c s3c2440-i2c.0: busfrequency set to 98 KHz
s3c-i2c s3c2440-i2c.0:i2c-0: S3C I2C adapter
Advanced Linux SoundArchitecture Driver Initialized.
clocksource: Switched toclocksource samsung_clocksource_timer
NET: Registered protocolfamily 2
TCP established hash tableentries: 1024 (order: 0, 4096 bytes)
TCP bind hash tableentries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured(established 1024 bind 1024)
UDP hash table entries: 256(order: 0, 4096 bytes)
UDP-Lite hash tableentries: 256 (order: 0, 4096 bytes)
NET: Registered protocolfamily 1
RPC: Registered named UNIXsocket transport module.
RPC: Registered udptransport module.
RPC: Registered tcptransport module.
RPC: Registered tcp NFSv4.1backchannel transport module.
futex hash table entries:256 (order: -1, 3072 bytes)
workingset:timestamp_bits=30 max_order=14 bucket_order=0
NFS: Registering theid_resolver key type
Key type id_resolverregistered
Key type id_legacyregistered
jffs2: version 2.2. (NAND) 漏 2001-2006 Red Hat, Inc.
romfs: ROMFS MTD (C) 2007Red Hat, Inc.
io scheduler noopregistered
io scheduler deadlineregistered
io scheduler cfq registered(default)
Console: switching tocolour frame buffer device 60x53
s3c2410-lcd s3c2410-lcd:fb0: s3c2410fb frame buffer device
s3c2440-uart.0: ttySAC0 atMMIO 0x50000000 (irq = 74, base_baud = 0) is a S3C2440
console [ttySAC0] enabled
[1] [2]
總結
以上是生活随笔為你收集整理的linux vim编辑kconfig 无法wq,Linux-4.9.2内核在mini2440上的移植(三)——编译环境测试...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 10个linux awk文本处理经典案例
- 下一篇: 用linux集成电路版图设计,集成电路版