📄 lumit-compile-uclinux-readme.txt
字号:
uClinux Image Compiling User Guide for lumit4510 : how to compile uClinux kernel说明: 本小节内容是关于如何编译一个可以运行的 uClinux Kernel-------------------------------------------------------------------------Step 1 :1. 下载 uClinux-dist-20030522.tar.gz 到当前工作目录下 http://159.226.40.150/lumit/resources/uClinux/uClinux-dist-20030522.tar.gz2. 解压 uClinux-dist-20030522.tar.gz 文件到 uClinux-dist 目录 tar zxvf uClinux-dist-20030522.tar.gz 此时当前工作目录下增加了一个名为 uClinux-dist 的目录。3. 下载 patch 文件 uClinux-20030522-lom_arm7-patch.rar 到 uClinux-dist 目录 http://159.226.40.150/lumit/resources/uClinux/uClinux-20030522-lom_arm7-patch.rar 用 winrar 解压 该文件后得到 uClinux-20030522-dailzh.patch 4. 复制 patch 文件到 uClinux-dist 目录下 cp uClinux-20030522-dailzh.patch uClinux-dist4. 进入 uClinux-dist 目录 cd uClinux-dist5. 打 patch 补丁 patch -p1 < uClinux-20030522-dailzh.patch 此时得到如下输出:patching file config/.menuconfig.logpatching file linux-2.4.x/arch/armnommu/boot/compressed/linux.lds.inpatching file linux-2.4.x/arch/armnommu/boot/compressed/Makefilepatching file linux-2.4.x/arch/armnommu/config.inpatching file linux-2.4.x/arch/armnommu/vmlinux-armv.lds.inpatching file linux-2.4.x/include/asm-armnommu/arch-snds100/hardware.hpatching file linux-2.4.x/include/asm-armnommu/arch-snds100/memory.hpatching file Makefilepatching file mklinuxpatching file user/busybox/docs/busybox.podpatching file user/ntp/config.logHunk #1 succeeded at 1569 with fuzz 1 (offset -28 lines).patching file user/tinylogin/applet_source_listpatching file user/tinylogin/config.hpatching file vendors/Samsung/4510B/config.linux-2.4.xpatching file vendors/Samsung/4510B/config.vendor-2.4.xpatching file vendors/Samsung/4510B/index.htmlpatching file vendors/Samsung/4510B/inittabpatching file vendors/Samsung/4510B/logo.jpgpatching file vendors/Samsung/4510B/Makefilepatching file vendors/Samsung/4510B/rcStep 2 : 6. make menuconfig 配置内核--- Choose a Vendor/Product combination. (Samsung/4510B) Vendor/Product (linux-2.4.x) Kernel Version (uClibc) Libc Version 7. make dep 建立依赖关系8. make lib_only 编译库文件9. make user_only 编译用户应用程序文件 这里似乎会遇到有一个关于 boa 的应用有错, uClinux-dist/user/boa/src/auth.c:194: undefined reference to `crypt_old' 可以重新 make menuconfig 后暂时不选择 boa 应用,就可以编译通过Network Applications ---> [ ] boa 还有一个 /login/login.c :162: undefined reference to `crypt_old' 的错误, 也可以将 login 应用暂时去掉就可以编译通过 Core Applications ---> [ ] login 暂时不选择 boa 应用的具体操作方法如下:make menuconfig 的时候: Target Platform Selection ---> 选中[*] Customize Vendor/User Settings 然后 Exit Do you wish to save your new kernel configuration? 选择 Yes 退出进入 Main Menu 后 , 选择 Network Applications ---> 清除 [ ] boa 选项,就可以不再编译 boa 这个应用程序。同理: login 应用程序是通过 Core Applications ---> 清除 [ ] login 选项即可。10. make romfs 生成romfs文件系统11. make image 编译内核arm-elf-ld -r -o /home/liming/testuc/uClinux-dist/linux-2.4.x/romfs.o \ -b binary /home/liming/testuc/uClinux-dist/images/romfs.imgarm-elf-objcopy -O binary -R .note -R .comment \ -S /home/liming/testuc/uClinux-dist/linux-2.4.x/linux /home/liming/testuc/uClinux-dist/images/image.ramcp /home/liming/testuc/uClinux-dist/linux-2.4.x/arch/armnommu/boot/zImage \ /home/liming/testuc/uClinux-dist/images/image.rommake[1]: Leaving directory `/home/liming/testuc/uClinux-dist/vendors/Samsung/4510B' 可以看到成功编译后的最后几行输出,表示了 romfs.img, image.ram, image.rom 这几个文件和 linux 内核之间的关系。Step 3 :12. 查看 images 目录下的相关文件,可以看到:[liming@hpclab uClinux-dist]$ ls images/* -l-rwxrwxr-x 1 liming liming 801516 Aug 25 21:16 images/image.ram-rwxrwxr-x 1 liming liming 372600 Aug 25 21:16 images/image.rom-rw-rw-r-- 1 liming liming 814080 Aug 25 21:16 images/romfs.img 其中 image.ram 就是我们需要的,可以下载到 ram 中的 uclinux kernel (内含 romfs)13. 按照 uclinux 启动说明,下载执行 image.ram 文件 http://www.lumit.org/download/document/lumit-uclinux-readme.txt 14. 可以看到开发板有如下输出显示:/*************************************************************/Bios for download and program.Author JerryBuild date : Jun 16 2004 Time : 17:11:45Type help for help./*************************************************************/\>\>loadNo begin address for download, use default address 0x8000Mini TFTP Server 1.0 (IP : 192.168.168.101 PORT: 69)Load image file from hostType tftp -i 192.168.168.101 put filename at the host PCPress ESC key to exitStarting the TFTP download..................................................Received 185aec Bytes, END...Boot Image? (y/n) yLinux version 2.4.20-uc0 (liming@hpclab.cs.tsinghua.edu.cn) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #7 Wed Aug 25 10:12:00 HKT 2004Processor: Samsung S3C4510B revision 6Architecture: SNDS100On node 0 totalpages: 4096zone(0): 0 pages.zone(1): 4096 pages.zone(2): 0 pages.Kernel command line: root=/dev/rom0Calibrating delay loop... 49.86 BogoMIPSMemory: 16MB = 16MB totalMemory: 14476KB available (1484K code, 159K data, 40K init)Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)Inode cache hash table entries: 1024 (order: 1, 8192 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: 4096 (order: 2, 16384 bytes)POSIX conformance testing by UNIFIXLinux NET4.0 for Linux 2.4Based upon Swansea University Computer Society NET3.039Initializing RT netlink socketStarting kswapdSamsung S3C4510 Serial driver version 0.9 (2001-12-27) with no serial options enabledttyS00 at 0x3ffd000 (irq = 5) is a S3C4510BttyS01 at 0x3ffe000 (irq = 7) is a S3C4510BBlkmem copyright 1998,1999 D. Jeff DionneBlkmem copyright 1998 Kenneth AlbanowskiBlkmem 1 disk images:0: BE7E8-1853E7 [VIRTUAL BE7E8-1853E7] (RO)RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksizeSamsung S3C4510 Ethernet driver version 0.1 (2002-02-20) <mac@os.nctu.edu.tw>eth0: 00:40:95:36:35:34 NET4: Linux TCP/IP 1.0 for NET4.0IP Protocols: ICMP, UDP, TCPIP: routing cache hash table of 512 buckets, 4KbytesTCP: Hash tables configured (established 1024 bind 1024)VFS: Mounted root (romfs filesystem) readonly.Freeing init memory: 40KShell invoked to run file: /etc/rcCommand: hostname SamsungCommand: /bin/expand /etc/ramfs.img /dev/ram0Command: /bin/expand /etc/ramfs2048.img /dev/ram1Command: mount -t proc proc /procCommand: mount -t ext2 /dev/ram0 /varCommand: mount -t ext2 /dev/ram1 /ramdiskCommand: chmod 777 /ramdiskCommand: mkdir /var/configCommand: mkdir /var/tmpCommand: mkdir /var/logCommand: mkdir /var/runCommand: mkdir /var/lockCommand: ifconfig lo 127.0.0.1Command: route add -net 127.0.0.0 netmask 255.255.255.0 loCommand: ifconfig eth0 192.168.168.101 netmask 255.255.255.0 upCommand: cat /etc/motdWelcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_|For further information check:http://www.uclinux.org/Execution Finished, ExitingSash command shell (version 1.1.1)/> lsbindevetchomelibmntprocramdisksbintmpusrvar/> cd bin/bin> lsarpbasenamebusyboxdatedmesgduexpandftphostnameifconfiginetdinitmountpingrouteshtelnettelnetdtftptftpdumountuptime/bin> ┌-------------------------------------------------------------------------┐│ ││ Welcome to visit http://www.lumit.org for more information ││ ││ [lumit] - let us make it together ││ ││ ││ lumit-admin <admin@lumit.org> ││ │└-------------------------------------------------------------------------┘
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -