Page: https://github.com/gunjunlee/osspr2021 (forked)
project 0~1 are personal project, project 2~4 are team project.
My team distributed everything fairly.
Because all my teammates were the very beginning of Linux kernel, we use pair programming method.
Project 0 (very easy)
Project 0 consists of two parts:
1) understanding how to build the kernel from its source code and boot the QEMU emulator
2) implementing a very simple system call. The syscall we have to make is to print "hello".
This project was so simple, so let's move on to next
Project 1 (easy)
In this project, we implemented a new system call ptree. ptree returns hierarchy between processes running on.
we need to use tasklist_lock to prevent the list from being changed during the traversal of the process tree.
And we should have a lock when you call a malloc.
You can read the implementation detail on https://github.com/gunjunlee/project1-hello-process-kevin970401/blob/master/README.md
Project 2 (medium)
we implemented a new synchronization primitive that provides a reader-writer lock that changes its behavior based on the device's current orientation. (details: https://github.com/gunjunlee/osspr2021/blob/main/doc/Project3.md)
You can read the implementation details on https://github.com/gunjunlee/project2-hello-synchronization-team-14/blob/master/README.md
We learned:
- How to implement custom lock with list data structures and existing locks.
- How to initialize kernel global variables with start_kernel function.
- How to handle killable-thread-locked lock variables.
- How to handle unexpected death of thread using do_exit function.
Project 3 (Extremely hard)
you will implement a weighted round-robin (WRR) scheduler in the Tizen Linux kernel which works on a symmetric multiprocessing (SMP) system
Our new WRR scheduler completely replace the CFS scheduler.
we need to do
- set priority between schedulers
- initialize the wrr scheduler
- manage weight of the tasks
- mechanism of creating new task
- manage the runqueue (we implemented 3 functions: enqueue_task_wrr, dequeue_task_wrr, yeild_task_wrr)
- preemption
- selecting CPU when enqueue a task
- load balancing
- and some syscalls (sched_getweight, sched_setweight)
We need to make many new functions, edit many part of the linux kernel.
Complete understanding of the linux scheduling mechanism (including SMP) is required to implement the new WRR scheduler without any error.
this was the most difficult project i've ever done in univ.
And I found two major errors!
- image below
- deadlock occured by rearly happen episode (incorrect lock-unlock order)
Project 4 (hard)
We developed a new kernel-level mechanism for embedding location information into the ext2 file system. We also control the accessibility of the files inside custom ext2 file system based on the location metadata.
We need to understand how ext2 manage files to develop new kernel-level accessibility mechanism.
And to implement the GPS-based accessibility mechanism we need to do decimal operation (including sin, cos) on linux kernel (which is not supported basically on linux kernel because of the performance issue)
we use sin/cos table and approximate the intervening values were obtained by interpolation.
and we implement fixed point-like decimal operation.
We use equirectangular approximation to get distance of the two point.