Wednesday, November 19, 2008

Porting Linux kernel 2.6.25 (Android version) to SAMSUNG S3C2440A

It is fun! Last time, I was porting android to TI Davinci DM355 failed.

This time, I am porting android to SAMSUNG S3C2440A, successfully.

Now, the kernel is bootable, my next step has works:

  • Mounting file system (Temporarily, I can ping to OS, it means that the OS has worked)
  • Tuning GUI and some hardware related driver
  • Porting android's OS environment and demo APs
  • Developing applications

Following list describes basic configuration in the build process; for tuning in detail, some hardware related configuration is a must step, the good references are as following:

linux-2.6.26内核移植到S3C2440平台
linux-2.6.25内核移植到S3C2440平台
移植内核2.6.24.4到S3C2440
《Linux系统移植》


A simple description of porting steps:

CPU is SAMSUNG S3C2440A
Linux kernel Android version 2.6.25.
Cross compiled GCC and build basic OS eviroment, please check this site:
Cross-Compiled Linux From Scratch - Embedded (Version SVN-0.0.1-20080109-arm).


() Busybox-1.12.1 - OS's working environment

cd ${ARMDEV}/build
tar -jxvf ${ARMDEV}/sources/busybox-1.12.1.tar.bz2
cd busybox-1.12.1
patch -Np1 -i ../busybox-1.12.1-fixes-1.patch
patch -Np1 -i ../busybox-1.12.1-iptunnel_headers-1.patch
make defconfig

BUSYBOX_OPTIONS="CONFIG_DMALLOC CONFIG_BUILD_AT_ONCE CONFIG_BUILD_LIBBUSYBOX
CONFIG_FEATURE_SH_IS_NONE CONFIG_LOCALE_SUPPORT CONFIG_TFTP CONFIG_FTPGET
CONFIG_FTPPUT CONFIG_IPCALC CONFIG_TFTP CONFIG_HUSH CONFIG_LASH
CONFIG_MSH CONFIG_INETD CONFIG_DPKG CONFIG_RPM2CPIO CONFIG_RPM
CONFIG_FOLD CONFIG_LOGNAME CONFIG_OD CONFIG_CRONTAB CONFIG_UUDECODE
CONFIG_UUENCODE CONFIG_SULOGIN CONFIG_DC CONFIG_DEBUG_YANK_SUSv2
CONFIG_DEBUG_INIT CONFIG_DEBUG_CROND_OPTION CONFIG_FEATURE_UDHCP_DEBUG
CONFIG_TASKSET CONFIG_CHATTR CONFIG_FSCK CONFIG_LSATTR CONFIG_CHPST
CONFIG_SETUIDGID CONFIG_ENVUIDGID CONFIG_ENVDIR CONFIG_SOFTLIMIT
CONFIG_FEATURE_2_4_MODULES"
for config in $BUSYBOX_OPTIONS; do
cp .config{,.orig}
sed -e "s:${config}=y:${config}=n:" .config.orig > .config
done
BUSYBOX_OPTIONS="CONFIG_FEATURE_SH_IS_ASH CONFIG_FEATURE_TRACEROUTE_VERBOSE CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE"
for config in $BUSYBOX_OPTIONS; do
cp .config{,.orig}
sed -e "s:# ${config} is not set:${config}=y:" .config.orig > .config
done

make ARCH=arm CROSS_COMPILE="${ARM_TARGET}-"
make ARCH=arm CROSS_COMPILE="${ARM_TARGET}-" CONFIG_PREFIX="${ARMDEV}" install

cp examples/depmod.pl ${ARMDEV}/cross-tools/bin
chmod 755 ${ARMDEV}/cross-tools/bin/depmod.pl


() Ext2 - file system tool

cd ${ARMDEV}/build
tar -zxvf ${ARMDEV}/sources/e2fsprogs-1.39.tar.gz
cd e2fsprogs-1.39
mkdir -v build
cd build
CC="${CC} -Os" ../configure --build=${ARM_HOST} --host=${ARM_TARGET} --prefix=/usr --with-root-prefix="" --with-cc="${CC} -Os" --with-linker=${LD}
make
make DESTDIR=${ARMDEV} install
make DESTDIR=${ARMDEV} install-libs


() Iana-Etc-2.20 - network services and communication protocol

cd ${ARMDEV}/build
tar -jxvf ${ARMDEV}/sources/iana-etc-2.20.tar.bz2
cd iana-etc-2.20
make
make DESTDIR=${ARMDEV} install


() Zlib-1.2.3 0 - compress and uncompress program

cd ${ARMDEV}/build
tar -zxvf ${ARMDEV}/sources/zlib-1.2.3.tar.gz
cd zlib-1.2.3
patch -Np1 -i ${ARMDEV}/sources/zlib-1.2.3-DESTDIR-1.patch
cp configure{,.orig}
sed -e 's/-O3/-Os/g' configure.orig > configure

CC="${CC}" ./configure --prefix=/usr --shared
make
make DESTDIR=${ARMDEV} install
mv -v ${ARMDEV}/usr/lib/libz.so.* ${ARMDEV}/lib
ln -svf ../../lib/libz.so.1 ${ARMDEV}/usr/lib/libz.so


() Build password protection mechanics

echo "Create /etc/shadow file"
cat > ${ARMDEV}/etc/shadow << "EOF"
root:$1$BQY1.ACn$rvcsFmggQFH.jyCD/X/NV1:13553:0:99999:7:::
bin:x:13553:0:99999:7:::
daemon:x:13553:0:99999:7:::
adm:x:13553:0:99999:7:::
lp:x:13553:0:99999:7:::
mail:x:13553:0:99999:7:::
news:x:13553:0:99999:7:::
uucp:x:13553:0:99999:7:::
operator:x:13553:0:99999:7:::
postmaster:x:13553:0:99999:7:::
nobody:x:13553:0:99999:7:::
EOF


() cramfs-1.1 - tool for building file system

cd ${ARMDEV}/build
tar -zxvf ${ARMDEV}/sources/cramfs-1.1.tar.gz
cd cramfs-1.1
make

$ su
# cp mkcramfs /usr/bin
# cp cramfsck /usr/bin


() JFFS2 - manage file system of Flash memory

cd ${ARMDEV}/sources
cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs login #password: anoncvs
cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs co mtd
cd mtd/util/
make clean
make
cp mkfs.jffs /sbin
cp mkfs.jffs2 /sbin


() /etc/fstab

cat > ${ARMDEV}/etc/fstab << "EOF"
# Begin /etc/fstab

# Help information
# man 5 fstab

# file system mount-point type options dump fsck
# order

/dev/ram / ext2 defaults 1 1
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
shm /dev/shm tmpfs defaults 0 0
none /proc/bus/usb usbdevfs defaults 0 0

# End /etc/fstab
EOF


() Linux-2.6.25 (android version)

cd ${ARMDEV}/build
tar -jxvf ${ARMDEV}/sources/linux-2.6.25-android-1.0_r1.tar.gz
mv kernel.git linux-android-2.6.25
cd linux-android-2.6.25
make mrproper

make ARCH=arm CROSS_COMPILE=${ARM_TARGET}- s3c2410_defconfig
make ARCH=arm CROSS_COMPILE=${ARM_TARGET}- gconfig

The following configuration is only for my evaluation board, just for reference.
Device Drivers
Block Devices BLK_DEV
RAM block device support BLK_DEV_RAM
(2) Default number of RAM disks BLK_DEV_RAM_COUNT
(41984) Default RAM disk size (kbytes) BLK_DEV_RAM_SIZE
(1024) Default RAM disk block size (bytes) BLK_DEV_RAM_BLOCKSIZE

File systems
Kernel automounter support AUTOFS_FS
kernel automounter version 4 support AUTOFS4_FS
Filesystem in Userspace support FUSE_FS
Pseudo filesystems
/dev/ file system support DEVFS_FS
Virtual memory file system support (former shm fs) TMPFS
Userspace-driven configuration filesystem CONFIGFS_FS
Miscellaneous filesystems
YAFFS2 file system support YAFFS_FS
512 byte / page devices YAFFS_YAFFS1
2048 byte / page devices YAFFS_YAFFS2
Network File Systems NETWORK_FILESYSTEMS
NFS file system support NFS_FS
Provide NFSv3 client support NFS_V3
Root file system on NFS ROOT_NFS
Journalling Flash File System v2 (JFFS2) support JFFS2_FS
JFFS2 debugging verbosity (0 = quiet, 2 = noisy) JFFS2_FS_DEBUG
JFFS2 write-buffering support JFFS2_FS_WRITEBUFFER
Advanced compression options for JFFS2 JFFS2_COMPRESSION_OPTIONS
JFFS2 ZLIB compression support JFFS2_ZLIB
JFFS2 RTIME compression support JFFS2_RTIME
JFFS2 RUBIN compression support JFFS2_RUBIN

Boot options
Default kernel command string CMDLINE {command}
{command}
root=/dev/hda1 rw rootfstype=cramfs noinitrd init=/linuxrc console=ttySAC0,115200 mem=64M


() /linuxrc

cd ${ARMDEV}
mv linuxrc linuxrc.busybox
cat > ${ARMDEV}/linuxrc << "EOF"
#!/bin/sh

echo "mount /etc as ramfs"
/bin/mount -n -t ramfs ramfs /etc
/bin/cp -a /mnt/etc/* /etc

# re-create the /etc/mtab entries
echo "re-create the /etc/mtab entries"
/bin/mount -f -t cramfs -o remount,ro /dev/mtdblock1 /

# mount some file system
echo "--------munt /dev/shm as tmpfs"
/bin/mount -n -t tmpfs tmpfs /dev/shm

# mount /proc as proc file system
echo "--------mount /proc as proc"
/bin/mount -n -t proc none /proc

# mount /sys as sysfs file system
echo "--------mount /sys as sysfs
/bin/mount -n -t sysfs none /sys

#input command to LCD
#sh < /dev/ttyS0

exec /sbin/init
EOF

chmod 775 ${ARMDEV}/linuxrc


() /etc/inetd.conf

cat > ${ARMDEV}/etc/inetd.conf << "EOF"
#
telnet stream tcp nowait root /usr/sbin/telnetd
EOF


() CLFS-Bootscripts-1.0-pre4

cd ${ARMDEV}/build
tar -jxvf ${ARMDEV}/sources/clfs-embedded-bootscripts-1.0-pre4.tar.bz2
cd clfs-embedded-bootscripts
make DESTDIR=${ARMDEV} install

() /etc/mdev.conf

cat > ${ARMDEV}/etc/mdev.conf << "EOF"
# /etc/mdev/conf
SLEEP=10

# Symlinks:
# Syntax: %s -> %s

MAKEDEV -> ../sbin/MAKEDEV
/proc/core -> kcore
fd -> /proc/self/fd
mcdx -> mcdx0
radio -> radio0
ram -> ram1
sbpcd -> sbpcd0
sr0 -> scd0
sr1 -> scd1
sr10 -> scd10
sr11 -> scd11
sr12 -> scd12
sr13 -> scd13
sr14 -> scd14
sr15 -> scd15
sr16 -> scd16
sr2 -> scd2
sr3 -> scd3
sr4 -> scd4
sr5 -> scd5
sr6 -> scd6
sr7 -> scd7
sr8 -> scd8
sr9 -> scd9
stderr -> fd/2
stdin -> fd/0
stdout -> fd/1

# Remove these devices, if using a headless system
# You will see an error mdev: Bad line 35
vbi -> vbi0
vcs -> vcs0
vcsa -> vcsa0
video -> video0
# Stop Remove for headless system

# Devices:
# Syntax: %s %d:%d %s
# devices user:group mode

null 0:0 777
zero 0:0 666

urandom 0:0 444

console 0:5 0600
fd0 0:11 0660
hdc 0:6 0660
kmem 0:9 000
mem 0:9 0640
port 0:9 0640
ptmx 0:5 0660

sda* 0:6 0660
sdb* 0:6 0660
hda* 0:6 0660
hdb* 0:6 0660

tty 0:5 0660
tty0* 0:5 0660
tty1* 0:5 0660
tty2* 0:5 0660
tty3* 0:5 0660
tty4* 0:5 0660
tty5* 0:5 0660
tty6* 0:5 0660

ttyS* 0:20 640
EOF


() /etc/profile

cat > ${ARMDEV}/etc/profile << "EOF"
# /etc/profile

# Set the initial path
export PATH=/bin:/usr/bin

if [ 'id -u' -eq 0 ] ; then
PATH=/bin:/sbin:/usr/bin:/usr/sbin
unset HISTFILE
fi

# Setup some environment variables.
export USER='id -un'
export LOGNAME=$USER
export HOSTNAME='/bin/hostname'
export HISTSIZE=1000
export HISTFILESIZE=1000
export PAGER='/bin/more '
export EDITOR='/bin/vi'
export INPUTRC=/etc/inputrc

# End /etc/profile
EOF


() Creating the /etc/inputrc File

cat > ${ARMDEV}/etc/inputrc << "EOF"
# Begin /etc/inputrc
# Modified by Chris Lynn

# Allow the command prompt to wrap to the next line
set horizontal-scroll-mode Off

# Enable 8bit input
set meta-flag On
set input-meta On

# Turns off 8th bit stripping
set convert-meta Off

# Keep the 8th bit for display
set output-meta On

# none, visible or audible
set bell-style none

# All of the following map the escape sequence of the
# value contained inside the 1st argument to the
# readline specific functions

"\eOd": backward-word
"\eOc": forward-word

# for linux console
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert

# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# for Konsole
"\e[H": beginning-of-line
"\e[F": end-of-line

# End /etc/inputrc
EOF


() /etc/inittab

cat > ${ARMDEV}/etc/inittab << "EOF"
# /etc/inittab

::sysinit:/etc/rc.d/startup

::respawn:/usr/sbin/telnetd

tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
tty5::respawn:/sbin/getty 38400 tty5
tty6::respawn:/sbin/getty 38400 tty6

# Put a getty on the serial line (for a terminal)
# uncomment this line if your using a serial console
#::respawn:/sbin/getty -L ttyS0 115200 vt100
::respawn:/sbin/getty -L ttySAC0 115200 vt100
#T0:12345:respawn:/sbin/getty -n -l /usr/local/sbin/autologin -L /dev/tts/1 115200 vt100

::shutdown:/etc/rc.d/shutdown
::ctrlaltdel:/sbin/reboot
EOF


() Setting Hostname

echo "android" > ${ARMDEV}/etc/HOSTNAME

() /etc/hosts File

Has network card

cat > ${ARMDEV}/etc/hosts << "EOF"
# Begin /etc/hosts (network card version)

127.0.0.1 localhost
192.168.1.30 android.wizign.com android

# End /etc/hosts (network card version)
EOF

Without network card

cat > ${ARMDEV}/etc/hosts << "EOF"
# Begin /etc/hosts (no network card version)

127.0.0.1 dpf-dev.wizign.com dpf-dev localhost

# End /etc/hosts (no network card version)
EOF

() Configuring the network Script

cat > ${ARMDEV}/etc/network.conf << "EOF"
# /etc/network.conf
# Global Networking Configuration
# interface configuration is in /etc/network.d/

# set to yes to enable networking
NETWORKING=yes

# set to yes to set default route to gateway
USE_GATEWAY=no

# set to gateway IP address
GATEWAY=192.168.1.1
EOF


() creates a sample interface.eth0 file for the eth0 device:

mkdir ${ARMDEV}/etc/network.d &&
cat > ${ARMDEV}/etc/network.d/interface.eth0 << "EOF"
# Network Interface Configuration

# network device name
INTERFACE=eth0

# set to yes to use DHCP instead of the settings below
DHCP=no

# IP address
IPADDRESS=192.168.1.30

# netmask
NETMASK=255.255.255.0

# broadcast address
BROADCAST=192.168.1.255
EOF


() Creating the ${ARMDEV}/etc/resolv.conf File

cat > ${ARMDEV}/etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf

domain wizign.com
nameserver 168.95.1.1
nameserver 168.95.192.1

# End /etc/resolv.conf
EOF


() Copy the clean OS system, preparing to port on the evaluation board

su -

if [ ! -d /mnt/armdev_fs ]; then
mkdir /mnt/armdev_fs
fi
mount --bind /vdisk/armdev_fs /mnt/armdev_fs

export ARMDEV="/mnt/armdev"
export ARMDEV_FS="/mnt/armdev_fs"

for dir in $(ls "${ARMDEV}"); do
if [ "$dir" == 'sources' ]; then
echo "Skip $dir"
elif [ "$dir" == 'build' ]; then
echo "Skip $dir"
elif [ "$dir" == 'cross-tools' ]; then
echo "Skip $dir"
else
cp -avr ""${ARMDEV}"/$dir" "${ARMDEV_FS}/."
fi
done

rm -rfv ${ARMDEV_FS}/usr/src/*
rm -rfv ${ARMDEV_FS}/usr/include
rm -rfv ${ARMDEV_FS}/usr/man
rm -rfv ${ARMDEV_FS}/usr/share/man

FILES="'ls ${ARMDEV_FS}/lib/*.a ${ARMDEV_FS}/usr/lib/*.a'"
for file in $FILES; do
rm -fv $file
done

chown -Rv root:root ${ARMDEV_FS}
chgrp -v utmp ${ARMDEV_FS}/var/run/utmp ${ARMDEV_FS}/var/log/lastlog
mknod -m 0666 ${ARMDEV_FS}/dev/null c 1 3
mknod -m 0600 ${ARMDEV_FS}/dev/console c 5 1

If using cramfs
mkcramfs ${ARMDEV_FS} /mnt/rootfs.cramfs
cp /mnt/rootfs.cramfs /var/lib/tftpboot/ramdisk-android-2.6.25.cramfs

If using jffs2
mkfs.jffs2 -d ${ARMDEV_FS} -p -s 0x200 -e 0x4000 -n -l -U -o ramdisk.jffs2
cp /mnt/ramdisk.jffs2 /var/lib/tftpboot/ramdisk-android-2.6.25.jffs2


() This shell script is used to build RAM disk

cat > /mnt/mkramdisk.sh << "EOF"
#! /bin/bash

# Remove files
echo "remove files"
rm -f ramdisk.img.gz
rm -f ramdisk32.img
rm -f ramdisk.img
rm -fr ramdisk

# Create ramdisk32
echo "create ramdisk32"
cd /mnt
dd if=/dev/zero of=ramdisk32.img bs=1024 count=40960
mke2fs -F -vm0 ramdisk32.img
mkdir ramdisk
mount -o loop ramdisk32.img ramdisk
cd ramdisk/
cp -arv ${ARMDEV_FS}/* .
cd ..
umount ramdisk

# Make ram disk image
echo "make ram disk image"
cp ramdisk32.img ramdisk.img
gzip ramdisk.img
./mkimage -A arm -O linux -T ramdisk -C gzip -a 30080000 -e 30080000 -d ramdisk.img.gz -n 'SBZ2440 Ramdisk' ram.img

# copy files
echo "Copy RAM disk file"
cp ram.img /var/lib/tftpboot/ramdisk-android-2.6.25.s
echo "Copy uImage file"
cp ${ARMDEV}/build/linux-android-2.6.25/arch/arm/boot/uImage /var/lib/tftpboot/uImage-android-s3c2440
EOF


() The booting processes is as following:

Starting kernel ...

Uncompressing Linux........................................................................................................... done, booting the kerne.
Linux version 2.6.25 (armdev@test.intra.wizign.com) (gcc version 4.1.2) #54 Wed Nov 19 09:19:00 CST 2008
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SBZ2440
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 399.651 MHz, memory 133.217 MHz, peripheral 66.608 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (2.116 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: root=/dev/nfs rw noinitrd console=ttySAC0,115200 init=/linuxrc nfsroot=192.168.1.12:/vdisk/armdev_fs ip=192.168.1.30:192.168.1.12f
irq: clearing pending ext status 00000080
irq: clearing subpending status 00000003
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00500000, tcnt d8d2, tcfg 00000200,00000000, usec 0000170f
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61184KB available (3040K code, 507K data, 144K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 152 bytes
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
S3C244X: Clock Support, DVS off
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
fuse init (API version 7.9)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 30x40
fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.30
eth0: dm9000 at c485e300,c4860304 IRQ 51 MAC: 08:00:3e:26:0a:5b (chip)
Uniform Multi-Platform E-IDE driver
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
BAST NOR-Flash Driver, (c) 2004 Simtec Electronics
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=3, 22ns Twrph0=8 60ns, Twrph1=3 22ns
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 2 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00200000 : "Kernel"
0x00200000-0x04000000 : "root partition"
usbmon: debugfs is not available
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 378 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
logger: created 64K log 'log_main'
logger: created 64K log 'log_events'
logger: created 64K log 'log_radio'
TCP cubic registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
IP-Config: Complete:
device=eth0, addr=192.168.1.30, mask=255.255.255.0, gw=192.168.1.1,
host=Android, domain=, nis-domain=(none),
bootserver=192.168.1.12, rootserver=192.168.1.12, rootpath=
prepare_namespace() - start
mount_root()
Looking up port of RPC 100003/2 on 192.168.1.12
Looking up port of RPC 100005/1 on 192.168.1.12
VFS: Mounted root (nfs filesystem).
prepare_namespace() - end
Freeing init memory: 144K


() Use ping to test that the system is booted

$ ping 192.168.1.30
PING 192.168.1.30 (192.168.1.30) 56(84) bytes of data.
64 bytes from 192.168.1.30: icmp_seq=1 ttl=64 time=0.417 ms
64 bytes from 192.168.1.30: icmp_seq=2 ttl=64 time=0.384 ms
64 bytes from 192.168.1.30: icmp_seq=3 ttl=64 time=0.381 ms

9 comments:

17 Sweat said...

Dear Yen,

真厲害! 結合手機後應用範圍似乎很廣,以下為網路上10個酷的Android application.

http://www.techcrunch.com/2008/10/22/top-ten-android-launch-apps/

目前手機皆有voice,相機,GPS,指南針,bluetooth,wireless,web與加速感應器可參考這些功能,畫出矩陣討論如何應用與整合.

Unknown said...

Hi 大大:
小弟目前也想在2440上移植android,看了許多文章還是一知半解,想請教一下, google release的android kernel source code,網上提到需要做patch才能在2440 armv4t架構上跑, 這步驟需要做嗎?
謝謝

Causality said...

本人沒有直接使用 patch, 只是參考 patch 的內容, 列出每個檔案, 然後再個別去修改.

Pan said...

您好~小弟最近也在做android的移植到s3c2440,kernel雖然建置好了可是rootfs檔案太大燒不進去,所以也不知道android開得起來與否,您的文章很有參考價值,不知道您是否願意step by step教大家如何從kernel開始一直到filesystem建置,小弟不勝感激!

Causality said...

本人會很認真的考慮您的建議!
只是目前工作繁忙, 實在沒空做這件事. 再來就是如果要做, 可能會找新的開發板, 不會用 2440 了.

Good luck!

Unknown said...

Dear Yen,

我也是Port到2440上, 但看到一堆亂碼...
會是什麼問題嗎? 煩請不另賜教, 謝謝您

還有, 您的文章實在超讚, 非常清楚的step by step

Unknown said...

Dear Yen,

我已經找到為什麼亂碼的原因了, 請參照這個URL, 還是謝謝您的整理

http://blog.chinaunix.net/u1/42908/showart_2009766.html

Unknown said...

S3C2440不是V4t架構嗎?

Android不是說需要V5t架構才行?

不懂??

還有Android的GUI您有跑出來嗎?

我很好奇?

感謝回答!!!

Causality said...

就我所知, 只要 CPU 的 kernel 有支援 EABI, 應該就有 porting 成功的機會, 只是工作量多寡的問題吧.

GUI 部分, 還沒空繼續做下去, 如果有人願意贊助我做開發, 我倒是很樂意繼續深入 android 相關的 porting.