yashsingh1/xdaforums huggingface dataset:
[Galaxy S Plus I9001 Android Development] Daniel.96:
AW: [GUIDE] Building a Kernel - Step by step

I'm also trying to 'universal' mine and make it available for all, but this is really hard, because you have to be very careful setting the right paramerter like vaseadress, pagesize.... especially for bootimg tools.

Sorry for OT, enaugh offtopic from me.
[Galaxy S Plus I9001 Android Development] Xistance:
I put up a build script before on this thread. You could have used that to build it but I guess it's best to learn yourself :). Making a Universal Kernel builder isn't easy as Diablo said. Even dsixda's kitchen requires you to have a base kernel so it can get the required base address and page size. You could ask the user for them but I'm not sure if many people that would even use the script would know them.
[Galaxy S Plus I9001 Android Development] MicroDroidXDA:
Lol I'm limited to 8 thanks per day so I can't press the thanks button :p But you're right, asking the user wouldn't make sense... maybe I could ask them to give me the path to an existing boot.img for their device. But how do I get the base address and page size from there :eek: ?

Edit: Found out how to get page size, thanks to kitchen :)

BTW I got a question: How do I build a ramdisk (if this is even possible :eek: ) if I don't want to use an existing one by another dev? I mean, how did you for example make your CM10.1 ramdisk?
[Galaxy S Plus I9001 Android Development] Xistance:
cd [to your working dir]

# Get offset 0xE and 0xF, then read in reverse order
base_temp=`od -A n -h -j 14 -N 2 boot.img | sed 's/ //g'`

# The actual 4-byte Kernel Load Address has an offset at the lower bytes,
# but we want to get the base, ie. no offset.
zeros=0000
base=0x$base_temp$zeros

cd ..

echo $base

You can get it using this.

Edit: If you want to build a ramdisk yourself, you have to build a ROM from source. It is in the 'config' folder of the device repo.

Oh and you can check for scripts you need from here: https://github.com/dsixda/Android-Kitchen/tree/master/scripts

Make sure to give credit and ask for permission if you are going to use them though.
[Galaxy S Plus I9001 Android Development] MicroDroidXDA:
I just found the code you wrote in dsixda's kitchen scripts :D But thanks anyway :p

Oh, it comes from the ROM... that makes sense xD. Can it be that it also depends on the ramdisk if a kernel is overclockable? Because I built CastagnaIT Kernel from source and used it with your CM10.1 ramdisk, now all the features are gone :p
[Galaxy S Plus I9001 Android Development] Daniel.96:
If you build from CastagnaIT's git, all features from him will be gone, because he removed them from his git. his git only have the stock arco-fork with some minor modifications made by him. but no OC/governors etc..

PS: is this actually legal ? - I mean the AndroidOS is licensed under apache licens so you don't have to publish your modifications, and the Android kernel is licensed under GPL - so actually you have to publish your modifications or am I wrong ?
[Galaxy S Plus I9001 Android Development] MicroDroidXDA:
Oh... lol the PM I just sent you has become pointless now :D But I didn't think of that... I thought it would be strange to change freqs in the ramdisk anyway :eek: Awesome, now I gotta learn how to OC a kernel :p

Hm I don't really know much about the apache license stuff...
[Galaxy S Plus I9001 Android Development] Xistance:
That's because I took it from there. I could make another script if you want but why should I bother if it's already made. Of course if I make anything like that myself I will make my own script so I don't disrespect dsixda's work.

The ramdisk has no impact on whether it is overclockable. Of course there are some commands in init.qcom.rc which are related to OC but I didn't change them. Castagna just removed these modifications as Diablo said.
[Galaxy S Plus I9001 Android Development] MicroDroidXDA:
No, I definitely don't want you to write another script, I want to write it myself :p

Lol, I've become a senior member, now I can press thanks again xD

And of course, I'm gonna ask dsixda before using anything taken from his scripts in something that I release :angel:.

But I think I'm gonna focus on how to add CPU freqs, governors, schedulers and so on to a kernel so that I can make my own CM10.1 OC kernel before continuing making my tool, some basic knowledge is always good.

Anyway, it would be great if I could find a git repo where those changes are already made... do you know one?
[Galaxy S Plus I9001 Android Development] Xistance:
As a base I would say to look at this commit. Great way to see what changes are needed.

DooMLoRD's commit on adding lagfree gov

Good luck with your kernel.

Or you can use the post under me.
[Galaxy S Plus I9001 Android Development] Daniel.96:
And if you want to see what you have to do specific for our phone, here i my commit-history:

https://github.com/Diablo96/samsung-kernel-msm7x30/commits/ics-2.6.35

I've tryed to use understandable commits ;)

Also commited:

*OC feature

*Add governors

*Add scheduler

*VOIP fix from (Credits to him) Ivendor
[Galaxy S Plus I9001 Android Development] MicroDroidXDA:
Thank you so much guys, I think I'm gonna have to mention you both like a hundred times in the credits :D Anyway, I just compiled the first test build of my kernel (without OC or anything, just based on CastagnaIT's repo and with a changed boot splash screen), I used my own script to compile and Diablo's toolbox for the flashable .zip, but it won't boot :mad: It's definitely not because of changing the splash screen, cause I've done that before when I compiled only with Diablo's ToolBox... Whatever, I'll be able to fix it :)

BTW Xistance, I read that you've fixed everything except camera and GPS in CM10.1 - awesome :victory: May we hope for another build to come next week?
[Galaxy S Plus I9001 Android Development] educk:
I also tried to change the boot splash screen and after that my phone didn't booted... how did you edit the ARIESVE.rle file?

Thanks
[Galaxy S Plus I9001 Android Development] mrjraider:
You need an converter. Search google/XDA for one.
[Galaxy S Plus I9001 Android Development] educk:
I know, I already did it but it wont boot after repacking the boot.img, and I don't know why... maybe the resolution?? I used 480x800 it should work...
[Galaxy S Plus I9001 Android Development] broodplank1337:
you need to make it with photoshop, only 16 colors, then save it as raw, then convert it to rle, and you MUST be in linux, cygwin conversion won't work

http://xdaforums.com/showthread.php?t=1494076
[Galaxy S Plus I9001 Android Development] MicroDroidXDA:
Guys, I used these boot.img-tools to change the splash screen and it worked fine ;) I know it's for Samsung Galaxy Ace, but it works for SGS+ as well if you enter the right resolution for converting (480x800 instead of 320x480) and of course the right filenames. So instead of

$ convert -size 320x480 -depth 8 rgb:COOPER.raw COOPER.png

use

$ convert -size 480x800 -depth 8 rgb:ARIESVE.raw ARIESVE.png
[Galaxy S Plus I9001 Android Development] MicroDroidXDA:
OK, I've written the scripts for both base address and page size now and they're working fine. But how do I tell mkbootimg to use these values instead of the default ones? Maybe like this

$mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel ~/MicroDroidXDAs_Kernel_Tools/Kernel/$kernel_repo/arch/arm/boot/zImage --ramdisk $ramdisk_path --base ~/MicroDroidXDAs_Kernel_Tools/scripts/getbaseaddress.sh --pagesize ~/MicroDroidXDAs_Kernel_Tools/scripts/getpagesize.sh -o boot.img

or something? I assume that's not working, I'll probably have to change mkbootimg, but asking's free, right? :D
[Galaxy S Plus I9001 Android Development] Xistance:
That won't work. The best thing I can suggest for you is to just dig the dsixda's kitchen github. Like, for what you are trying to do look at this script :

https://github.com/dsixda/Android-Kitchen/blob/master/scripts/build_boot_img

This part here:

#
# Determine kernel base address before running mkbootimg
#

if [ "$base" == "" ]
then
echo "Attempting to determine kernel base address ..."
base=`scripts/get_kernel_base_addr`
fi

echo "Using base address of $base"

Determines the variable $base as what your script determined it to be. And then later in the script :

./$mkbootimg_file --kernel zImage --ramdisk ramdisk.gz -o newBoot.img --base $base $ramdisk_params

It calls that variable when it is going to build it.

This is all up to you though. Try to learn how to program a bit before starting to do something like this. I can help you out if you want to learn so ask any questions you have but remember that I will not help you out with this Universal Builder if you are going to do it seriously.

Good luck.
[Galaxy S Plus I9001 Android Development] MicroDroidXDA:
Thanks, you really helped me a lot :good: Slowly but certainly I'm starting to turn from a total-noob to a half-noob :D

Edit: Wait... I just had a look at dsixda's script. What do I need the page size for if it's not used in the mkbootimg command?
[Galaxy S Plus I9001 Android Development] :
i got these errors while compiling the kernel..

drivers/gpu/msm/kgsl.c: In function 'memdesc_sg_virt':

drivers/gpu/msm/kgsl.c:1345:3: error: implicit declaration of function 'kmap_atomic' [-Werror=implicit-function-declaration]

drivers/gpu/msm/kgsl.c:1354:3: error: implicit declaration of function 'kunmap_atomic' [-Werror=implicit-function-declaration]

cc1: some warnings being treated as errors

make[3]: *** [drivers/gpu/msm/kgsl.o] Errore 1

make[2]: *** [drivers/gpu/msm] Errore 2

make[1]: *** [drivers/gpu] Errore 2

make: *** [drivers] Errore 2
[Galaxy S Plus I9001 Android Development] biagio7xD:
how to create a flashable zip ?
[Galaxy S Plus I9001 Android Development] broodplank1337:
steal one from an other kernel cwm zip :good:

and replace boot.img
[Galaxy S Plus I9001 Android Development] biagio7xD:
R: [GUIDE] Building a Kernel - Step by step

Thanks ;)))))

Inviato dal mio GT-I9001 con Tapatalk 2
[Galaxy S Plus I9001 Android Development] ruthlessrat:
Odp: [GUIDE] Building a Kernel - Step by step

Chinese alphabet is easier to learn :what:
[Galaxy S Plus I9001 Android Development] :
Noooo...it isn t..
[Galaxy S Plus I9001 Android Development] vetefan:
:confused:

Chinese does not have alphabet
[Galaxy S Plus I9001 Android Development] Emblema:
Hi all,

I´m done all step to first post,

I´m download source kernel from samsung, un tar and go. i

make nameconfigkernel (It´s ok)

make menuconfig (it´s ok)

but make...

my PATHS is

export ARCH=arm

export CROSS_COMPILE=~/android-ndk-r8d/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-

Anyone help me ?
[Galaxy S Plus I9001 Android Development] Xistance:
Well, obviously your toolchain path is wrong. "make" thinks your toolchain is at "/opt/toolchains/arm-eabi-4.4.3/" but you say it is at "~/android-ndk-r8d/toolchains/arm-linux-androideabi-4.4.3/"
[Galaxy S Plus I9001 Android Development] hurtsky:
i got this error after entering make -j1

root@ubuntu:/home/skynet/android/kernelics3.0/arcokernel# make -j1

CHK include/linux/version.h

CHK include/generated/utsrelease.h

make[1]: `include/generated/mach-types.h' is up to date.

CC kernel/bounds.s

cc1: error: unrecognized command line option '-mno-unaligned-access'

make[1]: *** [kernel/bounds.s] Error 1

make: *** [prepare0] Error 2

root@ubuntu:/home/skynet/android/kernelics3.0/arcokernel#

anyone can help ?
[Galaxy S Plus I9001 Android Development] edisile:
I got some errors while installing the packages. Since i have 64bit Ubuntu i changed all the "i386" with "amd64". I did something bad?

Grammar™ is freeware; this means you can use it without paying anything. Though, Grammar™ is not open-source; this means you can't edit source code.
[Galaxy S Plus I9001 Android Development] krislibaeer:
yes do not change them you need the i386 packages
[Galaxy S Plus I9001 Android Development] edisile:
Ok... i just can't get libncurses5-dev:i386 and lib32ncurses5-dev to be installed together. When i try to install lib32ncurses5-dev after installing libncurses5-dev:i386, the second one is removed and replaced with libncurses5-dev (5.9-4). This is the only problem now...
[Galaxy S Plus I9001 Android Development] krislibaeer:
libncurses5-dev is the right one

Just try to compile and if it succeed it is good

I think you do not need all that packages

for compiling rom is important to have that
[Galaxy S Plus I9001 Android Development] Xistance:
ncurses is actually reaaallly important for kernels :S. Anyway, the i386 one is correct.
[Galaxy S Plus I9001 Android Development] edisile:
OK... I'll try to install them separately. So lib32ncurses5 is not needed? When i installed it, it deleted libncurses5-dev:i386 before... Really strange.

Grammar™ is freeware; this means you can use it without paying anything. Though, Grammar™ is not open-source; this means you can't edit source code.
[Galaxy S Plus I9001 Android Development] Stefano187:
Hi,

I have a little question and I'm sorry if it could be a little bit off topic... Is it possible to add features to a kernel (like overclock, governor and I/O scheduled) without having the source code but starting from a boot.img file?

Thanks in advance

Regards

Stefano
[Galaxy S Plus I9001 Android Development] educk:
Overclock - no (you have to mode the source code for that)

Governors - yes, you can include them as modules (not sure if it will work though)

I/O Schedulers - no.
[Galaxy S Plus I9001 Android Development] Stefano187:
Thank you Erik, I was trying to figure out how improve my tablet's kernel, but without source code it's quite impossible... So sorry if I was off topic... Have a nice day

Regards

Stefano
[Galaxy S Plus I9001 Android Development] EminSG:
I need a help. I've succesfully compile 3.4.x zImage. Extracted ramdisk from cyan release 2. But wifi not working. Tried to put compiled modules in ramdisk and system, still not working. Where should I put them?
[Galaxy S Plus I9001 Android Development] Laurentyu1995:
maybe ramdisk that are you using isn't good.. try to extract it from ivendor kernel (4.1.2)
[Galaxy S Plus I9001 Android Development] EminSG:
I already do that. Extracted from ivendor r2.
[Galaxy S Plus I9001 Android Development] krislibaeer:
did you insert the modules into ramdisk-folder/lib/modules ???
[Galaxy S Plus I9001 Android Development] EminSG:
Yup. There are 3 files. Cifs, dhd and one more that begins on "s"
[Galaxy S Plus I9001 Android Development] edisile:
N00b question incoming! Can i take the voltages and the frequencies of a 3.0.x kernel and use them in 3.4.x? (e.g.:I'd take the acpuclocks.c file from educk's jb3.0_phenom branch and i'd copy-paste the parts that are related to the frequencies and voltages)

P.S: Can someone write the complete list of files that i must change in <kernel source folder>/arch/arm/mach-msm and <kernel source folder>/drivers/cpufreq ? Thanks in advance :D Sorry for the n00by questions, is the first time i try to add OC and UV at a kernel.
[Galaxy S Plus I9001 Android Development] broodplank1337:
Next to acpuclock.c you have to copy acpuclock-7x30.c and board-ariesve.c from his sources

and then you need to edit the Kconfig files in order to make it show up in the menu (if wanted)

Check this tut out as well: http://xda-university.com/as-a-developer/adding-features-to-your-kernel
[Galaxy S Plus I9001 Android Development] edisile:
That link to xda-university became my bible since some days ago... :D However thank you. Now, back to the terminal!
[Galaxy S Plus I9001 Android Development] broodplank1337:
hehe ok nice :P I made that tut, currently making an other one ^^ Good luck in further development
[Galaxy S Plus I9001 Android Development] EminSG:
I had the same. I tried to add oc and uv, no luck
[Galaxy S Plus I9001 Android Development] davidteri91:
Guys use Arco's branch or Castagnait
[Galaxy S Plus I9001 Android Development] edisile:
I know i should have tried someone's else branch before posting but i didn't had time to do this... I'm gonna try to see if i can find educk's 3.4 branch because i've used his 3.0-phenom one.

Grammar™ is freeware; this means you can use it without paying anything. Though, Grammar™ is not open-source; this means you can't edit source code.
[Galaxy S Plus I9001 Android Development] Laurentyu1995:
also i recommend you to use diablo kernel toolbox for compiling... for sure you'll not be able to use "all in one function" because it's outdated.. good luck !!
[Galaxy S Plus I9001 Android Development] edisile:
Already tried it. But i still want to do it the usual way.
[Galaxy S Plus I9001 Android Development] Xistance:
This should fix it :

sudo apt-get install lib32ncurses5-dev
[Galaxy S Plus I9001 Android Development] lutzbat:
What must i do here? :)
[Galaxy S Plus I9001 Android Development] n01ce:
For the Linux noobs like me, here's some roundabouts to the issues raised by following this tutorial.

Sadly, nothing's trivial in Linux, even the ability to rename a folder...

You can't write to the /home dir.

Run:

apt-get install gksu
gksu nautilus

Then you will be able to copy SDK files to /home dir.... but not rename it.

Rename the sdk folder:

sudo su
mv /home/sdk /home/android-sdk

Then exit the root mode.

Beware, there's a file for root user (if you've done sudo su), and one for the regular user.

Your profile is at ~/.profile. Easier when said.

gedit ~/.profile

Can't get that to work but whatever.

Understand this as "install the required packages... if you have Unbuntu 12.04, or it will fail" (dependencies issues).

No luck, I've installed Unbuntu 13. It should have been said it before!

Sort of managed it to work after running the following commands. Don't ask why.

apt-get update
apt-get upgrade

Choose before the folder where you want to create your android project.

Moreover, the tutorial supposes you're going inside kernel before git cloning.

cd kernel

CyanogenMod kernels are here: https://github.com/CyanogenMod/

Choose the right branch (the name after -b in the command).

Check the kernel name in your phone CyanogenMod wiki page : http://wiki.cyanogenmod.org/w/Galaxysmtd_Info

I will edit this post when done with all this.

Compiling CM11 for Galaxy S1 i9000

CyanogenMod 11 kernel for Galaxy S (galaxysmtd) is buggy.

Run this config:

make cyanogenmod_galaxysmtd_defconfig

Then open .config file (Ctrl+H in kernel root dir to see it).

Remove "/source" to end up with this line:

CONFIG_INITRAMFS_SOURCE="usr/galaxysmtd_initramfs.list"

Then edit usr/galaxysmtd_initramfs.list

Ending lines must be (without /source):

file /lvm/etc/lvm.conf usr/galaxysmtd_initramfs_files/lvm.conf 755 0 0
file /lvm/sbin/lvm usr/galaxysmtd_initramfs_files/lvm 755 0 0

Nothing more about busybox or exfat (these are not even in the source files...).

make -jX

where X is your max. number of CPU cores

You'll then get an error about samsung driver header file... that indeed exist.

I stopped here because I was just interrested in making in "make modules" (note: don't "make module something").

EDIT: better use CyanogenMod build instructions. Some environment steps (like use of Oracle Java, not Open JDK) may be missing but it's waaaaaaaay easier and CyanogenMod-compliant. Check Cyanogen Doc: integrated kernel building.
[Galaxy S Plus I9001 Android Development] p4rot:
I always get this error and yes im in my kernel directory:

~/android/kernel/flo-kernel$ make flo_defconfig

make: *** No rule to make target `flo_defconfig'. Stop.
[Galaxy S Plus I9001 Android Development] DarkFrenzy:
[MENTION=2987317]Droidzone[/MENTION]

whenever i try to compile the samsung stock 4.4.2 kernel i m getting this error

CC arch/arm/mach-msm/board-8930-display.o
arch/arm/mach-msm/board-8930-display.c: In function 'mipi_dsi2lvds_cdp_panel_power':
arch/arm/mach-msm/board-8930-display.c:577:3: error: implicit declaration of function 'msm_xo_get' [-Werror=implicit-function-declaration]
arch/arm/mach-msm/board-8930-display.c:577:26: error: 'MSM_XO_TCXO_A1' undeclared (first use in this function)
arch/arm/mach-msm/board-8930-display.c:577:26: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/mach-msm/board-8930-display.c:663:3: error: implicit declaration of function 'msm_xo_mode_vote' [-Werror=implicit-function-declaration]
arch/arm/mach-msm/board-8930-display.c:663:31: error: 'MSM_XO_MODE_ON' undeclared (first use in this function)
arch/arm/mach-msm/board-8930-display.c:671:31: error: 'MSM_XO_MODE_OFF' undeclared (first use in this function)
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-msm/board-8930-display.o] Error 1
make: *** [arch/arm/mach-msm] Error 2 }

this is the lines the terminal pointed to in board-8930-display.c

rfa_clock = msm_xo_get (MSM_XO_TCXO_A1, id); /create a handle for Aq buffer of XO/

msm_xo_mode_vote(rfa_clock, MSM_XO_MODE_ON); /Vote to turn ON the clock buffer/

3.msm_xo_mode_vote(rfa_clock, MSM_XO_MODE_OFF); /Vote to turn OFF the clock buffer/

what is wrong with this ?

i have attached the board-8930-display.c
[Galaxy S Plus I9001 Android Development] RenderBroken:
Do you have a defconfig that matches "flo_defconfig"?

Seems like there is not a file with that name in "arch/arm/configs"
[Galaxy S Plus I9001 Android Development] RenderBroken:
It looks to me like you are building the kernel standalone right? Most of the time with source like stock source, you have to make changes to header file locations because they are looking in a directory that does not exist since the kernel source is most likely compiling inline with the rom.

But I am not sure this is the case here, just thought I would chime in my quick 2 cents. :)
[Galaxy S Plus I9001 Android Development] falconscrest123:
I started building a kernel using this tutorial but whenever i use the make command i get an error like this

CHK include/linux/version.h

CHK include/generated/utsrelease.h

make[1]: `include/generated/mach-types.h' is up to date.

CALL scripts/checksyscalls.sh

CHK include/generated/compile.h

GEN usr/initramfs_data.cpio.lzma

File ../../utilities/busybox could not be opened for reading

line 53

File ../../utilities/erase_image could not be opened for reading

line 55

File ../../ramdisk.cpio could not be opened for reading

line 56

File ../../ramdisk-recovery.cpio could not be opened for reading

line 57

make[1]: *** [usr/initramfs_data.cpio.lzma] Error 255

make: *** [usr] Error 2

Any help would be nice
[Galaxy S Plus I9001 Android Development] ocoot:
Good morning everyone. i need your help right now. i'm success to compile kernel, but i face a audio bug. when i'm played the mp3, its only play but no sound out from speaker or headphone. maybe you can help me about this? this is the log file https://www.dropbox.com/home?preview=2016-02-26-09-39-02.txt
[Galaxy S Plus I9001 Android Development] :
Building my first kernel

I have zlmage and scsi_wait_scan.ko

And now that? And the ramdisk? :confused:

Thanks in advance.
[Galaxy S Plus I9001 Android Development] broodplank1337:
Building a kernel isn't a really heavy job, you can easily use -j25, but when compiling ICS (rom) that would be so awful that you cannot even move your mouse
[Galaxy S Plus I9001 Android Development] Xistance:
Yeah I know. It really won't make that much of a difference so why give the CPU more jobs than it can handle? It is going to build in just a few minutes anyway.
[Galaxy S Plus I9001 Android Development] meehow:
Sometimes it can make some sense. Having -j(number_of_cpu_cores + 1) can give some speed boost, since CPU can be used for compiling the code while other instances are waiting for IO. Increasing -j parameter more than this gives no real speedup, rather just eats much more RAM.
[Galaxy S Plus I9001 Android Development] omegaRED7:
Same here, just use:

make kconfig

It's just a different front-end choice, same functions, same options...

Sent from my GT-I9001
[Galaxy S Plus I9001 Android Development] jjaacckk94:
jack@Home-Ubuntu:~/Kernel/samsung-kernel-msm7x30$ make kconfig
make[1]: *** Nessuna regola per generare l'obiettivo "kconfig". Arresto.
make: *** [kconfig] Errore 2
jack@Home-Ubuntu:~/Kernel/samsung-kernel-msm7x30$

-.-" whats wrong again?