Skip to main content

Posts

Showing posts with the label compile linux

CROSS COMPILING X11 FOR ARM Board

STEPS FOR CROSS COMPILING X11 FOR ARM Go to /usr/X11R6/lib in my linux PC. 1) install ARM toolchain, If not installed 2) Get x11 source from http://www.x.org/ 3) extract all the tar files, using tar -xvzf 4) edit cross.def and host.def files, in cross.def set the paths of tool chain in host.def file set crossCompile to YES and DoLoadableServer to NO 5) make shadow directory "build" and link to xc "lndir ../xc" 6) run Make World error: linux_vm86.c 281 impossible constraint in 'asm' 268 res might be used uninitialized in this function. fix:comment line 281, set res=0 error: implicit decleration of function 'SET_FLAG' fix: comment line 111 in programs/Xserver/hw/xfree86/os-support/linux/int10/helper_exec.c error:Undefined reference to XF86VidModeQueryVersion in glxinfo And glxgears Undefined reference to XF86VidModeQueryVersion in xdriinfo fix:download libXxf86vm.so.1.0 into our armtoolchain lib path and make softlinks ln -s libXxf86vm.so.1.0 li...

How To Compile Tool Chain For Bootloader

For compiling Uboot 3.4.4 tool chain is required. Steps to check and change tool chain correspondingly 1) At the bash prompt of your Linux PC, execute the following command. $ tar -zxvf arm-tools.tar.gz Now you will have the "arm-tools" folder created in your current directory. 2) Copy the "arm-tools" directory to your home directory (or wherever you prefer to) $ cp -rf arm-tools ~/ 3) Modify the .bash_profile file in the home directory, by using the following steps. (Add the following lines in .bash_profile) $ vi ~/.bash_profile This will open the file for editing. Make the following changes in the file export HOME=$HOME/arm-tools PATH=$PATH:$HOME/bin:$HOME/arm-tools/arm-linux/bin:$HOME/arm- tools/image_tools/:$HOME/arm-tools/image_tools/bin export PATH Close the ".bash_profile" file. 4) Then execute the command $ source .bash_profile 5) To check whether arm-tools environment has been properly set or not type the...

Building Kernel for Embedded Linux with ARM board

I am giving general steps for building embedded linux for ARM board. Building kernel for embedded linux 1. Download kernel untar it using bz2 format is more compressed than gz ;bz2 - tar -xvjx linux-x.x.x GNU zip fromat gz - tar -xvzf linux-x.x.x 2. Configure kernel Before you make build the kernel configure it. Linux kernel provides lot of features and almost all driver support. All the features are not required for our embedded application. Select the required features, like processor type if your board have USB support select the USB support. If your board have SATA support select the requried module. one can configure linux kernel using make config - text based configuration make menuconfig - menu based configuration make xconfig - x11 based configuration make gconfig - gtk+ based configuration If you are new to configuration you can start with make defconfig - creates default configuration and kept in root folder as .config file. The flags which are set in this file are with CONF...

DHCP Client Server Porting Guide Steps Here

Looking for DHCP Client Server Porting Guide Steps? read on, 1.Download udhcp-0.9.8.tar.gz and Untar it >tar -zxvf udhcp-0.9.8.tar.gz 2.You will get udhcp-0.9.8 directory.Go to that directory >cd udhcp-0.9.8 3.The code can be compiled directly for gcc.For arm-linux > Go to Makefile and uncomment the CROSS-COMPILE (line 19) and edit >CROSS-COMPILE=arm-linux- 4.Now run make command from that directory. >make 5.You will get two binaries 1.udhcpd -- DHCP Server 2.udhcpc -- DHCP Client 6.For DHCP server: 1.copy udhcpd(binary) to /usr/sbin 2.copy udhcpd.conf in the directory samples to /etc directory 3.create an empty file udhcpd.leases in /var/lib/misc directoty 7.For DHCP client: 1.copy udhcpc(binary) to /sbin directory 2.copy all the scripts except udhcpd.conf in samples directory to /usr/share/udhcpc directory 3.Create an empty directory udhcpc in /etc directory. (In thi...

Steps For Booting Linux Kernel From USB Pen Drive

Boot Linux kernel from USB: Here are the steps for Booting Linux kernel from USB pen drive. If you have kernel image in pen drive then use these steps to boot from pen drive. 1) Create ext2 file system on USB. 2) Copy the kernel image to USB. 3) Connect the USB to embedded board. 4) From u-boot: Execute following commands. 5) “usb start” :– This will probe for usb mass storage devices. 6) “usb storage”:- shows the details of mass storage device. 7) “ext2ls usb o” :- lists the files in the USB. 8) “ext2load usb 0 7fc0 scp_zimage “ :- copies the embedded linux kernel file from usb and stores it in RAM 7fc0 9) Then do “bootm” to boot Linux.

ntfsprogs and Fuse Compilation errors and Solution here

Got some luck to compile ntfsprogs. Ntfsprogs are a collection of utilities for doing stuff with NTFS volumes. Steps to compile ntfsprogs . 1. get the FUSE and compile it. $ tar xvzf fuse-2.7.4.tar.gz $ ./configure --disable-kernel-module $ make getting error while compiling examples dir. libtool: link: gcc -Wall -W -Wno-sign-compare -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings -g -O2 -fno-strict-aliasing -o .libs/fusexmp fusexmp.o -pthread -pthread ../lib/.libs/libfuse.so -ldl ../lib/.libs/libfuse.so: undefined reference to `clock_gettime' make[1]: Leaving directory `/home/bhagwat/fuse-2.7.4/example' Solution is $ cd examples open Makefile go to line no 205 change the option from -ldl to -lrt $ cd ../make $ make install FUSE will be installed in default dir ie /usr/local/lib Get the ntfsprogs from linux-ntfs. untar ntfsprograms $ tar xvzf ntfsprogs-2.0.0.tar.gz $ ./configure --enable-ntfsmount still getting same error smount ntfsmount-ntfsmount.o ntfsmount-ut...

Scratchbox Cross-compiling Made Easy

Often Getting problems with corss compiling here is the perfect solution, read on. Scratchbox is a configuration and compilation environment for building Linux software and entire Linux distributions. The basic idea of Scratchbox is to offer developers an environment that works and looks like the target environment before the target environment is available. The Scratchbox is an environment that you log into like you would log into some machine. However, the Scratchbox tools can be used either inside or outside of Scratchbox download scratchbox-core http://www.scratchbox.org/download/files/sbox-releases/1.0/tarball/scratchbox-core-1.0.1-i386.tar.gz scratchbox-libs http://www.scratchbox.org/download/files/sbox-releases/1.0/tarball/scratchbox-libs-1.0.1-i386.tar.gz scratchbox-toolchain-arm-glibc http://www.scratchbox.org/download/files/sbox-releases/1.0/tarball/scratchbox-toolchain-arm-gcc3.3-glibc2.3-1.0.1-i386.tar.gz untar all tar ball using tar -xzf command then run $/scratchbox/run_m...

fdisk Compilation for ARM-Target board Errors

Today Trying my luck with compiling fdisk utility; Source code at: http://www.gnu.org/software/fdisk Current fdisk 1.0 is July 7 2007 370K source .tar.gz ./configure --disable-cfdisk --host=arm-linux --build=i686 --disable-largefile ./configure says to install GNU/Parted before compiling. It needs parted/parted.h. http://www.gnu.org/software/parted Latest version is 1.8.7 of May 2007. 1.4GB source code tar.gz. ./configure --host=arm-linux --build=i686 configure: error: GNU Parted requires libuuid - a part of the e2fsprogs package (but GNU Parted requires libuuid - a part of the e2fsprogs package (but sometimes distributed separately in uuid-devel or similar) This can probably be found on your distribution's CD or FTP site or at: http://web.mit.edu/tytso/www/linux/e2fsprogs.html Note: if you are using pre compiled packages you will also need the development package as well (which may be called e2fsprogs-devel or something similar). If you compile e2fsprogs yourself then y...

Install NTFS read Write Support ntfsmount a big Bang

Today's leanings are 1. How to create NTFS partition from FAT32 filesystem? Need to have windows XP or NT to run this command. Created NTFS partition using command from cmd prompt; - CONVERT F: /FS:NTFS 2. Major task was to enable NTFS Read/write support; Started with enabling NTFS_RW in Linux kernel, its help says; CONFIG_NTFS_RW: This enables the partial, but safe, write support in the NTFS driver. The only supported operation is overwriting existing files, without changing the file length. No file or directory creation, deletion or renaming is possible. Note only non-resident files can be written to so you may find that some very small files ( user level driver(requires FUSE) and kernel mode driver. Started with kernel mode driver from ntfs-3g which uses mkedev function ref to our arm-tool chain in file /tools/arm-tools-3.3.1/tools.Linux/hard_fp/armv5-linux/sys-include/sys/stat.h which is not there in my arm-linux toolchain. bangg... Now back to last option ie compile user...

Porting vsftpd server to ARM target Board

I want to cross compile vsftpd for my ARM target board? vsftpd is a GPL licensed FTP server for UNIX systems, including Linux. It is secure and extremely fast. It is stable. Don't take my word for it, though. Below, we will see evidence supporting all three assertions. We will also see a list of a few important sites which are happily using vsftpd. This demonstrates vsftpd is a mature and trusted solution. download vsftpd cross compile vsftpd # tar zxvf vsftpd-2.0.5.tar.gz #cd vsftpd-2.0.5 #vim Makefile Edit CC = arm-linux-gcc #make Now starts getting errors; /lib/libcap.so.1: could not read symbols means it can not find libcap shared library. use #which libcap and Edit vsf_findlibs.sh, shield “locate_library /lib/libcap.so.1 && echo "/lib/libcap.so.1";”, substitute with the path from #which libcap instead of /lib/libcap.so.1 now #make clean;make and done; Next one more hurdle, vsftpd server and vsftpd.conf configure file will be created. #cp vsftpd /path/to/ta...

Howto Build For x86 Host With Arm-Linux Target

How to Build For x86 Host With Arm-Linux Target? I need to build the source code for ARM-Linux target board, I just taken the source code untar it and executed make, just to check it compiles or not. Now Need to compile it for ARM target, so I was using $ ./configure --host=arm-linux-gcc --build=i686 --target=arm-linux-gcc and $ make but it was not compiling for arm-linux-gcc as while compiling it compiles with gcc option and not with arm-linux-gcc so You need to export the arm-gcc path before running ./configure. For example: $export CC=${arm-compiler-path}/arm-gcc $configure --target=arm-linux $make Still no luck to get the arm compiled binary. As I compiled using make initially and that time it created ./config.cache file This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. You need to delete this file ./config.cache and run again $./configure --host=arm-linux-gcc --build=i...

Kernel (for 2.6) debugging or module debugging

Kernel (for 2.6) debugging or module debugging kgdb is a kernel patch that, once applied, allows for the use of the familiar gdb interface for source-level debugging of a running Linux kernel. The kgdb patch supplies the kernel with a debugging stub. This stub uses gdb remote serial/Ethernet protocol to communicate with gdb (host machine). This patch is applied to the kernel on the machine that will run the gdb session (host machine). The gdbmod for module debugging, gdbmod version of gdb is required to debug modules that are loaded dynamically on to the testing machine. Download kgdb and gdbmod patch from: http://kgdb.linsyssoft.com/downloads.htm http://www.linuxjournal.com/article/4525 Reference Gdb quick ref guide. http://users.ece.utexas.edu/~adnan/gdb-refcard.pdf Simple how to http://www.shakthimaan.com/downloads/glv/kgdb-howto/kgdb-howto.html

Learning ARM linux commands for creating library

ARM Linux commands starts with arm-linux-* for example compiling source code for ctime.c be $ arm-linux-gcc -c -o ctimer.o ctimer.c This linux command generates ctimer.o as output. I was searching for the ARM-Linux command which will give me library. $ arm-linux-ar cr libctimer.a ctimer.o This command gives libctimer.a library to use in ARM linux platform. Simple usage will be, say this timer library want to use in test.c Compile test.c as $ arm-linux-gcc -L. -o tester -I. test.c -lctimer here . indicates library path, where the library is stored. And your exe tester is ready.

I/O schedulers

I/O schedulers are time consuming, --> re-orders reads and writes to disk --> minimize disk head movements. TIP If there is no hard disk in embedded system application then -->>Build your kernel with no-op I/O scheduler