The boot partition must contain the following files, get them from one of the official images:(bootable/fat32 partition)
Optional files:
The kernel keeps track of the flow of time by means of timer interrupts. Every time a timer interrupt occurs, the value of an internal kernel counter, jiffies, is incremented.
The macro HZ defines the number of jiffies in one second
File: /arch/arm/include/asm/param.h
# define HZ CONFIG_HZ /* Internal kernel timer frequency */
File: .config
// default in Raspian
CONFIG_HZ=100
GPIO 控制
PWR 通过GPIO 35 (BCM mode)控制
ACT通过 GPIO 47 (BCM mode)控制
但是这两个GPIO并没有PIN header,貌似也不能通过写/sys/class/gpio/export的方式导出到用户空间。
要写这两个GPIO需要通过访问GPIO控制寄存器来实现:
1) GPIO控制寄存器的地址:
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000) /* GPIO */
$KERNEL/arch/arm/mach-bcm2709/include/mach/platform.h
2) 要访问这个地址可以通过/dev/mem 来实现(mmap, 需要root权限)