Compile the kernel- A basic howto

deadhp1
Posts: 677
Joined: Thu Sep 20, 2012 5:22 pm

Compile the kernel- A basic howto

Postby deadhp1 » Fri Dec 07, 2012 11:28 am

This is a pretty basic how to on how I set my build environment up on Ubuntu 12.04.
You may need to change some lines depending on what directories you want to work out of.
Some of this may be wrong since I am writing this from memory and mines not perfect by any means.

Install the required tools for building the kernel:

Code: Select all

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 ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib sharutils lzop


Make some directories in your home folder:

Code: Select all

cd ~
mkdir android
cd android/
mkdir kernel
cd kernel
mkdir zImage



Get the Toolchains:

Code: Select all

git clone git://github.com/DooMLoRD/android_prebuilt_toolchains.git toolchains

(Clone the toolchains used for building the kernel into a local directory)

Get the Kernel Source Code:

Code: Select all

git clone git://github.com/AndrewDB/rk3066-kernel

(Clone the Rikomagic kernel source into a local directory)

Modify the source code so it will compile:

Code: Select all

gedit ~/android/kernel/rk3066-kernel/arch/arm/plat-rk/Makefile

(remove the line "obj-$(CONFIG_RK29_VPU) += vpu_service.o". Save and Exit.)

If you want to limit the maximum speed available to the kernel:

Code: Select all

~/android/kernel/rk3066-kernel$ gedit ~/android/kernel/rk3066-kernel/arch/arm/mach-rk30/board-rk30-box.c

(remove the lines in the "dvfs_cpu_logic_table" for whatever MHZ you don't want available. Save and Exit.)


Go to your build directory:

Code: Select all

cd ~/android/kernel/rk3066-kernel/


Tell the compiler what arch and toolchain to build with:

Code: Select all

export ARCH=arm
export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-

(Export your build environment)


Choose your base configuration:

Code: Select all

make rk30_hotdog_ti_defconfig

(A basic configuration for the UG802 and MK802 III)
OR

Code: Select all

make rk30_hotdog_defconfig

(A basic configuration for the MK808)


Configure your kernel:

Code: Select all

make menuconfig

Enable /proc/config.gz in kernel:
-Navigate to "General Setup" press "enter" to go into submenu
-highlight "Kernel .config support" and press Y
-highlight "Enable access to .config through /proc/config.gz" and press Y
-esc esc to back out to main menu

Get the wireless working:
-Navigate to "Networking Support" press "enter" to go into submenu
-highlight "RF switch subsystem support" and press Y
-press "enter" to go into submenu
-highlight "Rockchips RFKILL driver" and press Y
-esc esc to back out and again to get to the main menu.

-highlight "Device Drivers" and press enter to go into submenu
-highlight "Network device support" and press enter to go into submenu
-highlight "Wireless LAN" and press enter to go into submenu
-highlight "WiFi device driver support" and press enter to go into submenu
For the UG802 and MK802 III:
-highlight "Realtek rtl8188EU" Support and press enter
For the MK808:
-go to bottom and choose "RK901/RK903/BCM4330 wireless cards support" and press enter
-highlight "Select wifi module" and press enter
-highlight "RK901" and press enter
-highlight "Select the wifi module crystal freq" and press enter
-highlight "26M" and press enter
-esc esc to back out, again, and again to get to the main menu

To choose 1080p or 720p:
-highlight "Device Drivers" and press "enter" to go into submenu
-go down and highlight "Graphics support" and press "enter" to go into submenu
-highlight "Display device support" and press "enter" to go into submenu
-highlight "LCD Panel select" and press enter to go into submenu
-highlight either "ITV framebuffer size and timing is 720p" or "ITV framebuffer size and timing is 1080p" and press enter
-esc esc and again to get back to main menu

If you want to build other drivers into the kernel make sure you use Y, if you want to build them as modules make sure to use M when selecting.



To exit and save the configuration:
-esc esc from the main menu
-highlight "Yes" when asked if you want to save the configuration


Build your kernel:

Code: Select all

make -j4

(the -j4 specifies the amount of jobs to complete at a time. You could easily just use the command "make")

Build your Modules:

Code: Select all

make modules


If you mess up building or want to start new:

Code: Select all

make clean

(Remove your old/current kernel compilation attempts)


When complete your Image and zImage are located in ~/android/kernel/rk3066-kernel/arch/arm/boot/
Copy your Image to the zImage directory

Code: Select all

cp ~/android/kernel/rk3066-kernel/arch/arm/boot/Image ~/android/kernel/zImage/Image

Copy your zImage to the zImage directory

Code: Select all

cp ~/android/kernel/rk3066-kernel/arch/arm/boot/zImage ~/android/kernel/zImage/zImage

Download split-utils.zip from this post and extract rkcrc to zImage directory
split-tools.zip

Use the following commands to generate the kernel images for flashing:

Code: Select all

cd ~/android/kernel/zImage
./rkcrc -k Image uncompressed_kernel.img
./rkcrc -k zImage compressed_kernel.img

I generally use the uncompressed_kernel.img unless it's over 7.3MB.
I've started to use the compressed_kernel.img now since I've generated larger kernels.
You do not have the required permissions to view the files attached to this post.

deadhp1
Posts: 677
Joined: Thu Sep 20, 2012 5:22 pm

Re: Compile the kernel- A basic howto

Postby deadhp1 » Fri Dec 07, 2012 11:30 am

Install the required package:

Code: Select all

sudo apt-get instal netpbm


Make a directory for your custom logo:

Code: Select all

mkdir ~/android/kernel/customlogo/



Create a logo in the size you want using gimp.
For a 1080p kernel make your image 1920x1080
For a 720p kernel make you image 1280x720
Choose save as custom.ppm in the directory ~/android/kernel/customlogo/
Choose ascii when asked

Reduce the number of colors in your logo to 224:

Code: Select all

ppmquant 224 custom.ppm > custom_224.ppm


convert it to PPM ASCII format:

Code: Select all

pnmnoraw custom_224.ppm > custom_clut224.ppm


copy the new logo to the kernel directory and rename it to logo_custom_clut224.ppm:

Code: Select all

cp custom_clut224.ppm ~/android/kernel/rk3066-kernel/drivers/video/logo/logo_custom_clut224.ppm


edit the logo makefile:

Code: Select all

gedit ~/android/kernel/rk3066-kernel/drivers/video/logo/Makefile


add the following below the other logo's somewhere around line #19:

Code: Select all

obj-$(CONFIG_LOGO_CUSTOM_CLUT224)       += logo_custom_clut224.o


Save and Exit.

Edit the logo.c file:

Code: Select all

gedit ~/android/kernel/rk3066-kernel/drivers/video/logo/logo.c


Below line 122 add the following:

Code: Select all

#ifdef CONFIG_LOGO_CUSTOM_CLUT224
    /* Custom Linux logo */
    logo = &logo_custom_clut224;
#endif


Save and Exit.

Edit the Kconfig file:

Code: Select all

gedit ~/android/kernel/rk3066-kernel/drivers/video/logo/Kconfig


Add the following somewhere in between the other logos:

Code: Select all

config LOGO_CUSTOM_CLUT224
    bool "My Custom Linux Logo"
   default y


Save and exit.

Edit the linux_logo.h file

Code: Select all

gedit ~/android/kernel/rk3066-kernel/include/linux/linux_logo.h



Add the following at the end of the logo list(about line 50):

Code: Select all

extern const struct linux_logo logo_custom_clut224;


Save and Exit.

Now just go about making your new kernel.
When you get to the step "make menuconfig":
-Navigate to "Device Drivers"
-highlight "Graphics support" and press enter
-highlight "Bootup logo" and press enter
-highlight "Standard 224-color linux logo" and press "N"
-highlight "My Custom Linux Logo" and press "Y"

Proceed with the rest of your kernel configuration.

AndrewDB
Posts: 144
Joined: Sun Oct 28, 2012 5:53 pm

Re: Compile the kernel- A basic howto

Postby AndrewDB » Fri Dec 07, 2012 12:36 pm

Hi deadhp1.
Nice howto! :) :) :)
There is (among other solutions) a different, slightly simpler method because it allows one to natively compile the kernel.
Just download and install Linux on your RK3066 Android TV player. The Pre-Alpha 0.2 release includes the kernel source as well as all the tools needed to compile the kernel, preinstalled and ready to go.

To configure for an Android kernel, one can choose one of the rk30 defconfigs. The Linux config of the running kernel is in /proc/config.gz

To customize the kernel build:
make menuconfig
(the VPU service can be deselected in the configuration, no need to edit any source file)

To build the kernel:
make -j2

(it takes 29 minutes to compile the Linux kernel on the UG802)

To build the modules:
make modules

To strip and install all the compiled modules in a convenient location (here the "output" folder directly in the root of the kernel tree):
make INSTALL_MOD_PATH=output modules_install

To cleanup before or after a kernel build:
make mrproper

(careful, this erases any .config file, make a backup of your custom .config file first)
Last edited by AndrewDB on Sat Dec 08, 2012 4:16 am, edited 3 times in total.

sin42
Posts: 2
Joined: Fri Dec 07, 2012 10:17 am

Re: Compile the kernel- A basic howto

Postby sin42 » Fri Dec 07, 2012 7:39 pm

@deadhp1 + AndrewDB
Thanks for the infos. This should keep me busy for the next weeks. :D

mazen
Posts: 14
Joined: Fri Nov 09, 2012 10:45 am

Re: Compile the kernel- A basic howto

Postby mazen » Sat Dec 08, 2012 12:07 pm

deadhp1 + AndrewDB

thxxxxxxx :D

tomitom
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: Compile the kernel- A basic howto

Postby tomitom » Sun Dec 09, 2012 6:23 am

Hi Deadhp1,

That's an amazing thread, thank you so much for putting this together !!
And of course a big thank you to andrewDB as well :)

Tom.

tomitom
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: Compile the kernel- A basic howto

Postby tomitom » Sun Dec 09, 2012 6:39 pm

Hi,

I knew it was too simple to work with my first trial :)
I'm getting an error when trying to make :

Code: Select all

  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 ‘-mlittle-endian’
cc1: error: unrecognized command line option ‘-mno-thumb-interwork’
kernel/bounds.c:1:0: error: unknown ABI (aapcs-linux) for -mabi= switch
kernel/bounds.c:1:0: error: bad value (armv5t) for -march= switch
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2


Does this make any sense to you ?

Thanks,
Tom.

muziling
Posts: 21
Joined: Wed Nov 14, 2012 12:54 am

Re: Compile the kernel- A basic howto

Postby muziling » Sun Dec 09, 2012 8:55 pm

how to generate boot.img and kernel.img from zImage which can flashed by RKAndroidTool. And where kernel ramdisk store

deadhp1
Posts: 677
Joined: Thu Sep 20, 2012 5:22 pm

Re: Compile the kernel- A basic howto

Postby deadhp1 » Sun Dec 09, 2012 10:19 pm

tomitom wrote:Hi,

I knew it was too simple to work with my first trial :)
I'm getting an error when trying to make :

Code: Select all

  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 ‘-mlittle-endian’
cc1: error: unrecognized command line option ‘-mno-thumb-interwork’
kernel/bounds.c:1:0: error: unknown ABI (aapcs-linux) for -mabi= switch
kernel/bounds.c:1:0: error: bad value (armv5t) for -march= switch
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2


Does this make any sense to you ?

Thanks,
Tom.


You must not be setting your compile environment

Code: Select all

export ARCH=arm

Code: Select all

export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-

I get that error if I don't put this into the terminal.

tomitom
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: Compile the kernel- A basic howto

Postby tomitom » Mon Dec 10, 2012 3:35 pm

Hi Deadhp1,

Thanks for your help, i triple checked and the export is done when i'm trying to make.
As a side note I'm on ubuntu 12.04 LTS 64 bits as persistent usb live key.
I don't know if it's normal (I'm far from being proficient in linux ;)) but I encountered some "weird" things during env set-up :
- when apt-get "libsdl-dev" I'm getting the following message :

Code: Select all

Note : selecting « libsdl1.2-dev » instead of « libsdl-dev »

- when trying to make I'm forced to sudo or I get the following message, I have tried to chmod 777 on home and subfolder/files without impact.

Code: Select all

 CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
/bin/sh: 1: cannot create scripts/basic/modules.order: Permission denied
make[1]: *** [scripts/basic/modules.order] Error 2
make: *** [scripts_basic] Error 2

- otherwise I checked the export output :

Code: Select all

tom@ubuntu:~$ export
declare -x ARCH="arm"
declare -x COLORTERM="gnome-terminal"
declare -x COMPIZ_CONFIG_PROFILE="ubuntu"
declare -x CROSS_COMPILE="/home/tom/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-fhWmnn3LZA,guid=0dc2baeec95173e00b9d09f3000000ca"
declare -x DEFAULTS_PATH="/usr/share/gconf/ubuntu.default.path"
declare -x DESKTOP_SESSION="ubuntu"
declare -x DISPLAY=":0"
declare -x GDMSESSION="ubuntu"
declare -x GNOME_DESKTOP_SESSION_ID="this-is-deprecated"
declare -x GNOME_KEYRING_CONTROL="/tmp/keyring-dEntNa"
declare -x GPG_AGENT_INFO="/tmp/keyring-dEntNa/gpg:0:1"
declare -x HOME="/home/tom"
declare -x LANG="fr_FR.UTF-8"
declare -x LESSCLOSE="/usr/bin/lesspipe %s %s"
declare -x LESSOPEN="| /usr/bin/lesspipe %s"
declare -x LOGNAME="tom"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"
declare -x MANDATORY_PATH="/usr/share/gconf/ubuntu.mandatory.path"
declare -x OLDPWD
declare -x PATH="/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
declare -x PWD="/home/tom"
declare -x RUNNING_UNDER_GDM="yes"
declare -x SESSION_MANAGER="local/ubuntu:@/tmp/.ICE-unix/7870,unix/ubuntu:/tmp/.ICE-unix/7870"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_AGENT_PID="7906"
declare -x SSH_AUTH_SOCK="/tmp/keyring-dEntNa/ssh"
declare -x TERM="xterm"
declare -x UBUNTU_MENUPROXY="libappmenu.so"
declare -x USER="tom"
declare -x WINDOWID="50331654"
declare -x XAUTHORITY="/home/tom/.Xauthority"
declare -x XDG_CONFIG_DIRS="/etc/xdg/xdg-ubuntu:/etc/xdg"
declare -x XDG_CURRENT_DESKTOP="Unity"
declare -x XDG_DATA_DIRS="/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/"
declare -x XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
declare -x XDG_SESSION_COOKIE="55c8b6ea3cafa2d3af4c4eb40000002e-1355166626.50790-1996264800"
declare -x XDG_SESSION_PATH="/org/freedesktop/DisplayManager/Session0"


If you have any more idea :)
Tom.

Chaotnix
Posts: 4
Joined: Tue Nov 13, 2012 3:07 pm

Re: Compile the kernel- A basic howto

Postby Chaotnix » Mon Dec 10, 2012 5:42 pm

Hi Tom,

enviroment variables are not exportet to root user. So, if you use sudo to compile, you get the errors.
you can try:

Code: Select all

chown -R tom:tom ~/android

This will change user and group of all files under /home/tom/android to user tom and group tom.

If this doesn't help you could create a bash script for compilation.

Code: Select all

#!/bin/bash

export ARCH=arm
export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
cd ~/android/kernel/rk3066-kernel/
make -j2


save this script to ~/android/ and do a chmod 755 for the script. After that you can execute this script with sudo.

If you want the complete kernel generation in one script, you can use this:

Code: Select all

#!/bin/bash

export ARCH=arm
export CROSS_COMPILE=~/android/kernel/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
cd ~/android/kernel/rk3066-kernel/
make menuconfig # change to "make xconfig"  if you prefere xwindows configuration utility
echo "make clean"
make clean
echo "building kernel images"
make -j2    #change the number to the amount of cpu cores
echo "copy Images"
rm ../zImage/*
cp arch/arm/boot/*Image ../zImage/
echo "copy modules"
declare dir="../modules"
if [ ! -e $dir ]; then
mkdir $dir; fi
rm ../modules/*
find -name "*.ko" -exec cp {} ../modules \;
echo "generate images for flashing"
declare imagedir="../zImage"
if [ ! -e $imagedir ]; then
mkdir $imagedir; fi
cd ../zImage
rkcrc -k zImage zkernel.img
rkcrc -k Image  kernel.img
echo "done"



deadhp1 and AndrewDB: Thanks for all the info!


Rainer

tomitom
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: Compile the kernel- A basic howto

Postby tomitom » Mon Dec 10, 2012 6:07 pm

Chaotnix wrote:Hi Tom,

enviroment variables are not exportet to root user. So, if you use sudo to compile, you get the errors.
you can try:

Code: Select all

chown -R tom:tom ~/android

This will change user and group of all files under /home/tom/android to user tom and group tom.


Thank you !!
It's making right now thanks to the chown trick :)

It's not over yet but thanks to you guys I'm getting close to compiling my first kernel :D

tomitom
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: Compile the kernel- A basic howto

Postby tomitom » Thu Dec 13, 2012 4:37 pm

Hi,

I have been able to compile my first kernel thanks to you guys :) ... but unfortunately, it doesn't seem to work :(
Once loaded (only the kernel) with Finless tool I only got two Tux in the upper left corner at boot time and that's all ...
Does this ring any bell ?

Tom.
P.S. : Deadhp1, I have not done anything from your second post as it seems to be only related to custom logo, have I missed something there ?

tomitom
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: Compile the kernel- A basic howto

Postby tomitom » Sun Dec 16, 2012 2:29 pm

Hi,

I have tried adding a custom logo and also using the other toolchain but without success :(
At boot time it stays freezed on the kernel logo (mine in this case).

If you have any clue,
Tom.

tomitom
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: Compile the kernel- A basic howto

Postby tomitom » Tue Dec 18, 2012 11:25 am

Heeeeeeeeeeeeeeeeelp :)

I'm getting so frustrated at not managing to get a working kernel for the mk808 !
The last attempt includes : removing the custom logo and instead activating the console framebuffer (trying to have a verbose boot :)).
This ended up in having a magnificient "Android _" in the upper left corner and nothing more ... :(

So I'm guessing I'm doing something wrong here but I can't figure out what.
From what I can understand :
- the kernel is compiling otherwise I won't have an .img to load :)
- the kernel is loaded (I can see the "Android_" or my custom logo)
- but then ... ?

Just to be sure I'm not completly stupid, here's how i flash the device :
- I flash the complete firmware "jb beta 4 rooted" found on Deadhp1's GoogleDrive, it works
- I flash only "my" kernel (i.e. the one I just compiled) with the tools from Finless Rom.

I have used this method to flash other kernels without problem, so I'm guessing the problem resides in my kernel.
I might miss some important options (drivers ?) when I make menuconfig that stop the boot process before the end, no clue where/what it could be so, and no clue either how I could "simply" debug. Verbose boot message seemed a good idea, too bad it does not work.

Thanks to anyone who was able to compile a working kernel for android based on AndrewDB's git (RikoMagic sources) to tell me if I4m missing something here.
Tom.

julandroid
Posts: 30
Joined: Fri Oct 26, 2012 5:34 pm

Re: Compile the kernel- A basic howto

Postby julandroid » Tue Dec 18, 2012 8:07 pm

I haven't time to play with building custom kernel, BUT.. the "update.img" file inside firmware like rooted_JB_beta_4.zip consist of following parts:

Code: Select all

boot.img
kernel.img
misc.img
revocery.img
system.img
backup.img


If you follow the yobikap's post regarding the module building, you'll notice the usage of rkunpack tool, which extracts already mentioned *.img files outside of update.img

If you do that, you'll find a file called "parameter", which contains the following like:

Code: Select all

mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x00004000@0x00004000(kernel),0x00008000@0x00008000(boot),0x00008000@0x00010000(recovery),0x000C0000@0x00018000(backup),0x00040000@0x000D8000(cache),0x00300000@0x00118000(userdata),0x00002000@0x00418000(kpanic),0x00100000@0x0041A000(system)


Notice the way (kernel) is described (with size and offset). You may continue reading more, by following the Finless's post

At the end you will end up with writing your kernel, by using rkflashtool in a way similar to this:

Code: Select all

sudo rkflashtool w 0xSizeInBlocks 0xOffsetInBlocks < kernel.img


I hope, I get it right and I don't mislead you :)

tomitom
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: Compile the kernel- A basic howto

Postby tomitom » Wed Dec 19, 2012 4:53 am

Hi julandroid,

Thanks a lot for your feedback, it gave me a better understanding of a ROM/Firmware components and how it was built.
I did some tweaking in the parameter for kernel but it didn't solved my problem :(
I suspected it wouldn't as some of the kernels I have compiled and was trying to load/boot were smaller in size that ones provided by Deadhp1 for which I didn't encounter any problem using the exact same method to upload to the mk808.

I definitly thing that the problem is coming from the kernel itself, either :
- some piece of code that has to be changed in the sources from AndrewDB's github (rikomagic)
- some missing config for the make
- a problem with the toolchain used (I have done some test with both arm-eabi-linaro-4.6.2 suggested by Deadhp1 and the other one included in the git provided though)

Hi think I will put this project aside as I have no idea where/what to look for from now on :(
Thanks again for the reply anyway :)
Tom.

tomitom
Posts: 21
Joined: Wed Nov 28, 2012 5:47 pm

Re: Compile the kernel- A basic howto

Postby tomitom » Sat Dec 22, 2012 1:27 pm

For anyone trying to achieve this a simple advice :
DO NOT use a usb live ubuntu in persistent mode ...

I decided to install ubuntu in a virtual box, and re-start from scratch, this time I had no problem building a working kernel :)

I just wanted to thanks onece again all you guys that helped me a lot here, particularly Deadhp1 for this tutorial :)
Tom.

ss808
Posts: 6
Joined: Sun Dec 02, 2012 8:41 pm

Re: Compile the kernel- A basic howto

Postby ss808 » Mon Dec 31, 2012 3:47 pm

muziling wrote:how to generate boot.img and kernel.img from zImage which can flashed by RKAndroidTool. And where kernel ramdisk store


I have the same question -- if anyone would be kind to explain how to do the generation of the boot.img/kernel.img/recovery.img from the zImage/Image that would be much appreciated

thanks

jm_maclaren
Posts: 13
Joined: Sun Nov 25, 2012 1:09 pm

Re: Compile the kernel- A basic howto

Postby jm_maclaren » Mon Dec 31, 2012 5:11 pm

see posts here
http://www.armtvtech.com/armtvtechforum/viewtopic.php?f=66&t=1132
note this is to build a Linux image that can be flashed into recovery and then the mk808 can be booted from recovery into linux


Return to “Development”

Who is online

Users browsing this forum: No registered users and 1 guest