/tmp

Sijichun's Blog

1. 更改架構

為了方便 required 4 的要求先更改整體架構。

1-1. system call

仿效 glibc 使用巨集產生 privilege function 的 wrapper 提供給 user。以 printf 為例,在 user 可透過 uart_write system call 間接呼叫 _uart_write

Read more »

lab4 在概念上不會太難,難的是組語和 c 語言間的交替使用。例如,手動分配好 kernel stack,用 asm 寫入 sp, fp

1
2
3
4
5
6
7
asm volatile("msr tpidr_el1, %[task]\n\t"
"mov x9, %[func]\n\t"
"mov x10, %[sp]\n\t"
"mov sp, x10\n\t"
"mov fp, #0\n\t" // arbitarary value
"blr x9"
:: [sp] "r" (p), [func] "r" (func), [task] "r" (task): "memory");
Read more »

Question 1: Change svc instruction to brk (breakpoint) instruction. See the difference in ELR_EL2(return address). Explain why there is a difference.

Read more »

Rpi3 開機流程

Rpi3’s booting procedure could be roughly divided into 4 steps.

  1. GPU executes the first stage bootloader from ROM on the SoC.
  2. The first stage bootloader recognizes the FAT16/32 file system and loads the second stage bootloader bootcode.bin from SD card to L2 cache.
  3. bootcode.bin initializes SDRAM and loads start.elf
  4. start.elf initializes GPU’s firmware and reads config.txt, cmdline.txt and kernel8.img to start OS.
Read more »

Mini UART基於system clock,PL011有著自己的clock,兩著皆可藉由mailbox去設定clock,之後在基於clock去設定baud rate register。

Read more »

CPU透過呼叫VideoCoreIV(GPU) routine來設定peripheral像是clock rate及framebuffer,Mailbox充當CPU和VideoCoreIV之間的橋。

目標:用Mailbox

  1. 取得board revision及VC Core base address
  2. 設定UART clock,並取代PL011 UART為mini UART
  3. 設定framebuffer,啟動時顯示splash image
Read more »
0%