Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
casacristo
Old
#1  
Senior Member - OP
Thanks Meter 51
Posts: 276
Join Date: Oct 2009

 
DONATE TO ME
Lightbulb [KERNEL] [DEV] MTK6573 kernel improvement effort

There are a number of chinese dual sim phones using the chipset MTK6573
Unfortunately the manufacturer has chosen to be very secretive about the kernel and

1) Has not published the source code
2) Has not included the kernel .config file in the compilation
3) Has not compiled ext2, ext3 or ext4 support in the kernel

In an effort to overcome some of those limitations I have gathered the exact same version of the android kernel used in current roms (2.6.35.7) and tried to come up with a configuraration that produces modules (.ko) that can be loaded and used from MTK6573 based devices.

Instructions for compiling the kernel:

Pre-requirements:
a) check with uname -a in your device that the kernel version is 2.6.35.7
b) Download this file with the kernel source and the arm toolchain:

http://www.ziddu.com/download/186284...chain.rar.html

1) Unpack the .rar file and extract the toolchain to your home folder
2) Extract the kernel sources somewhere you like
3) Open a bash terminal and cd into the folder containing the kernel source
4 ) make -j8 ARCH=arm menuconfig
That should open a menu and you will be able to modify options, the chosen system is a qualcom MSM as this is the closest thing I could find to the MTK6573

5) Compile with:
make -j8 ARCH=arm CROSS_COMPILE=~/code/distro/kernel/arm-2011.03/bin/arm-none-eabi-

6) to test the ext2.ko module
adb push fs/ext2/ext2.ko /data/local/
adb shell
insmod /data/local/ext2/ko

7) Try to mount an ext2 partition
HTC DESIRE - MildWild 8.0
SD CARD DESIRE: 32GB (FAT32+EXT4+EXT4)
Follow me on Twitter!

The Following 8 Users Say Thank You to casacristo For This Useful Post: [ Click to Expand ]
 
bgcngm
Old
(Last edited by bgcngm; 17th February 2012 at 10:29 PM.)
#2  
bgcngm's Avatar
Recognized Developer
Thanks Meter 1343
Posts: 1,642
Join Date: Apr 2007
Location: Lisbon

 
DONATE TO ME
We are really trying to overcome this situation and all the help is appreciated.

So far all the ext2.ko modules built can be loaded without any error, but as soon as the mount command is issued the phone immediately reboots. I can't even log anything. Any ideas?

EDIT:

Code:
lsmod
pvrsrvkm 151229 29 mtklfb, Live 0xbf000000
mtklfb 11329 0 - Live 0xbf033000
mtk_drvb 8436 0 - Live 0xbf03c000 (P)
lca_core 2706 0 - Live 0xbf044000 (P)
mtk_stp_core 211207 5 mt6620_fm_drv,mtk_stp_bt,mtk_stp_gps,mtk_stp_wmt,mtk_stp_u
art, Live 0xbf04a000 (P)
mtk_stp_uart 20598 1 - Live 0xbf087000 (P)
mtk_hif_sdio 10961 2 wlan,mtk_stp_wmt, Live 0xbf092000
mtk_stp_wmt 88860 6 wlan,mtk_fm_priv,mt6620_fm_drv,mtk_stp_bt,mtk_stp_gps, Live
0xbf09b000 (P)
mtk_stp_gps 37165 0 - Live 0xbf0ba000
mtk_stp_bt 39581 1 - Live 0xbf0c9000
mt6620_fm_drv 99803 1 mtk_fm_priv, Live 0xbf0d8000
mtk_fm_priv 7205 0 - Live 0xbf0f9000 (P)
wlan 255235 2 - Live 0xbf100000 (P)
ext2 44907 0 [permanent], Live 0xbf154000
ccci 195306 18 sec,ccmni, Live 0xbf167000 (P)
ccmni 16270 0 - Live 0xbf1a4000 (P)
mt6573_m4u 62946 0 - Live 0xbf1ae000 (P)
mt6573_mfv_kernel_driver 341502 0 - Live 0xbf1c5000 (P)
sec 52226 0 - Live 0xbf21f000 (P)
xlog 89315 24 - Live 0xbf233000 (P)
As you can see, ext2 module is loaded and cat /proc/filesystems confirms:

Code:
cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   tmpfs
nodev   sockfs
nodev   pipefs
nodev   anon_inodefs
nodev   devpts
nodev   ramfs
        vfat
        msdos
        yaffs
        yaffs2
nodev   mqueue
nodev   mtd_inodefs
        ext2
/sd-ext is created and the mount command that I'm issuing is:

Code:
busybox mount -r -w -t ext2 /dev/block/mmcblk0p2 /sd-ext


Latest custom ROMs: ZTE V987 (MT6589) / ZTE V970 (MT6577) / Huawei U8836D (MT6577)

If you like my work, please feel free to donate...

 
casacristo
Old
#3  
Senior Member - OP
Thanks Meter 51
Posts: 276
Join Date: Oct 2009

 
DONATE TO ME
I think the memory allocation is using something non-standard, perhaps the kernel for the mtk6516 is similar enough...


http://groups.google.com/group/mt651...6896ce22570932
HTC DESIRE - MildWild 8.0
SD CARD DESIRE: 32GB (FAT32+EXT4+EXT4)
Follow me on Twitter!

The Following User Says Thank You to casacristo For This Useful Post: [ Click to Expand ]
 
riystetyt
Old
#4  
Junior Member
Thanks Meter 2
Posts: 4
Join Date: Aug 2008
Location: Guarulhos
I tried this, but unsuccessful.

/data/local # insmod ext3.ko
insmod: can't insert 'ext3.ko': invalid module format
/data/local # insmod ext2.ko
insmod: can't insert 'ext2.ko': invalid module format
/data/local # insmod ext4.ko
insmod: can't insert 'ext4.ko': invalid module format

You could provide the modules compiled for us?
The kernel also does not support swap.

Thank you.
 
casacristo
Old
#5  
Senior Member - OP
Thanks Meter 51
Posts: 276
Join Date: Oct 2009

 
DONATE TO ME
kindly post the output of (after trying insmod ext2.ko )
dmesg

and

uname -a


Quote:
Originally Posted by riystetyt View Post
I tried this, but unsuccessful.

/data/local # insmod ext3.ko
insmod: can't insert 'ext3.ko': invalid module format
/data/local # insmod ext2.ko
insmod: can't insert 'ext2.ko': invalid module format
/data/local # insmod ext4.ko
insmod: can't insert 'ext4.ko': invalid module format

You could provide the modules compiled for us?
The kernel also does not support swap.

Thank you.
HTC DESIRE - MildWild 8.0
SD CARD DESIRE: 32GB (FAT32+EXT4+EXT4)
Follow me on Twitter!

The Following User Says Thank You to casacristo For This Useful Post: [ Click to Expand ]
 
riystetyt
Old
#6  
Junior Member
Thanks Meter 2
Posts: 4
Join Date: Aug 2008
Location: Guarulhos
Hello, thanks for your quick answer!

Errors for ext2.ko in dmesg:

[30005.453739] ext2: Unknown symbol kmalloc_caches (err 0)
[30005.454575] [17976:insmod] sig 17 to [11249:sh]

uname -a:

/data/local # uname -a
Linux localhost 2.6.35.7 #1 PREEMPT Mon Jan 9 16:05:35 CST 2012 armv6l GNU/Linux

Thanks for your help!
The Following User Says Thank You to riystetyt For This Useful Post: [ Click to Expand ]
 
casacristo
Old
#7  
Senior Member - OP
Thanks Meter 51
Posts: 276
Join Date: Oct 2009

 
DONATE TO ME
Is this the ext2.ko module you are trying to load?


ls -l /system/lib/modules/ext2.ko
-rw-r--r-- root root 756026 2012-05-02 18:20 ext2.ko
HTC DESIRE - MildWild 8.0
SD CARD DESIRE: 32GB (FAT32+EXT4+EXT4)
Follow me on Twitter!

The Following 2 Users Say Thank You to casacristo For This Useful Post: [ Click to Expand ]
 
riystetyt
Old
#8  
Junior Member
Thanks Meter 2
Posts: 4
Join Date: Aug 2008
Location: Guarulhos
Hello, I get the ext2.ko in your post on eten-users. Works like a charm! I had only about 8MB free and now with your module and Link2sd has 120MB. Thanks!
The Following User Says Thank You to riystetyt For This Useful Post: [ Click to Expand ]
 
casacristo
Old
#9  
Senior Member - OP
Thanks Meter 51
Posts: 276
Join Date: Oct 2009

 
DONATE TO ME
Glad it helps you.

In truth I donīt know what mediatek were thinking when they released an android kernel with so little nand storage space and no ext2 support.
HTC DESIRE - MildWild 8.0
SD CARD DESIRE: 32GB (FAT32+EXT4+EXT4)
Follow me on Twitter!

The Following User Says Thank You to casacristo For This Useful Post: [ Click to Expand ]
 
MR01
Old
(Last edited by MR01; 22nd May 2012 at 03:36 PM.)
#10  
Junior Member
Thanks Meter 2
Posts: 1
Join Date: May 2012
Hex Freq Value MTK CPU
Code:
        0x68t
        0xdft
        0x41t
        0xd8t
        0xeat
        0xf8t
        0x91t
        0x7t
        0x19t
        0x27t
        0x64t
        0xf1t
        0x93t
        0xedt
        0x21t
        0x59t
        0x6ft
        0x1t
        0x83t
        0x39t

The Following 2 Users Say Thank You to MR01 For This Useful Post: [ Click to Expand ]
 
Post Reply+
Tags
arm, cross_compile, kernel, mtk6573, toolchain
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...