Skip to content

Commit

Permalink
qemu exercises added
Browse files Browse the repository at this point in the history
  • Loading branch information
s-matyukevich authored and levif committed Jun 8, 2018
1 parent 3b7146b commit 8b48bc6
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ For more information about project goals and history, please read the [Introduct
* 4.2 [Scheduler basic structures](docs/lesson04/linux/basic_structures.md)
* 4.3 [Forking a task](docs/lesson04/linux/fork.md)
* 4.4 [Scheduler](docs/lesson04/linux/scheduler.md)
* 4.5 [Exercises]()
* 4.5 [Exercises](docs/lesson04/exercises.md)
* **Lesson 5: User processes and system calls**
* 5.1 [RPi OS](docs/lesson05/rpi-os.md)
* 5.2 [Linux](docs/lesson05/linux.md)
* 5.3 [Exercises](docs/lesson05/exercises.md)
* **Lesson 6: Virtual memory management**
* 6.1 [RPi OS](docs/lesson06/rpi-os.md)
* 6.2 Linux (In progress)
* 6.3 Exercises (In progress)
* 6.3 [Exercises](docs/lesson06/exercises.md)
* **Lesson 7: Signals and interrupt waiting** (To be done)
* **Lesson 8: File systems** (To be done)
* **Lesson 9: Executable files (ELF)** (To be done)
Expand Down
1 change: 1 addition & 0 deletions docs/lesson01/exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Exercises are optional, though I strongly recommend you to experiment with the s
1. Introduce a constant `baud_rate`, calculate necessary Mini UART register values using this constant. Make sure that the program can work using baud rates other than 115200.
1. Change the OS code to use UART device instead of Mini UART. Use `BCM2835 ARM Peripherals` manual to figure out how to access UART registers and how to configure GPIO pins.
1. Try to use all 4 processor cores. The OS should print `Hello, from processor <processor index>` for all of the cores. Don't forget to set up a separate stack for each core and make sure that Mini UART is initialized only once. You can use a combination of global variables and `delay` function for synchronization.
1. Adapt lesson 01 to run on qemu. Check [this](https://github.com/s-matyukevich/raspberry-pi-os/issues/8) issue for reference.

2 changes: 1 addition & 1 deletion docs/lesson02/exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

1. Instead of jumping directly from EL3 to EL1, try to first get to EL2 and only them switch to EL1.
1. One issue that I ran into when working on this lesson was that if FP/SIMD registers are used then everything works well at EL3, but as soon as you get to EL1 print function stops working. This was the reason why I've added [-mgeneral-regs-only](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson02/Makefile#L3) parameter to the compiler options. Now I want you to remove this parameter and reproduce this behavior. Next, you can use `objdump` tool to see how exactly gcc make use of FP/SIMD registers in the absence of `-mgeneral-regs-only` flag. Finally, I want you to use 'cpacr_el1' to allow ussing FP/SIMD registers.

1. Adapt lesson 02 to run on qemu. Check [this](https://github.com/s-matyukevich/raspberry-pi-os/issues/8) issue for reference.
1 change: 1 addition & 0 deletions docs/lesson03/exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

1. Use local timer instead of the system timer to generate processor interrupts.
1. Handle MiniUART interrupts. Replace the final loop in the `kernel_main` function with a loop that does nothing. Setup MiniUART device to generate an interrupt as soon as the user types a new character. Implement an interrupt handler that will be responsible for printing each newly arrived character on the screen.
1. Adapt lesson 03 to run on qemu. Check [this](https://github.com/s-matyukevich/raspberry-pi-os/issues/8) issue for reference.
2 changes: 1 addition & 1 deletion docs/lesson04/exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
1. Introduce a way to assign priority to the tasks. Make sure that a task with higher priority gets more processor time that the one with lower priority.
1. Allow user processes to use FP/SIMD registers. Those registers should be saved in the task context and swapped during the context switch.
1. Allow the kernel to have an unlimited number of tasks (right now the limit is 64).

1. Adopt lesson 04 to run on qemu. Check [this](https://github.com/s-matyukevich/raspberry-pi-os/issues/8) issue for reference.

1 change: 1 addition & 0 deletions docs/lesson05/exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

1. When a task is executed in a user mode, try to access some of the system registers. Make sure that a synchronous exception is generated in this case. Handle this exception, use `esr_el1` register to distinguish it from a system call.
1. Implement a new system call that can be used to set current task priority. Demonstrate how priority changes are dynamically applied while the task is running.
1. Adapt lesson 05 to run on qemu. Check [this](https://github.com/s-matyukevich/raspberry-pi-os/issues/8) issue for reference.
3 changes: 3 additions & 0 deletions docs/lesson06/exercises.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 6.3 Exercises

1. Adapt lesson 06 to run on qemu. You have to implement [identity mapping](https://wiki.osdev.org/Identity_Paging) in order to do this. Check [this](https://github.com/s-matyukevich/raspberry-pi-os/issues/8) issue for reference.

0 comments on commit 8b48bc6

Please sign in to comment.