uClinux course - PowerPoint PPT Presentation

About This Presentation
Title:

uClinux course

Description:

uClinux course – PowerPoint PPT presentation

Number of Views:128
Avg rating:3.0/5.0
Slides: 16
Provided by: dljoh
Category:
Tags: course | elf | uclinux | yourself

less

Transcript and Presenter's Notes

Title: uClinux course


1
uClinux course
  • Day 2 of 5
  • Using configuration tools and the tool chain

2
Configuration tools
  • Linux/Unix has a key advantage over windows due
    to its modularity kernel or application
    components can be added or removed easily
  • This makes it very suitable to embedded
    environments where many typical PC peripherals
    such as keyboards and screens are not present
  • The uClinux configuration script allows kernel
    components and applications to be added and
    removed
  • The uClinux environment uses two different menu
    configuration environments
  • For X windows environments a graphical menu
    system
  • make xconfig
  • For terminal environments a text based menu
    system
  • Make menuconfig

3
Configuration tools
  • type make menuconfig from a terminal window
  • Use lttabgt, and ltentergt to navigate through menus
    and ltspacegt to select check boxes

Select Target Platform Selection
Select (..) Vendor/Product To change the host
processor you are compiling for. We will use
(GDB/ARMulator) for the simulator and
(Atmel/AT91) for the real hardware later in the
course
4
Configuration tools
  • Selecting Kernel version
  • linux-2.4.x or linux-2.0.x depending on the
    size/feature set you need
  • Selecting Libc version
  • glibc is the original unadapted libc, it is the
    largest library
  • uC-libc is the original library for uclinux,
    APIs not always standard some routines not
    present
  • uClibc fixes problems with original uC-libc
    although it is a little larger than uC-libc
  • If you want to change Kernel settings select the
    check box
  • X Customise Kernel Settings (NEW) with ltspacegt
  • If you want to add or remove user applications
    select the check box
  • X Customise Vendor/User Settings with ltspacegt
  • When you are finished highlight Exit and press
    ltEntergt

5
Configurations tools
You are then brought back to this screen and you
ask yourself huh, I chose to change Kernel
settings and all I can do is lt Exit gt or go back
to Target Platform Selection Against all logic
Select lt Exit gt
Whizz , pop .
6
Configurations tools
  • Linux Kernel Configuration screen
  • Some important options to set
  • ltSystem typegt to set up RAM and FLASH addresses
  • ltGeneral optionsgt to activate/deactivate
    networking
  • ltNetworking optionsgt to choose networking
    protocols
  • When you are finished highlight Exit and press
    ltEntergt

7
Configuration tools
  • Select ltYesgt to save new kernel configuration

8
Configuration tools
  • Customize user settings for uClinux
  • Some important options to set
  • ltBusy boxgt contains all the common applications
    such as gunzip, grep, ln, chown
  • ltNetwork applicationsgt contains common network
    apps such as dhcp, ftp, ifconfig
  • When you are finished highlight Exit and press
    ltEntergt

9
Configuration tools
  • When you are finished configuring uClinux type
    the following commands to build the kernel and
    the userland
  • make dep make
  • If you only want to build the userland type
  • make user_only
  • Make romfs
  • make image
  • Go and make coffee or take a jog .. This can take
    a few minutes

10
Adding User applications
  • Files to edit
  • user/Makefile
  • 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. I added
  • mine in alphabetical order. The order doesn't
    seem to matter.
  • config/Configure.help
  • This file contains the text which is presented
    on request during the
  • config.
  • Add a block 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

11
Adding User applications
  • config/config.in
  • Add a line in the apropriate menu section
    (i.e. in the program group you want
  • your app to show up in during 'make config' I
    used 'misc'), like
  • bool 'foo' CONFIG_USER_FOO_FOO
  • The repetition of FOO allows for directories
    which contain multiple
  • executables. Thus, if the user directory 'foo'
    contained code to make 'foo'
  • and 'bar', each gets its own config line if an
    additional entry is made like
  • bool 'bar' CONFIG_USER_FOO_BAR

12
Adding User applications
  • Next, there needs to be a proper
    /user/foo/Makefile. The Makefile should follow
  • the following template
  • --------------------------------------------
  • EXEC foo
  • OBJS foo.o
  • all (EXEC)
  • (EXEC) (OBJS)
  • (CC) (LDFLAGS) -o _at_ (OBJS) (LDLIBS)
  • romfs
  • (ROMFSINST) /bin/(EXEC)
  • clean
  • -rm -f (EXEC) .elf .gdb .o
  • ---------------------------------------------

13
Adding User applications
  • If more than one executable is built in the foo
    directory, as above, then the
  • Makefile should look like
  • -----------------------------------------------
    -------------
  • EXECS foo bar
  • OBJS foo.o bar.o
  • all (EXECS)
  • (EXECS) (OBJS)
  • (CC) (LDFLAGS) -o _at_ _at_.o (LDLIBS)
  • romfs
  • (ROMFSINST) -e CONFIG_USER_FOO_FOO
    /bin/foo
  • (ROMFSINST) -e CONFIG_USER_FOO_BAR
    /bin/bar
  • -----------------------------------------------
    ---------------
  • More complex makefiles are of course possible.
    The reader is encouraged to
  • browse the user tree for examples.

14
Adding User applications
  • Assignment 1
  • Add an application which prints the following
    on the the stdout display of uClinux use the
    simulator

15
The tool chain
The compile process
cpp
cc1
as
ld
Write a Comment
User Comments (0)
About PowerShow.com