Coder Social home page Coder Social logo

kernelhacking's Introduction

KernelHacking

Repo for Linux kernel hacking on Beaglebone Black...

1. Get cross compiler (I use gcc with support for hard floating points from Linaro, works on Centos 8 & Fedora 40.7)

$ wget https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz

2. Clone Beagleboard kernel

$ git clone https://github.com/beagleboard/linux.git

3. Checkout kernel version on your Beagle e.g. 4.19

$ git checkout 4.19

4. Get defconfig file from linux-headers and copy into .config in Beagleboard kernel

Get defconfig from target & transfer to build machine with e.g. scp

$ zcat /proc/config.gz > beagle_config

$ cp beagle_config .config

5. Build kernel image (use -j with 2x cpu cores to speed up build)

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x80008000 uImage -j<2xcores>

6. Build device tree (use -j with 2x cpu cores to speed up build)

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage dtb.am335x-boneblack -j<2xcores>

7. Build kernel modules (use -j with 2x cpu cores to speed up build)

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH= modules_install -j<2xcores>

8. Root file system

Download already built RFS here: https://www.dropbox.com/s/k93doprl261hwn2/rootfs.tar.xz?dl=0

$ tar -xf rootfs.tar.xz

$ sudo cp -r rootfs <path-to-sd_card>

$ cd <path-to-sd_card>/rootfs

$ sudo mv ./* ../

$ cd ..

$ sudo rmdir rootfs

9. Prepare sd_card (card capacity should atleast be greater than 2gb!)

First step is to delete umount all partitions on the card & then delete all partitions. Remember to take backups of the content on the card if necessary.

Second step is to create atleast two partitions for boot files and for the root file system. Boot partition is called BOOT & root file system can be called RFS.

I personally use gparted to configure my sd card. Partition setup with 60mb for BOOT and 14gb for RFS:

image

kernelhacking's People

Contributors

kimconcepcion avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.