Dhruv Vyas
9 years ago
8 changed files with 142 additions and 2 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,20 @@ |
|||||
|
In this subsection, I've included tools for who want to build kernel themselves. |
||||
|
|
||||
|
build-kernel-qemu script helps one to automate kernel building process for any debian based distro. |
||||
|
|
||||
|
For other OSes, like windows and Mac OS X, you can have a similar tools like gcc-arm-linux-gnueabihf and more and follow |
||||
|
build-kernel-qemu line by line to build kernel yourself. |
||||
|
|
||||
|
Please note that build-kernel-qemu is not an original work of mine and credit for it goes to original author. |
||||
|
|
||||
|
I've taken building references from the links below: |
||||
|
|
||||
|
https://web.archive.org/web/20131210001638/http://xecdesign.com/compiling-a-kernel/ |
||||
|
https://web.archive.org/web/20131209235952/http://xecdesign.com/compiling-qemu/ |
||||
|
https://web.archive.org/web/20131210001407/http://xecdesign.com/working-with-qemu/ |
||||
|
https://web.archive.org/web/20131210001526/http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/ |
||||
|
|
||||
|
build-kernel-qemu references : |
||||
|
|
||||
|
https://github.com/johnlane/rpi-utils/blob/master/kernel/build-kernel-qemu |
||||
|
https://github.com/polaco1782/raspberry-qemu/blob/master/build-kernel-qemu |
@ -0,0 +1,46 @@ |
|||||
|
#!/bin/bash |
||||
|
# |
||||
|
# Build ARM kernel 4.1.7 for QEMU Raspberry Pi Emulation |
||||
|
# |
||||
|
####################################################### |
||||
|
|
||||
|
TOOLCHAIN=arm-linux-gnueabihf |
||||
|
|
||||
|
sudo apt-get update && sudo apt-get install git libncurses5-dev gcc-arm-linux-gnueabihf |
||||
|
git clone https://github.com/raspberrypi/linux.git |
||||
|
cd linux |
||||
|
#checking out 4.1.7+ branch - change it if you want to change kernel version |
||||
|
# for kernel specific hash, have a looks at : https://github.com/raspberrypi/linux/commits/rpi-4.1.y |
||||
|
git checkout 77798915750db46f10bb449e1625d6368ea42e25 |
||||
|
make ARCH=arm versatile_defconfig |
||||
|
cat >> .config << EOF |
||||
|
CONFIG_CROSS_COMPILE="$TOOLCHAIN" |
||||
|
CONFIG_CPU_V6=y |
||||
|
CONFIG_ARM_ERRATA_411920=y |
||||
|
CONFIG_ARM_ERRATA_364296=y |
||||
|
CONFIG_AEABI=y |
||||
|
CONFIG_OABI_COMPAT=y |
||||
|
CONFIG_PCI=y |
||||
|
CONFIG_SCSI=y |
||||
|
CONFIG_SCSI_SYM53C8XX_2=y |
||||
|
CONFIG_BLK_DEV_SD=y |
||||
|
CONFIG_BLK_DEV_SR=y |
||||
|
CONFIG_DEVTMPFS=y |
||||
|
CONFIG_DEVTMPFS_MOUNT=y |
||||
|
CONFIG_TMPFS=y |
||||
|
CONFIG_INPUT_EVDEV=y |
||||
|
CONFIG_EXT3_FS=y |
||||
|
CONFIG_EXT4_FS=y |
||||
|
CONFIG_VFAT_FS=y |
||||
|
CONFIG_NLS_CODEPAGE_437=y |
||||
|
CONFIG_NLS_ISO8859_1=y |
||||
|
CONFIG_FONT_8x16=y |
||||
|
CONFIG_LOGO=y |
||||
|
CONFIG_VFP=y |
||||
|
CONFIG_CGROUPS=y |
||||
|
EOF |
||||
|
|
||||
|
make -j 4 -k ARCH=arm CROSS_COMPILE=${TOOLCHAIN}- menuconfig |
||||
|
make -j 4 -k ARCH=arm CROSS_COMPILE=${TOOLCHAIN}- |
||||
|
cd .. |
||||
|
cp linux/arch/arm/boot/zImage kernel-qemu |
@ -0,0 +1,66 @@ |
|||||
|
diff -rupN linux/arch/arm/mach-versatile/Kconfig linux.b/arch/arm/mach-versatile/Kconfig
|
||||
|
--- linux/arch/arm/mach-versatile/Kconfig 2015-10-12 20:42:55.161811668 -0300
|
||||
|
+++ linux.b/arch/arm/mach-versatile/Kconfig 2015-10-12 16:12:43.125862874 -0300
|
||||
|
@@ -4,7 +4,6 @@ menu "Versatile platform type"
|
||||
|
config ARCH_VERSATILE_PB |
||||
|
bool "Support Versatile Platform Baseboard for ARM926EJ-S" |
||||
|
default y |
||||
|
- select CPU_ARM926T
|
||||
|
select MIGHT_HAVE_PCI |
||||
|
help |
||||
|
Include support for the ARM(R) Versatile Platform Baseboard |
||||
|
@@ -12,7 +11,6 @@ config ARCH_VERSATILE_PB
|
||||
|
|
||||
|
config MACH_VERSATILE_AB |
||||
|
bool "Support Versatile Application Baseboard for ARM926EJ-S" |
||||
|
- select CPU_ARM926T
|
||||
|
help |
||||
|
Include support for the ARM(R) Versatile Application Baseboard |
||||
|
for the ARM926EJ-S. |
||||
|
diff -rupN linux/arch/arm/mm/Kconfig linux.b/arch/arm/mm/Kconfig
|
||||
|
--- linux/arch/arm/mm/Kconfig 2015-10-12 20:42:55.165811668 -0300
|
||||
|
+++ linux.b/arch/arm/mm/Kconfig 2015-10-12 16:14:36.525859523 -0300
|
||||
|
@@ -71,7 +71,7 @@ config CPU_ARM9TDMI
|
||||
|
|
||||
|
# ARM920T |
||||
|
config CPU_ARM920T |
||||
|
- bool "Support ARM920T processor" if (ARCH_MULTI_V4T && ARCH_INTEGRATOR)
|
||||
|
+ bool "Support ARM920T processor" if ARCH_INTEGRATOR || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
|
||||
|
select CPU_32v4T |
||||
|
select CPU_ABRT_EV4T |
||||
|
select CPU_CACHE_V4WT |
||||
|
@@ -89,7 +89,7 @@ config CPU_ARM920T
|
||||
|
|
||||
|
# ARM922T |
||||
|
config CPU_ARM922T |
||||
|
- bool "Support ARM922T processor" if (ARCH_MULTI_V4T && ARCH_INTEGRATOR)
|
||||
|
+ bool "Support ARM922T processor" if ARCH_INTEGRATOR || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
|
||||
|
select CPU_32v4T |
||||
|
select CPU_ABRT_EV4T |
||||
|
select CPU_CACHE_V4WT |
||||
|
@@ -127,7 +127,7 @@ config CPU_ARM925T
|
||||
|
|
||||
|
# ARM926T |
||||
|
config CPU_ARM926T |
||||
|
- bool "Support ARM926T processor" if (!ARCH_MULTIPLATFORM || ARCH_MULTI_V5) && (ARCH_INTEGRATOR || MACH_REALVIEW_EB)
|
||||
|
+ bool "Support ARM926T processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
|
||||
|
select CPU_32v5 |
||||
|
select CPU_ABRT_EV5TJ |
||||
|
select CPU_CACHE_VIVT |
||||
|
@@ -135,6 +135,7 @@ config CPU_ARM926T
|
||||
|
select CPU_CP15_MMU |
||||
|
select CPU_PABRT_LEGACY |
||||
|
select CPU_TLB_V4WBI if MMU |
||||
|
+ depends on !CPU_V6 && !CPU_V7
|
||||
|
help |
||||
|
This is a variant of the ARM920. It has slightly different |
||||
|
instruction sequences for cache and TLB operations. Curiously, |
||||
|
@@ -358,7 +359,7 @@ config CPU_PJ4B
|
||||
|
|
||||
|
# ARMv6 |
||||
|
config CPU_V6 |
||||
|
- bool "Support ARM V6 processor" if (!ARCH_MULTIPLATFORM || ARCH_MULTI_V6) && (ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX)
|
||||
|
+ bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || MACH_BCM2708 || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB
|
||||
|
select CPU_32v6 |
||||
|
select CPU_ABRT_EV6 |
||||
|
select CPU_CACHE_V6 |
Loading…
Reference in new issue