Announcement

Collapse
No announcement yet.

Beginners' guide of "How to build a kernel"

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Beginners' guide of "How to build a kernel"

    Over the last few weeks I've finally decided to stop sitting on the side lines and get involved in building kernels. My hope is to actively help to improve the support available


    If you want to create your own personal kernel, or just want to "have a go" I've listed out the steps you need to take. I'm assuming that the majority of people are Windows 7/8 users the same as me and that you are interested in the current KK beta sources.
    • Download and install your preferred Virtual Machine software. My preference was Oracle VM Virtual Box. Configure a new VM with minimum 10 Gb space for kernel only (25Gb for OS work), 2 Gb RAM (more better) and select Linux [preferred distro] 64-bit.
    • Now download a bootable ISO of your favourite 64-bit Linux distro - I chose Ubuntu 13.10 amd64 - and boot your VM. Install Linux and restart.
    • Download all the tools you need using the following command:
      • sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.8-dev build-essential zip curl libncurses5-dev zlib1g-dev gcc-multilib g++-multilib sharutils lzop gcc-arm-linux-gnueabihf
    • downloaded my repo and, optionally, OS sources to a suitable directory in your home. I use ~/android/
    • Extracted the OS tarball to ~/Android/RK3188 and extracted the kernel to ~Android/RK3188/kernel
    • change working directory to ~Android/RK3188/kernel
    • Make sure everything is cleaned out using "make clean"
    • Execute "make nconfig" to bring up the configuration options. Change any other settings that you want and save
    • Build all the modules and objects using "make -j2"
    • Finally execute "make -j2 kernel.img"
    WooHoo you've built your first kernel!!!
    Last edited by d33; 03-17-2014, 23:50.
    Measy U4B (=Tronsmart T428) used by my kids!
    Onda v975m - M802 - Bought from Banggood.com
    Pipo M8HD 3G - RK3188 - don't buy from pipo-store
    Tronsmart S89 Vega -S802 (sponsored by Geekbuying)
    CX921b -RK3188T (sponsored by AndroidTV)
    Cube U30GT2 - RK3188 (part sponsored by Geekbuying)
    RKM MK902 - RK3188 (sponsored by RKM)



    Donate to Finless

    #2
    Thank you !
    Will you also teach us how to build a kernel running on a pipo tablet from tv stick manufacturer's sources ?

    Comment


      #3
      Originally posted by raxy View Post
      Thank you !
      Will you also teach us how to build a kernel running on a pipo tablet from tv stick manufacturer's sources ?
      I currently don't have a Pipo tablet. It has been away for repair since Xmas and no progress reported.
      Measy U4B (=Tronsmart T428) used by my kids!
      Onda v975m - M802 - Bought from Banggood.com
      Pipo M8HD 3G - RK3188 - don't buy from pipo-store
      Tronsmart S89 Vega -S802 (sponsored by Geekbuying)
      CX921b -RK3188T (sponsored by AndroidTV)
      Cube U30GT2 - RK3188 (part sponsored by Geekbuying)
      RKM MK902 - RK3188 (sponsored by RKM)



      Donate to Finless

      Comment


        #4
        1. Does anyone perhaps know how to enable wifi(RK903) on MK808B with custom kernel?
        The kernel source I use is https://github.com/mazen912/rk30_r-box_kernel and I use the
        rk30_hotdog_defconfig config file and change wifi in menuconfig to RK903.
        I can successfully compile and use the kernel, it's only the wifi that's not working.

        Here is the GPIO pins of my device
        https://docs.google.com/spreadsheet/...=sharing#gid=0
        https://github.com/aloksinha2001/pic...-alok/issues/5
        Here is also a wifi patch - http://www.freaktab.com/showthread.p...tch-for-MK808B, maybe someone can modify it for above kernel source?

        If someone can modify the GPIO pins in the kernel source code, I think it's in file https://github.com/mazen912/rk30_r-b...30-sdk-sdmmc.c and upload the changed file I would be very greatful.

        Also don't know if these commits might help and be applied to above kernel source?
        https://github.com/Galland/rk3x_kern...6ef0a57f9b8387
        https://github.com/Galland/rk3x_kern...6dee822024c502
        https://github.com/Galland/rk3x_kern...2cdc5b800edee6

        --------------------------------------------------------------------------------------------------
        2. Also does anyone have a solution for the small display(1/3 of screen when using 1080p and edges cut off) on screen when using a different kernel in your rom. Is there something that can be changed in the drivers/video/Rockchip files in the kernel sources perhaps? In one of the files you can change HDMI Auto configure to True/False and set default resolution on boot, if only there was something to scale the screen to full resolution. https://docs.google.com/file/d/0B2Jo...9UQnROUlk/edit

        Comment


          #5
          Beginners' guide of "How to build a kernel"

          Originally posted by mo123 View Post
          Here is the GPIO pins of my device
          https://docs.google.com/spreadsheet/...=sharing#gid=0

          If someone can modify the GPIO pins in the kernel source code, I think it's in file https://github.com/mazen912/rk30_r-b...30-sdk-sdmmc.c and upload the changed file
          If you are correct with the source file then you would need to change line 133 to have the correct wake pin (PC6) as far as I can see.


          Using my ipad so apols for any stupid ios spelling 'corrections'
          Measy U4B (=Tronsmart T428) used by my kids!
          Onda v975m - M802 - Bought from Banggood.com
          Pipo M8HD 3G - RK3188 - don't buy from pipo-store
          Tronsmart S89 Vega -S802 (sponsored by Geekbuying)
          CX921b -RK3188T (sponsored by AndroidTV)
          Cube U30GT2 - RK3188 (part sponsored by Geekbuying)
          RKM MK902 - RK3188 (sponsored by RKM)



          Donate to Finless

          Comment


            #6
            Hi darrellr,

            Nice tutorial to make own kernel image. Thank you very much.

            Could you also please let us know, what are the changes required to get 1080p resolution support.

            Thanks,
            Raju.

            Comment


              #7
              Beginners' guide of "How to build a kernel"

              Sure. To get 1920*1200 swap to b101auno LCD. To get 1920*1080 wasser created his own source file


              Sent from my iPhone using Tapatalk
              Measy U4B (=Tronsmart T428) used by my kids!
              Onda v975m - M802 - Bought from Banggood.com
              Pipo M8HD 3G - RK3188 - don't buy from pipo-store
              Tronsmart S89 Vega -S802 (sponsored by Geekbuying)
              CX921b -RK3188T (sponsored by AndroidTV)
              Cube U30GT2 - RK3188 (part sponsored by Geekbuying)
              RKM MK902 - RK3188 (sponsored by RKM)



              Donate to Finless

              Comment


                #8
                Could you please point me to wasser source file or his thread to get 1920x1080 resolution.

                Comment


                  #9
                  Beginners' guide of "How to build a kernel"

                  It isn't public. You'll need to ask him


                  Sent from my iPhone using Tapatalk
                  Measy U4B (=Tronsmart T428) used by my kids!
                  Onda v975m - M802 - Bought from Banggood.com
                  Pipo M8HD 3G - RK3188 - don't buy from pipo-store
                  Tronsmart S89 Vega -S802 (sponsored by Geekbuying)
                  CX921b -RK3188T (sponsored by AndroidTV)
                  Cube U30GT2 - RK3188 (part sponsored by Geekbuying)
                  RKM MK902 - RK3188 (sponsored by RKM)



                  Donate to Finless

                  Comment


                    #10
                    Beginners' guide of "How to build a kernel"

                    Or just hack the b101auno one

                    Sent from my iPhone using Tapatalk
                    Measy U4B (=Tronsmart T428) used by my kids!
                    Onda v975m - M802 - Bought from Banggood.com
                    Pipo M8HD 3G - RK3188 - don't buy from pipo-store
                    Tronsmart S89 Vega -S802 (sponsored by Geekbuying)
                    CX921b -RK3188T (sponsored by AndroidTV)
                    Cube U30GT2 - RK3188 (part sponsored by Geekbuying)
                    RKM MK902 - RK3188 (sponsored by RKM)



                    Donate to Finless

                    Comment


                      #11
                      If I am understand correct, need to replace some pattern in kernel image.
                      If So, what to replace with "b101auno" in kernel image

                      Comment


                        #12
                        Beginners' guide of "How to build a kernel"

                        Nope use nconfig to select lcd


                        Sent from my iPhone using Tapatalk
                        Measy U4B (=Tronsmart T428) used by my kids!
                        Onda v975m - M802 - Bought from Banggood.com
                        Pipo M8HD 3G - RK3188 - don't buy from pipo-store
                        Tronsmart S89 Vega -S802 (sponsored by Geekbuying)
                        CX921b -RK3188T (sponsored by AndroidTV)
                        Cube U30GT2 - RK3188 (part sponsored by Geekbuying)
                        RKM MK902 - RK3188 (sponsored by RKM)



                        Donate to Finless

                        Comment


                          #13
                          Compilation success, flashing failure.

                          I have now tried several ways of compiling the kernel, all of which has produced a kernel.img (compressed or uncompressed). When flashing I always get the same behaviour, No boot screen, and seemingly a dead stick.

                          This is what I have tried:

                          Followed the instructions (which I think are wrong btw, or at least overly complicated) to the letter with the same config file extracted from d33's kernel that actually works.

                          I have used the arm compiler that is default on linux mint 16 (4.7.3). I have also tested latest linaro 4.7 and 4.8 (Both of which produce excellent 4.2.2 kernels) without success.

                          I tried with the extra + and without it, I cannot figure out what I am doing wrong.

                          I think some of the steps are unneccesary in the guide though. The modules are automatically built when building the kernel, no need to build them separately.

                          When I build without extra + a clean says cleaning 3.0.36+
                          When I build with extra + a clean says cleaning 3.0.36++
                          That seems wrong to me..

                          Anybody knows what is going on?
                          Anybody except d33 actually managed to build a booting kernel?

                          Comment


                            #14
                            Re: Beginners' guide of "How to build a kernel"

                            Originally posted by JugsteR View Post
                            I have now tried several ways of compiling the kernel, all of which has produced a kernel.img (compressed or uncompressed). When flashing I always get the same behaviour, No boot screen, and seemingly a dead stick.

                            This is what I have tried:

                            Followed the instructions (which I think are wrong btw, or at least overly complicated) to the letter with the same config file extracted from d33's kernel that actually works.

                            I have used the arm compiler that is default on linux mint 16 (4.7.3). I have also tested latest linaro 4.7 and 4.8 (Both of which produce excellent 4.2.2 kernels) without success.

                            I tried with the extra + and without it, I cannot figure out what I am doing wrong.

                            I think some of the steps are unneccesary in the guide though. The modules are automatically built when building the kernel, no need to build them separately.

                            When I build without extra + a clean says cleaning 3.0.36+
                            When I build with extra + a clean says cleaning 3.0.36++
                            That seems wrong to me..

                            Anybody knows what is going on?
                            Anybody except d33 actually managed to build a booting kernel?
                            You can control extraversion by 3 way:
                            -Modifing Makefile
                            -Adding extraversion in .config
                            -Making a file (.smcversion if I am not wrong) with the extraversion inside.

                            Using any of them after make clean you must got 3.0.36+, if not, your rknand module will not match and the device will not boot.

                            I am using the defaul croscompiler in ubuntu, I think is 1.7.1.

                            What Rom are you using to test the kernel? I am using wasser 0.92 with 2.08 bootloader.

                            I am working with kitkat sources too, but using qx1, and by now I got a booting kernel, no wifi, no bt, and reboots and hangs a lot

                            Once I got a stable kernel, I will upload the sources to github and I will play with x7 too, I choosed qx1 because wasser is making a great work with x7, and his kernels seem to work very well, my fast try with x7 result in a booting kernel, but no Ethernet and reboots a lot too.


                            leolas.
                            REMEMBER, YOUR FEEDBACK IS VERY IMPORTANT TO US.
                            My devices:
                            Minix Neo X7; Minix Neo X8-H , Minix Neo Z64W & Z64 (Sponsored by Minix)
                            MK902 & MK902II(Sponsored by RKM)
                            Beelink M8B & Beelink R89 (Sponsored by Beelink)
                            Tronsmart VEGA S89H (Sponsored by
                            Gearbest.com)
                            MELE-PCG03 (Sponsored by Gearbest.com) Discount Coupon:MPCG03
                            Ainol Intel Z3735 MiniPC(Sponsored by Gearbest.com)
                            Thanks to them I can try to support your devices http://freaktab.com/core/images/smilies/wink.png

                            Comment


                              #15
                              Re: Beginners' guide of "How to build a kernel"

                              Originally posted by leolas View Post
                              You can control extraversion by 3 way:
                              -Modifing Makefile
                              -Adding extraversion in .config
                              -Making a file (.smcversion if I am not wrong) with the extraversion inside.

                              Using any of them after make clean you must got 3.0.36+, if not, your rknand module will not match and the device will not boot.

                              I am using the defaul croscompiler in ubuntu, I think is 1.7.1.

                              What Rom are you using to test the kernel? I am using wasser 0.92 with 2.08 bootloader.

                              I am working with kitkat sources too, but using qx1, and by now I got a booting kernel, no wifi, no bt, and reboots and hangs a lot

                              Once I got a stable kernel, I will upload the sources to github and I will play with x7 too, I choosed qx1 because wasser is making a great work with x7, and his kernels seem to work very well, my fast try with x7 result in a booting kernel, but no Ethernet and reboots a lot too.


                              leolas.
                              Thank you for the tips, I'll check those files.

                              I use Bob's beta kitkat rom. Haven't really tried anything else for my CX919, is there any rom you can recommend over Bob's?

                              In planning on building my own in the future (still probably months away though)



                              Signature? Signature!

                              Comment

                              Working...
                              X