/tmp

Sijichun's Blog

User library

user/ulib.h

user library 因為大部份的函式 kernel 也需要,所以在 kernel file 內也 include 不少

Read more »

讓每個 user task 做到擁有自己的 virtual address space,簡便的作法是讓每個 task 擁有自己的 page table

Read more »

Goals of this lab

  • Understand ARMv8-A virtual memory system architecture.
  • Understand how to design paging bookkeeping.
  • Understand how to design multitasking with virtual memory.
  • Understand how user programs loaded.
  • Understand how to prevent invalid memory access.
  • Understand how demand paging works.
  • Understand how copy-on-write works.

Settings

Source: Armv8-A Address Translation

Read more »

Q1. Consider the following POSIX signal example code. Can you elaborate how to design the kernel to support it?

In question 1you should explain the signal mechanism in 3 parts, signal registration
signal generation, and signal delivery

Read more »

Kernel provides system calls for user tasks. When a low priority task call a system call with long execution time. High priority task would still be blocked even it becomes runnanble from sleep. A preemptive kernel could be preempted after interrupt handling. Hence, when an interrupt handler put a higher priority task from wait queue to runqueue, it can be immediately be scheduled. It’s an important trait for real time tasks.

Read more »

UART is a typical example for wait queue. When a task call for uart_read, you should put it into the wait queue if there is no data to be read. In the uart read interrupt handler, it can put the task back to runqueue and the task could read bytes from buffer after getting scheduled.

Read more »

Armv8-A provides ldxr and stxr for exclusive access. You can either use compiler’s built-in function or hand written assembly. However, you need to enable MMU and data cache before using the ldxr instruction in real rpi3. So, you can now use a workaround such as disable preemption in real rpi3 or just give it a trial in QEMU which doesn’t have to enable MMU for ldxr.

Read more »
0%