?? lumit-uclinux-addapp-readme.txt
字號:
uClinux AddApp User Guide for lumit4510 : 說明: 如何給 uClinux 添加自己的應用程序-------------------------------------------------------------------------可參考: http://www.ucdragon.com/bbs/printpage.asp?BoardID=1&id=106為4510B添加自己程序Step 1 :1. cd uClinux-dist2. cd user3. mkdir myapp4. cd myapp5. vi demo.c#include <stdlib.h>#include <stdio.h>int main(void){ printf("Hello world! \n"); printf("[lumit] - let us make it together \n"); printf("--------------------\n"); printf("http://www.lumit.org\n"); return 0;}6. vi Makefile EXEC = demoOBJS = demo.oall: $(EXEC) $(EXEC): $(OBJS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)romfs: $(ROMFSINST) /bin/$(EXEC)clean: rm -f $(EXEC) *.elf *.gdb *.o7. vi uClinux-dist/user/Makefile 添加一行 dir_$(CONFIG_USER_MYAPP_DEMO) += myapp 309 # add by liming 310 dir_$(CONFIG_USER_MYAPP_DEMO) += myapp 311 8. vi uClinux-dist/Config/config.in 增添以下內容到文件最后#############################################################################mainmenu_option next_commentcomment 'My New Application'bool 'demo' CONFIG_USER_MYAPP_DEMObool 'app1' CONFIG_USER_MYAPP_APP1bool 'app2' CONFIG_USER_MYAPP_APP2bool 'app3' CONFIG_USER_MYAPP_APP3comment "My New Application"endmenu############################################################################# 9. 進行重新編譯內核和文件系統的步驟 make dep make clean make lib_only (可以僅1次,不必要每次都來) make user_only (每次修改過您的應用程序之后,這一步后面的都必須重來) make romfs make image make 注意,如果前面已經編譯成功過一次,那么后面只需進行 make user_only; make romfs; make 10. 下載內核,運行看看:\>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 18baec 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 22:07:14 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: 14452KB available (1510K code, 157K 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-18BBE7 [VIRTUAL BE7E8-18BBE7] (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> ./demoHello world! [lumit] - let us make it together --------------------http://www.lumit.org/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 + -