Skip to content

paraka/rpi-mske

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

************************************
Raspberry PI Most Stupid Kernel Ever 
************************************

A simple kernel from scratch is something that I've always wanted to do.
This not pretend to be something big but big enough to undertand how a lot of stuff really works.
Because I have a Raspberry Pi model B this is the target platform.

= WHAT IS AN WHAT IS NOT INCLUDED =

There are different stuff currently supported in the kernel. These are:

* Driver for uart
* General GPIO driver code.
* Boot led driver over gpio.
* Interrupt support. It allows to define own interrupt handlers.
* Global raspberri pi timer.
* Arm-side timer with interrupts.
* Minimal processes support. All of them running in the same address space.
* Minimal semaphores implementation.
* Caches and virtual memory is not supported yet.

= HOW TO COMPILE =

You need to install arm crosscompiler arm-none-eabi-gcc package to be able to compile the sources.

$ mkdir build
$ cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=/absolute_path_to/rpi-mske/toolchain/toolchain-arm-none-eabi-rpi.cmake ..
$ make

Binary kernel.img file should be created.

= HOW TO DEPLOY IN THE TARGET =

There are two methods to be able to deploy built kernel in the target.

== Manually ==

Generated kernel.img is the image you have to use as your kernel image.

Create a sdcard with a fat partition and add the files included in sd_boot directory.
Add kernel.img to the partition too.

== Create_sdcard script ==

There is a script in tools directory that allows you to generate a bootable sdcard. Invoke it without params shows script's help.

$ sudo ./create_sdcard.sh 

Usage: ./create_sdcard.sh -k <kernel_img_file> -d <sdcard_device>

So, if your device is /dev/sdb the following command will generate the bootable sdcard.

$ ./create_sdcard.sh -k ../build/kernel.img -d /dev/sdb

Boot your pi connected with ftdi cable to gpio and use minicom or other terminal program to view boot process.

Enjoy!

About

Raspberry Pi Most Stupid Kernel Ever

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published