CS3210 Design Operating Systems

Taesoo Kim





Introduction to Raspberry Pi 3

Taesoo Kim

Administrivia

Q&A

Common answers:

It is important to support 64-bit by an operating system because a 64-bit processor can handle more data at once.

Q&A

Q&A

Q&A

Q&A

Raspberry Pi 3

Specification of Raspberry Pi 3

Specification of Raspberry Pi 3

About BCM2837

This is the Broadcom chip used in the Raspberry Pi 3, and in later models of the Raspberry Pi 2. The underlying architecture of the BCM2837 is identical to the BCM2836. The only significant difference is the replacement of the ARMv7 quad core cluster with a quad-core ARM Cortex A53 (ARMv8) cluster.

Ref. BCM2837

Specification of Raspberry Pi 3

Specification of Raspberry Pi 3

General-purpose input/output (GPIO)

Example: using a GPIO pin as output

How to configure and drive GPIO pins?

Ref. BCM2837 Data sheet

Note. pull-up/pull-down resistor

Peripherals

About VideoCore IV

Ref. VideoCore

VideoCore IV has a role beyond GPU

Firmware

$ ls ext/rpi3-uart
bootcode.bin
fixup.dat
start.elf
config.txt
kernel8.img

$ cat config.txt
arm_control=0x200        ; AArch64
kernel_address=0x4000000 ; Address for loading kernel8.img

Configuring peripherals via MMIO

Example: GPIO

Example: UART (Lab 2)

Accessing peripheral region in C

#define GPIO_BASE (0x3F000000 + 0x200000)

volatile unsigned *GPIO_FSEL1 = (volatile unsigned *)(GPIO_BASE + 0x04);

int kmain(void) {
  // reading
  unsigned int sel1 = *GPIO_FSEL1;
  
  // writing
  *GPIO_FSEL1 = sel1;
}

Accessing peripheral regions in Rust

const GPIO_BASE: usize = 0x3F000000 + 0x200000;

const GPIO_FSEL1: *mut u32 = (GPIO_BASE + 0x04) as *mut u32;

unsafe fn kmain() -> ! {
    // reading
    let mut sel1 =  GPIO_FSEL1.read_volatile();

    // writing
    GPIO_FSEL1.write_volatile(sel1);
}

Next lecture

References