Article Title: detailed methods for adding user applications in uClinux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. uClinux-dist/user/Makefile
Dir _ $ (CONFIG_USER_HELLO_WORLD)
+ = Hello
2. uClinux-dist/config/Configure. help
CONFIG_USER_HELLO_WORLD
A simple hello world program
3. uClinux-dist/config. in
Find the following two lines
Mainmenu_option next_comment
Comment 'miscellaneous Applications'
Add the following line
Bool 'hello'
CONFIG_USER_HELLO_WORLD
4.1.uClinux-dist/user/hello/Makefile
EXEC = helloOBJS = hello.oall: $(EXEC)$(EXEC): $(OBJS)$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)romfs:$(ROMFSINST) /bin/$(EXEC)clean:-rm -f $(EXEC) *.elf *.gdb *.o
|
4.2.uClinux-dist/user/hello. c
#include
int main(){printf("Hello, World\n");return 0;}
|
5. Compile the user program into romfs
# cd ~/uClinux-dist# make menuconfig# make dep# make romfs
|