Sunday, November 29, 2009

Cross Toolchains : PART2 (Kernel Headers)

1. Download the kernel sources from kernel.org

2. cd to the sources root directory

3. run the following command to extract the headers for ARM

make headers_install ARCH=arm INSTALL_HDR_PATH=/usr/include/arm-linux-headers
Where ARCH specifies the architecture for which the headers are to be generated. INSTALL_HDR_PATH is the path on the local system where the header files will be placed. The default is /usr/include

To see a list of all supported architectures

ls -d include/asm-* | sed 's/.*-//'

make headers_install_all exports headers for all architectures simultaneously. Not very useful for the average embedded programmer.

#Decribe the API for the user space programs wishing to use kernel services
#Used by system's C library (glibc or uClibc) to define available system calls as well as constants and structures to be used with these system calls.
#Kernel headers are backward compatible.


[Sources : 1. Documentation/make/headers_install.txt ]
nemesis@nemesis-laptop:~/arm-linux-kernel/linux-2.6.31.6$ sudo make headers_install ARCH=arm INSTALL_HDR_PATH=/usr/include/arm-linux
CHK include/linux/version.h
make[1]: `scripts/unifdef' is up to date.
INSTALL include/asm-generic (34 files)
INSTALL include/drm (12 files)
INSTALL include/linux/byteorder (2 files)
INSTALL include/linux/can (4 files)
INSTALL include/linux/dvb (8 files)
INSTALL include/linux/hdlc (1 file)
INSTALL include/linux/isdn (1 file)
INSTALL include/linux/netfilter (58 files)
INSTALL include/linux/netfilter_arp (2 files)
INSTALL include/linux/netfilter_bridge (16 files)
INSTALL include/linux/netfilter_ipv4 (46 files)
INSTALL include/linux/netfilter_ipv6 (21 files)
INSTALL include/linux/nfsd (6 files)
INSTALL include/linux/raid (2 files)
INSTALL include/linux/spi (1 file)
INSTALL include/linux/sunrpc (1 file)
INSTALL include/linux/tc_act (6 files)
INSTALL include/linux/tc_ematch (4 files)
INSTALL include/linux/usb (8 files)
INSTALL include/linux/wimax (1 file)
INSTALL include/linux (352 files)
INSTALL include/mtd (5 files)
INSTALL include/rdma (1 file)
INSTALL include/scsi (4 files)
INSTALL include/sound (9 files)
INSTALL include/video (3 files)
INSTALL include/xen (1 file)
INSTALL include (0 file)
INSTALL include/asm (32 files)

No comments: