uCLinux FAQ

uCLinux Tux
  1. How is a user application added to the uClinux Distribution?
  2. Where can more information on μCLinux be found?
  3. What is the default password for the pre-built Simtec uCLinux images?

  1. How is a user application added to the uClinux Distribution?

    This answer is based upon the "Adding-User-Apps-HOWTO" from the uCLinux distribution documentation section written by D. P. Siddons

    There are five necessary changes which must be made to the uClinux distribution in order to integrate a new user application. All changes are assumed to be performed within the uCLinux-dist directory unless explicitly stated. The necessary changes are:

    1. Add a directory to the user directory for the new application. This should be suitably named and not conflict with the existing application set. For example:
      mkdir user/foo
    2. Edit the config/config.in file to add a line in the apropriate menu section i.e. in the program group in which the application should be displayed during 'make config', a suitable default is the "misc" section. The added line should look something like:
      bool 'foo'           CONFIG_USER_FOO_FOO

      This would present a configuration question with the prompt foo and set the CONFIG_USER_FOO_FOO variable as apropriate. The repetition of FOO in the config variable allows for application directories which contain multiple executables. For example if the user directory 'foo' contained code to make 'foo' and 'bar' each would get its own config line and the added lines would be:

      bool 'foo'           CONFIG_USER_FOO_FOO
      bool 'bar'           CONFIG_USER_FOO_BAR
    3. Edit the config/Configure.help file. This file contains the help text which is presented on request during the configuration stage. A section should be added for each configuration variable created in the previous step, while this step is not mandatory it is highly recommended.

      A correct entry would look like:

      CONFIG_USER_FOO_FOO
        This program does fooey things to your bars.
      
      

      The text must be indented two spaces, and there must be no empty lines. Lines should be less than 70 chars long.

    4. Edit the user/Makefile file. Add a line to the file like
      dir_$(CONFIG_USER_FOO_FOO)            += foo

      This adds the directory 'foo' to the list of directories to be built. The order of entries within the file does not matter.

    5. A suitable Makefile must be present within the new application directory. For building a single executable the Makefile should follow this template:
      EXEC = foo
      OBJS = foo.o
      
      all: $(EXEC)
      
      $(EXEC): $(OBJS)
              $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
      
      romfs:
              $(ROMFSINST)    /bin/$(EXEC)
      
      clean:
              -rm -f $(EXEC) *.elf *.gdb *.o

      If more than one executable is built in the foo directory then the Makefile would look like:

      EXECS = foo bar
      OBJS = foo.o bar.o
      
      all: $(EXECS)
      
      $(EXECS): $(OBJS)
              $(CC) $(LDFLAGS) -o $@ $@.o $(LDLIBS)
      
      romfs:
              $(ROMFSINST) -e CONFIG_USER_FOO_FOO             /bin/foo
              $(ROMFSINST) -e CONFIG_USER_FOO_BAR             /bin/bar
      
      clean:
              -rm -f $(EXEC) *.elf *.gdb *.o

      More complex makefiles are of course possible. The developer should browse the other user applications for practical examples.

    Once these changes have been made doing the standard 'make xconfig; make dep; make' should build the application and install it in romfs and hence in the target system.

  2. Where can more information on μCLinux be found?

    The two most useful resources for μCLinux are:
    μCDot The embedded Linux developer forum. The FAQ and news sections are especially useful
    μCLinux Homepage This is the "official" homepage, however some of the site is a little out of date.

  3. What is the default password for the pre-built Simtec uCLinux images?

    The default password is "changeme"

Other pages