-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
59 lines (38 loc) · 1.92 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
************************************
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!