为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

uclinux内核配置傻瓜教程

2011-04-09 17页 pdf 1MB 6阅读

用户头像

is_694217

暂无简介

举报
uclinux内核配置傻瓜教程 Uclinux内核编译傻瓜教程 插曲:SDT下程序调适经验 在 SDT 工程下面的.alf 文件都是库文件,有了这些库文件后与之相对应的.c 原文件就不需要加载进入工程,否则会导致工程调试时出现程序跑飞的情况。 比方说如果已经加入了 44blib.alf 文件,则不需要再加入 44blib.c 文件,如果加 入程序通过 jtag调试必然跑飞,去掉则没有问题! 当然在 ADS中是没有.alf库文件的,那么就需要加入相应的.c文件!! 内核的编译过程我想大家都知道了,就是 make menuconf...
uclinux内核配置傻瓜教程
Uclinux内核编译傻瓜教程 插曲:SDT下程序调适 在 SDT 工程下面的.alf 文件都是库文件,有了这些库文件后与之相对应的.c 原文件就不需要加载进入工程,否则会导致工程调试时出现程序跑飞的情况。 比方说如果已经加入了 44blib.alf 文件,则不需要再加入 44blib.c 文件,如果加 入程序通过 jtag调试必然跑飞,去掉则没有问! 当然在 ADS中是没有.alf库文件的,那么就需要加入相应的.c文件!! 内核的编译过程我想大家都知道了,就是 make menuconfig 进入内核配置菜单进行删改,结束保存后进行 make dep make clean make lib_only make user_only make romfs make image make 基本上按照立宇泰给的uclinux内核文件和交叉编译器就能够完成整个编译内核 的工作,只不过也许由于内核版本不同会产生一些不同的结果,主要还是功能 方面的!此次编译内核需要完成的功能包括文件系统 ext2 的挂载,网络驱动, 基本的 cash命令,lcd frambuffer功能,串口功能。当然你也可以实现更多的文 件系统的挂载识别和更多驱动功能,但是内核及文件系统必然增大,这里只是 实现基本的一些驱动功能,希望借此给各位一些帮助! 1. 编译 armsys-c的 uclinux内核及文件系统。 原先 armsys-c的 uclinux内核文件如下: 没有经过压缩的内核文件大小为 1.8M;经过压缩的内核为 0.9M,其经过解 压后进入 SDRAM区后应该还是具有 1.8M大小;文件系统大小为 0.8M左右。 这里要注意的是必须按照手册上说的地址下载,否则 uclinux无法启动,原 因应该是其编译生成的内核文件及文件系统文件在编译过程中已经加入了 ro-base 及 rm-base,所以程序启动的时候会相应寻找其地址,如果不对则无法 启动。不过我会通过重新编译内核时更改其值,验证设想! 以下是下载 imageram.bin的过程,内核下载后再下载 romfsimag.bin即完成 整个下载过程,并让程序 Pc指向内核起始地址启动 uclinux! 启动好了的内核及文件系统: 对内核进行删改,并于原内核进行比对,发现一些问题。 以下是原版的内核启动过程,作为对比标准! Plese wait a moment to start running...Linux version 2.4.24-uc0 (root@xujing) (g cc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fid des.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.c om/)) #355 五 11月 26 03:10:23 CST 2004 Processor: Samsung S3C44B0X revision 0 Architecture: S3C44B0X On node 0 totalpages: 2048 zone(0): 0 pages. zone(1): 2048 pages. zone(2): 0 pages. Kernel command line: root=/dev/rom0 init=/linuxrc Console: colour dummy device 80x30 Calibrating delay loop... 31.84 BogoMIPS Memory: 8MB = 8MB total Memory: 6072KB available (1715K code, 206K data, 60K init) Dentry cache hash table entries: 1024 (order: 1, 8192 bytes) Inode cache hash table entries: 512 (order: 0, 4096 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 2048 (order: 1, 8192 bytes) POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd ttyS0 at I/O 0x1d00000 (irq = 3) is a S3C44B0 ttyS1 at I/O 0x1d04000 (irq = 2) is a S3C44B0 LCD buffer : 0c260000 ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com) Last modified Nov 1, 2000 by Paul Gortmaker NE*000 ethercard probe at 0x8000000: 52 54 ab 12 34 56 eth0: NE1000 found at 0x8000000, using IRQ 22 Blkmem copyright 1998,1999 D. Jeff Dionne Blkmem copyright 1998 Kenneth Albanowski Blkmem 1 disk images: 0: C500000-C5B3FFF [VIRTUAL C500000-C5B3FFF] (RO) RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 60K Shell invoked to run file: /etc/rc Command: hostname Samsung Command: /bin/expand /etc/ramfs.img /dev/ram0 Command: /bin/expand /etc/ramfs2048.img /dev/ram1 Command: mount -t proc proc /proc Command: mount -t ext2 /dev/ram0 /var Command: mount -t ext2 /dev/ram1 /ramdisk Command: chmod 777 /ramdisk Command: mkdir /var/config Command: mkdir /var/tmp Command: mkdir /var/log Command: mkdir /var/run Command: mkdir /var/lock Command: cat /etc/motd Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| For further information check: http://www.uclinux.org/ Command: ifconfig lo 127.0.0.1 Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo Command: ifconfig eth0 192.168.253.2 netmask 255.255.255.0 up Command: Execution Finished, Exiting Sash command shell (version 1.1.1) 2. 在 menuconfig的选项中添加 tcp/ip,内核及文件系统下载后结果如下: 其中在 CORE MENU中添加的选项为 该部分内核及根文件为*1.bin A:Æ B:-Æ C:Æ 在MAIN MENU选项中未添加。 编译后的下载的结果如下: Plese wait a moment to start running...Linux version 2.4.24-uc0 (root@localhost) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http:// fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgea r.com/)) #365 Thu Jan 27 16:18:15 EST 2005 Processor: Samsung S3C44B0X revision 0 Architecture: S3C44B0X On node 0 totalpages: 2048 zone(0): 0 pages. zone(1): 2048 pages. zone(2): 0 pages. Kernel command line: root=/dev/rom0 init=/linuxrc Calibrating delay loop... 31.84 BogoMIPS Memory: 8MB = 8MB total Memory: 6144KB available (1714K code, 156K data, 44K init) Dentry cache hash table entries: 1024 (order: 1, 8192 bytes) Inode cache hash table entries: 512 (order: 0, 4096 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 2048 (order: 1, 8192 bytes) POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd ttyS0 at I/O 0x1d00000 (irq = 3) is a S3C44B0 ttyS1 at I/O 0x1d04000 (irq = 2) is a S3C44B0 ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com) Last modified Nov 1, 2000 by Paul Gortmaker NE*000 ethercard probe at 0x8000000: 52 54 ab 12 34 56 eth0: NE1000 found at 0x8000000, using IRQ 22 Blkmem copyright 1998,1999 D. Jeff Dionne Blkmem copyright 1998 Kenneth Albanowski Blkmem 1 disk images: 0: C500000-C5F93FF [VIRTUAL C500000-C5F93FF] (RO) RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) IP-Config: Incomplete network configuration information. NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 44K Shell invoked to run file: /etc/rc Command: hostname Samsung Command: /bin/expand /etc/ramfs.img /dev/ram0 Command: /bin/expand /etc/ramfs2048.img /dev/ram1 Command: mount -t proc proc /proc Command: mount -t ext2 /dev/ram0 /var mount: Mounting /dev/ram0 on /var failed: No such device pid 12: failed 256 Command: mount -t ext2 /dev/ram1 /ramdisk mount: Mounting /dev/ram1 on /ramdisk failed: No such device pid 13: failed 256 Command: chmod 777 /ramdisk /ramdisk: Read-only file system Command: mkdir /var/config /var/config: Read-only file system Command: mkdir /var/tmp /var/tmp: Read-only file system Command: mkdir /var/log /var/log: Read-only file system Command: mkdir /var/run /var/run: Read-only file system Command: mkdir /var/lock /var/lock: Read-only file system Command: cat /etc/motd Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| For further information check: http://www.uclinux.org/ Command: ifconfig lo 127.0.0.1 Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo Command: ifconfig eth0 192.168.253.2 netmask 255.255.255.0 up Command: Execution Finished, Exiting Sash command shell (version 1.1.1) /> 3. 第三次变编译内核,加入以下选项: 编译文件为*2.bin 编译选项更改如下: A--Æ B:Æ 编译结果如下: 1.Use USB-downloader download code to SDRAM. 2.Use USB-downloader download code to SDRAM & Nandflash. 3.Use USB-downloader burn flashROM. 4.Copy code from flashROM to SDRAM. 5.Run at specify address. 6.Run code in Nandflash. 7.Start uClinux. 8.Format Nandflash. 9.Test hardware Input the address to put the code (Default address is 0xc008000): USB Interface is active! You can use USBdownload.exe to download *.bin file! Receive a file ... FileName:imageram2 FileSuffix:bin FileLen:0x1b5dd0 Completed Download! --------------------------------------------------------------- 1.Use USB-downloader download code to SDRAM. 2.Use USB-downloader download code to SDRAM & Nandflash. 3.Use USB-downloader burn flashROM. 4.Copy code from flashROM to SDRAM. 5.Run at specify address. 6.Run code in Nandflash. 7.Start uClinux. 8.Format Nandflash. 9.Test hardware Input the address to put the code (Default address is 0xc008000): USB Interface is active! You can use USBdownload.exe to download *.bin file! Receive a file ... FileName:imageram2 FileSuffix:bin FileLen:0x1b5dd0 Completed Download! --------------------------------------------------------------- 1.Use USB-downloader download code to SDRAM. 2.Use USB-downloader download code to SDRAM & Nandflash. 3.Use USB-downloader burn flashROM. 4.Copy code from flashROM to SDRAM. 5.Run at specify address. 6.Run code in Nandflash. 7.Start uClinux. 8.Format Nandflash. 9.Test hardware Input the address to put the code (Default address is 0xc008000):0xc500000 USB Interface is active! You can use USBdownload.exe to download *.bin file! Receive a file ... FileName:romfsram2 FileSuffix:bin FileLen:0xe7000 Completed Download! --------------------------------------------------------------- 1.Use USB-downloader download code to SDRAM. 2.Use USB-downloader download code to SDRAM & Nandflash. 3.Use USB-downloader burn flashROM. 4.Copy code from flashROM to SDRAM. 5.Run at specify address. 6.Run code in Nandflash. 7.Start uClinux. 8.Format Nandflash. 9.Test hardware Input the address (Default address is 0xc008000): Plese wait a moment to start running...Linux version 2.4.24-uc0 (root@localhost) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http:// fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgea r.com/)) #367 Fri Jan 28 10:49:52 EST 2005 Processor: Samsung S3C44B0X revision 0 Architecture: S3C44B0X On node 0 totalpages: 2048 zone(0): 0 pages. zone(1): 2048 pages. zone(2): 0 pages. Kernel command line: root=/dev/rom0 init=/linuxrc Calibrating delay loop... 31.84 BogoMIPS Memory: 8MB = 8MB total Memory: 6180KB available (1671K code, 160K data, 44K init) Dentry cache hash table entries: 1024 (order: 1, 8192 bytes) Inode cache hash table entries: 512 (order: 0, 4096 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 2048 (order: 1, 8192 bytes) POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd ttyS0 at I/O 0x1d00000 (irq = 3) is a S3C44B0 ttyS1 at I/O 0x1d04000 (irq = 2) is a S3C44B0 ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com) Last modified Nov 1, 2000 by Paul Gortmaker NE*000 ethercard probe at 0x8000000: 52 54 ab 12 34 56 eth0: NE1000 found at 0x8000000, using IRQ 22 Blkmem copyright 1998,1999 D. Jeff Dionne Blkmem copyright 1998 Kenneth Albanowski Blkmem 1 disk images: 0: C500000-C5E6FFF [VIRTUAL C500000-C5E6FFF] (RO) RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) IP-Config: Incomplete network configuration information. NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 44K Shell invoked to run file: /etc/rc Command: hostname Samsung Command: /bin/expand /etc/ramfs.img /dev/ram0 Command: /bin/expand /etc/ramfs2048.img /dev/ram1 Command: mount -t proc proc /proc Command: mount -t ext2 /dev/ram0 /var Command: mount -t ext2 /dev/ram1 /ramdisk Command: chmod 777 /ramdisk Command: mkdir /var/config Command: mkdir /var/tmp Command: mkdir /var/log Command: mkdir /var/run Command: mkdir /var/lock Command: cat /etc/motd Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| For further information check: http://www.uclinux.org/ Command: ifconfig lo 127.0.0.1 Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo Command: ifconfig eth0 192.168.253.2 netmask 255.255.255.0 up Command: Execution Finished, Exiting Sash command shell (version 1.1.1) /> 5.第四版编译过程: 此版内核及文件系统为*4.bin文件。 针对还没有 frambuffer的情况,先对内核选项做如下添加: 关于 framebuffer的选项: 在 make menuconfig 的时候首先进入 Character devices,选中里面的 Virtual terminal 。退 到上一层界面,就可以看到 Console device 的选项,进入后选中 Framebuffer Support 上, 按回车键进入,在里面选择自己所需要的 framebuffer设备即可。在 Advanced low level 中 可以配置 8bpp packed pixel support,然后选中 Select compiled-in fonts 即可 A:Æ B:Æ C:Æ 配制好后编译下载得到如下结果 : FileName:imageram4 FileSuffix:bin FileLen:0x1cf970 Completed Download! --------------------------------------------------------------- 1.Use USB-downloader download code to SDRAM. 2.Use USB-downloader download code to SDRAM & Nandflash. 3.Use USB-downloader burn flashROM. 4.Copy code from flashROM to SDRAM. 5.Run at specify address. 6.Run code in Nandflash. 7.Start uClinux. 8.Format Nandflash. 9.Test hardware Input the address (Default address is 0xc008000): Plese wait a moment to start running...Linux version 2.4.24-uc0 (root@localhost) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http:// fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgea r.com/)) #369 Fri Jan 28 16:28:12 EST 2005 Processor: Samsung S3C44B0X revision 0 Architecture: S3C44B0X On node 0 totalpages: 2048 zone(0): 0 pages. zone(1): 2048 pages. zone(2): 0 pages. Kernel command line: root=/dev/rom0 init=/linuxrc Console: colour dummy device 80x30 Calibrating delay loop... 31.84 BogoMIPS Memory: 8MB = 8MB total Memory: 6052KB available (1740K code, 198K data, 64K init) Dentry cache hash table entries: 1024 (order: 1, 8192 bytes) Inode cache hash table entries: 512 (order: 0, 4096 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 2048 (order: 1, 8192 bytes) POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd ttyS0 at I/O 0x1d00000 (irq = 3) is a S3C44B0 ttyS1 at I/O 0x1d04000 (irq = 2) is a S3C44B0 LCD buffer : 0c260000 ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com) Last modified Nov 1, 2000 by Paul Gortmaker NE*000 ethercard probe at 0x8000000: 52 54 ab 12 34 56 eth0: NE1000 found at 0x8000000, using IRQ 22 Blkmem copyright 1998,1999 D. Jeff Dionne Blkmem copyright 1998 Kenneth Albanowski Blkmem 1 disk images: 0: C500000-C5E6FFF [VIRTUAL C500000-C5E6FFF] (RO) RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) IP-Config: Incomplete network configuration information. NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 64K Shell invoked to run file: /etc/rc Command: hostname Samsung Command: /bin/expand /etc/ramfs.img /dev/ram0 Command: /bin/expand /etc/ramfs2048.img /dev/ram1 Command: mount -t proc proc /proc Command: mount -t ext2 /dev/ram0 /var Command: mount -t ext2 /dev/ram1 /ramdisk Command: chmod 777 /ramdisk Command: mkdir /var/config Command: mkdir /var/tmp Command: mkdir /var/log Command: mkdir /var/run Command: mkdir /var/lock Command: cat /etc/motd Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| For further information check: http://www.uclinux.org/ Command: ifconfig lo 127.0.0.1 Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo Command: ifconfig eth0 192.168.253.2 netmask 255.255.255.0 up Command: Execution Finished, Exiting Sash command shell (version 1.1.1) /> 至此,经过数个版本的内核配置及编译,达到了我们所需的配置要求,同时也 与立宇泰的内核配置一样。当然其中也许还有问题,但希望按照此文配置及编 译后能对大家的 uclinux内核编译有所帮助,同时也希望各位指正,帮助我们对 加深对于 uclinux内核配置的认识! gumanman2003@hotmailcom 2005-2-6 本文版权属于顾捷,转载请注明作者及网站 www.hzlitai.com.cn。此文及相关代码仅供学习 交流之用,如有任何问题请来信讨论。
/
本文档为【uclinux内核配置傻瓜教程】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索