5,595,428 Members 47,683 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE][HOW TO]Compile S5670 kernel with many Features :D

Tip us?
 
zcop
Old
(Last edited by zcop; 1st May 2012 at 01:15 PM.)
#1  
Senior Member - OP
Thanks Meter 454
Posts: 250
Join Date: Nov 2011
Location: Hanoi

 
DONATE TO ME
Default [GUIDE][HOW TO]Compile S5670 kernel with many Features :D

Menu:

1. Guide install Ubuntu

2. Download Source and Setup workspace

3. Feature
Make kernel support EXT2, 3, 4
Make Overclock, Undervolt kernel, add IO shedule and CPU Gorvernor
Make kernel support Cifs Manager and DroidVPN( add cifs and tun module to kernel)
Make kernel support SWAP
4. Finish your work - Compile kernel and pack new boot image
The Following 30 Users Say Thank You to zcop For This Useful Post: [ Click to Expand ]
 
zcop
Old
(Last edited by zcop; 4th April 2012 at 02:11 PM.)
#2  
Senior Member - OP
Thanks Meter 454
Posts: 250
Join Date: Nov 2011
Location: Hanoi

 
DONATE TO ME
You need linux enviroment to compile kernel.
Suggest: Install Ubuntu 64bit.
Download:http://www.ubuntu.com/download/ubuntu/download
Select Ubuntu 11.10 and 64bit version

Hardware required:
CPU >= 1,5Ghz
Ram >= 2GB
HDD atleast 20GB space left

After complete download Ubuntu. You have 3 choices:
-Install Ubuntu in VMware
-Install Ubuntu like system OS
-Install Ubuntu like a soft in Windows
I recommend the 3rd way.

Extract ISO file with winzip or winra or 7z to a folder.
Go in to that folder run wubi.exe




Restart to complete install ubuntu.

If you want to uninstall Ubuntu: go to Control Panel and uninstall Ubuntu like other soft in windows.

Ubuntu 11.10 come with a wifi problem. Broadcom chip has no driver. Solution:
-Turn on wifi on S5670
-USB tether
-Now you have internet
-Follow pitures to solve problem




The Following 22 Users Say Thank You to zcop For This Useful Post: [ Click to Expand ]
 
zcop
Old
(Last edited by zcop; 4th April 2012 at 02:16 PM.)
#3  
Senior Member - OP
Thanks Meter 454
Posts: 250
Join Date: Nov 2011
Location: Hanoi

 
DONATE TO ME
Download S5670 Newest Source release

https://opensource.samsung.com/index.jsp


Link Mediafire

Download Toolchain to compile kernel
https://sourcery.mentor.com/sgpp/lit...ux-gnu.tar.bz2
After download complete follow pitures












After all workplace should like this


How to open Terminal



Or use combo key: CTRL+ALT+T

Open Terminal copy command below an paste in Terminal
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
Now you need a boot.img that you want to modify kernel. Exp: Boot.img from DXKT4
You need tool to unpack, repack boot.img
http://www.mediafire.com/?zdw766gu35o0fb6
Thank to ketut.kumajaya about his useful tool.
Extract to folder android
In Terminal
Code:
cd /home/your username/android/boot.img-tools
Now copy boot.img to folder called source_img in boot.img-tools folder above
Open Readme.txt
Follow the guide to extract boot.img
================================================== ==========================================
After extract boot.img done
Code:
cd /home/your username/android/GT-S5830_kernel/kernel
Code:
gedit Makefile
A text file open
Ctrl+F type: cross_compile
Find:
Code:
CROSS_COMPILE   =../../toolchain/arm-eabi-4.4.3/bin/arm-eabi-
Change to
Code:
CROSS_COMPILE   =../arm-2011.03/bin/arm-none-eabi-
Ctrl+S
Close
Code:
cd /home/your username/android/boot.img-tools/boot/lib/modules
Code:
strings fsr.ko | grep vermagic
You'll see something like this
Code:
vermagic=2.6.35.7-perf-CL783107 preempt mod_unload ARMv6
Go to home/android/GT-S5830_kernel/kernel/arch/arm/configs
Find beni_rev01_defconfig open with gedit( double click to file > Display)
Find line
Code:
CONFIG_LOCALVERSION="-perf"
change to
Code:
CONFIG_LOCALVERSION="-perf-CL783107"
The RED depends on your boot.img so it's diffirent the one from mine
The Following 17 Users Say Thank You to zcop For This Useful Post: [ Click to Expand ]
 
Aspire
Old
#4  
Aspire's Avatar
Senior Member
Thanks Meter 343
Posts: 1,047
Join Date: Dec 2011
Location: Vancouver

 
DONATE TO ME
guide to installing Ubuntu?

---------- Post added at 06:07 PM ---------- Previous post was at 06:06 PM ----------

linux environment can be accessed on windows directly using cygwin.....
Nexus 4 @ KRT16O

Samsung Galaxy Fit @ MusicMod

Search XDA Forums | You're invited to try Dropbox
The Following 2 Users Say Thank You to Aspire For This Useful Post: [ Click to Expand ]
 
zcop
Old
(Last edited by zcop; 19th March 2012 at 06:29 PM.)
#5  
Senior Member - OP
Thanks Meter 454
Posts: 250
Join Date: Nov 2011
Location: Hanoi

 
DONATE TO ME
GUIDE make kernel SUPPORT EXT2,3,4
Open beni_rev01_defconfig
find line "File systems" edit "# CONFIG_EXT3_FS is not set" to "CONFIG_EXT3_FS=y"
Code:
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_POSIX_ACL is not set
# CONFIG_EXT2_FS_SECURITY is not set
# CONFIG_EXT2_FS_XIP is not set
# CONFIG_EXT3_FS is not set
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
# CONFIG_EXT4_FS_SECURITY is not set
# CONFIG_EXT4_DEBUG is not set
Save and exit
Go to folder where boot.img extracted
Code:
cd /home/your username/android/boot.img-tools/boot/
Open init.rc with Gedit.
We a going to add mount point so system can mount EXT4 partition. By default, system only mount partition with RFS file system.Add red line to init.rc
Code:
# Mounting of /cache
mount ext4 /dev/block/stl14 /cache wait nosuid nodev noatime nodiratime noauto_da_alloc
mount rfs /dev/stl14 /cache nosuid nodev check=no

# Mounting of system/userdata is moved to 'on emmc' and 'on nand' sections
# We chown/chmod /data again so because mount is run as root + defaults
mount ext4 /dev/block/stl13 /data wait nosuid nodev noatime nodiratime noauto_da_alloc
mount rfs /dev/stl13 /data nosuid nodev check=no

# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount ext4 /dev/block/stl12 /system ro wait noatime nodiratime noauto_da_alloc
mount rfs /dev/stl12 /system ro check=no
The Following 10 Users Say Thank You to zcop For This Useful Post: [ Click to Expand ]
 
Aspire
Old
#6  
Aspire's Avatar
Senior Member
Thanks Meter 343
Posts: 1,047
Join Date: Dec 2011
Location: Vancouver

 
DONATE TO ME
nice guide...
the tutorial was incomplete when i posted, so i thought you're teaching ubuntu installation. :P
Nexus 4 @ KRT16O

Samsung Galaxy Fit @ MusicMod

Search XDA Forums | You're invited to try Dropbox
The Following User Says Thank You to Aspire For This Useful Post: [ Click to Expand ]
 
asad007
Old
#7  
asad007's Avatar
Senior Member
Thanks Meter 388
Posts: 473
Join Date: Oct 2011
Location: delhi
Very usefull indeed
btw can you tell me how to overclock the kernel??

don't forget to press the thanks button
-----------my works-------------
CM7.2 For Galaxy Fit

GFIT OC KERNEL


JoyOs [Galaxy Fit]

__________________________________________________ __


___________________________
The Following User Says Thank You to asad007 For This Useful Post: [ Click to Expand ]
 
zcop
Old
(Last edited by zcop; 11th June 2012 at 05:33 AM.)
#8  
Senior Member - OP
Thanks Meter 454
Posts: 250
Join Date: Nov 2011
Location: Hanoi

 
DONATE TO ME
Add OC and Undervolt Feature to kernel
GO to /home/Your username/android/GT-S5830_kernel/kernel/arch/arm/mach-msm/
Open acpuclock.c with Gedit
Find
Code:
static void acpuclk_set_div
and fix it like this

Code:
static void acpuclk_set_div(const struct clkctl_acpu_speed *hunt_s) 
{
      uint32_t reg_clkctl, reg_clksel, clk_div, src_sel, a11_div;
      reg_clksel = readl(A11S_CLK_SEL_ADDR);
      /* AHB_CLK_DIV */
      clk_div = (reg_clksel >> 1) & 0x03;
     /* CLK_SEL_SRC1NO */
     src_sel = reg_clksel & 1;
     a11_div=hunt_s->a11clk_src_div;
     if(hunt_s->a11clk_khz>600000) {
     a11_div=0;
     writel(hunt_s->a11clk_khz/19200, MSM_CLK_CTL_BASE+0x33C);
     udelay(50);
}
/*
* If the new clock divider is higher than the previous, then
* program the divider before switching the clock
*/
........etc.......
Now find this line
Code:
/* 7x27 normal with GSM capable modem - PLL0 and PLL1 swapped */
Add
Code:
{ 1, 652800, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 768000, ACPU_PLL_2, 2, 2, 160000, 2, 7, 160000 },
{ 1, 800000, ACPU_PLL_2, 2, 0, 200000, 3, 7, 122880 },
after { 1, 600000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 122880 }, and before { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, {0, 0, 0} }

The Blue column is set voltage for cpu. MSM7227 has voltage range from 1.2 to 1.35V as value 1 to 7.

Here is some Frequency if you 'd like to add more
Code:
{ 1, 652800, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
{ 1, 691200, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
{ 1, 710400, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
{ 1, 729600, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
{ 1, 748800, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
{ 1, 768000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 }, 
{ 1, 787200, ACPU_PLL_2, 2, 2, 160000, 2, 7, 160000 }, 
{ 1, 800000, ACPU_PLL_0, 4, 0, 206400, 3, 7, 122880 },
{ 1, 806400, ACPU_PLL_2, 2, 2, 160000, 2, 7, 160000 }, 
{ 1, 825600, ACPU_PLL_0, 4, 0, 206400, 3, 7, 122880 },
{ 1, 844800, ACPU_PLL_0, 4, 0, 211200, 3, 7, 122880 },
{ 1, 864000, ACPU_PLL_0, 4, 0, 216000, 3, 7, 122880 },
AND another Freq provide by pratyush.creed
Code:
	{ 1, 600000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 122880 },
 	{ 1, 614400, ACPU_PLL_2, 2, 0, 153600, 3, 6, 122880 },
 	{ 1, 672000, ACPU_PLL_2, 2, 0, 168000, 3, 6, 122880 },
 	{ 1, 729600, ACPU_PLL_2, 2, 0, 182400, 3, 7, 122880 },
	{ 1, 800000, ACPU_PLL_2, 2, 0, 200000, 3, 7, 122880 },
Due to some isues about not set default Freq that make phone run at max Freq as default. Here
Open beni_rev01_defconfig find line
Code:
# CONFIG_MSM_CPU_FREQ_SET_MIN_MAX is not set
change to
Code:
CONFIG_MSM_CPU_FREQ_SET_MIN_MAX=y
And add this below CONFIG_MSM_CPU_FRQ_MIN_MAX
Code:
CONFIG_MSM_CPU_FREQ_MAX=600000
CONFIG_MSM_CPU_FREQ_MIN=245000
Orig Thread for help me solve this out
http://forum.xda-developers.com/show....php?t=1348951

----------------------------------------------------------------------------------------------------------------------------------------
Add IO Scheduler and CPU Governor Feature to kernel
Download source :http://www.mediafire.com/?o576hx1ei74ah27
Extract zip file to /home/your username/android/GT-S5830_kernel/

Add options to config file
Go to /home/your username/android/GT-S5830_kernel/kernel/arch/arm/configs/
Open beni_rev01_defconfig find line
Code:
IO Schedulers
Add 2 line below under IO Scheduler
Code:
CONFIG_IOSCHED_VR=y
CONFIG_IOSCHED_SIO=y
Now find line
Code:
CPU Power Management
Code:
CONFIG_CPU_FREQ_GOV_BRAZILIANWAX=y
CONFIG_CPU_FREQ_GOV_HOTPLUG=y
CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
CONFIG_CPU_FREQ_GOV_SCARY=y
CONFIG_CPU_FREQ_GOV_LIONHEART=y
CONFIG_CPU_FREQ_GOV_LAZY=y
CONFIG_CPU_FREQ_GOV_SMOOTHASS=y
CONFIG_CPU_FREQ_GOV_SAVAGEDZEN=y
CONFIG_CPU_FREQ_GOV_INTERACTIVEX=y
CONFIG_CPU_FREQ_GOV_LAGFREE=y
CONFIG_CPU_FREQ_GOV_MINMAX=y
CONFIG_CPU_FREQ_GOV_SMARTASS2=y
add them under CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
Save and exit
Recompile your kernel again.
Thank to wilfredcool007 by rush me and give me info :P
The Following 8 Users Say Thank You to zcop For This Useful Post: [ Click to Expand ]
 
pratyush.creed
Old
#9  
pratyush.creed's Avatar
Senior Member
Thanks Meter 3987
Posts: 974
Join Date: Jul 2011
Location: Gaya,Bihar
Maybe u can add about ext4/3/2 support too !!
The Following 3 Users Say Thank You to pratyush.creed For This Useful Post: [ Click to Expand ]
 
sakindia123
Old
#10  
sakindia123's Avatar
Recognized Developer
Thanks Meter 9119
Posts: 3,946
Join Date: May 2011
Location: Noida
Quote:
Originally Posted by pratyush.creed View Post
Maybe u can add about ext4/3/2 support too !!
u just have to edit a few lines in config.
Asus Nexus 7(2012): AOSP Kitkat(Android 4.4) @1.5 Ghz
Samsung Galaxy S2 i9100 : CyanogenMod 10.2 (Android 4.3)
HTC Explorer A310e : CyanogenMod 10.2(Android 4.3) @878 Mhz PLL2 Overclock
Sony Xperia E Dual : Stock rom (android 4.1.1)
Karbonn Smart A25 : Stock rom (android 4.0.4)
Samsung Galaxy SL GT-i9003 (retired)

The Following 2 Users Say Thank You to sakindia123 For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes