The following is the steps about adding application into ucLinux on Skyeye 1.0:
(Gentoo 2.6.10-r6 version)
In order to mount the romfs.img , the loopback and rom file system support modules need to be installed first. After that, mount the file into a temporary directory and copy all contents and the application into another temporary directory.Finally make a new romfs.img and run skyeye.
1. Install loopback device support module for the host
This is only necessary for some Linux distributions. Other distributions, such as
FedoraCore, already have integrated support for loopback device.
gentoo test # mount -o loop romfs.img /mnt/temp
mount: Could not find any loop device. Maybe this kernel does not know
about the loop device? (If so, recompile or `modprobe loop'.)
gentoo linux # make menuconfig
Device Drivers->Block devices->[M]loopback device support
gentoo linux # make modules
gentoo linux # make modules_install
gentoo linux # depmod
gentoo linux # modprobe loop
gentoo linux # lsmod
Module Size Used by
loop 13480 -
tun 8736 -
2. Install ROM file system support module for the host
Again, do this if your Linux distribution doesn't have ROMFS support.
gentoo test # mount -o loop romfs.img /mnt/temp
mount: unknown filesystem type 'romfs'
gentoo linux # make menuconfig
File systems->[M]ROM file system support
gentoo linux # make modules
gentoo linux # make modules_install
fs/romfs/romfs.o
gentoo linux # depmod
gentoo linux # modprobe romfs
gentoo linux # lsmod
Module Size Used by
romfs 6564 -
loop 13480 -
tun 8736 -
3. Mount romfs.img on a temporary directory of the host
gentoo test # mount -o loop romfs.img /mnt/temp
gentoo test # cd /mnt/temp
gentoo temp # ls
bin dev etc home lib mnt proc sbin tmp usr var
4. Copy all contents from the above temporary directory and the own application into another temporary directory of the host.
gentoo test # cp -r /mnt/temp/* romfs
gentoo test # cd romfs
gentoo romfs # ls
bin dev etc home lib mnt proc sbin tmp usr var
gentoo test # cp hello ./romfs/bin
(note: another temporary directory name : romfs
the application name : hello)
5. Make a new romfs.img using the temporary directory which has the application.
gentoo test # genromfs -f romfs.img -d romfs/
OK!Now , it is a time to run linux on Skyeye and then to run the application
gentoo test # skyeye -e linux
/> cd bin
/bin> hello
i = 0 Hello, embedded linux!
i = 1 Hello, embedded linux!
i = 2 Hello, embedded linux!
i = 3 Hello, embedded linux!
i = 4 Hello, embedded linux!
i = 5 Hello, embedded linux!
Appendix : How to get the simple “Hello” execute program on the host for Linux on Skyeye
1. Install
ucLinux ARM cross compiler∞ for the host.
chmod a+x arm-elf-tools-20030314.sh
./arm-elf-tools-20030314.sh
2. Edit source code
#include <stdio.h>
int main(void) {
int i;
for (i = 0; i < 6; i=i+1) {
printf("i = %d ",i);
printf("Hello, embedded linux!\n");
}
return 0;
}
3. Compile the source code on the host
arm-elf-gcc -Wl,-elf2flt -o hello hello.c
There are 2 comments on this page. [Display comments]