$ cd ../..
$ mkdir modules
$ cd RpiLinux/
$ make modules_install ARCH=arm CROSS_COMPILE=../RpiTools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi- INSTALL_MOD_PATH=../modules
6.备份 firmware
挂载rpi的sd卡后可以发现有了sdx,它的两个分区为sdx1,sdx2,对应分别对应RPi的“/boot”和“/”
将/boot下的*.elf *.bin备份收好了
编译/boot/config.txt,在首行加入kernel=kernel_new.img这样系统就会引导到我们要拷入的kernel_new.img
7.升级内核、lib和firmware
将RpiTools/mkimage/kernel.img重命名为kernel_new.img,复制到sd卡/boot下
将RPiFirameware/boot下的bootcode.bin fixup.dat fixup_cd.dat start.elf复制到sd卡/boot下
将PRiFirmware/hardfp/opt下的vc复制到sd卡/opt下
将rpi下modules下的lib复制到sd卡/下
8.重启树莓派
9.编写测试程序调用新的系统调用:
#include <stdio.h>
#define sys_hello() {__asm__ __volatile__ ("swi 0x900000+223\n\t");} while(0)
int main(void) {
sys_hello();
printf("Type \"dmesg | tail\" to see the result.\n");
return 0;
}