Assignments 3
Team 1: blocked processes in blocking_device
Read and experiment phase 3 work in http://linux-kernel-lab.blogspot.com/2018/06/blocking-device.html
Make the pid of all processes blocked in blocking_device visible in /sys/show_blocked.
Test it. You may run "read_test &" as many times as you wish.
Team 2: on release
Read and experiment phase 3 work in http://linux-kernel-lab.blogspot.com/2018/06/blocking-device.html
When a user types in the keyboard, he constantly presses and releases key. The normal behavior is to get the character as soon as the key is pressed. If it takes sometime to release, then the key is repeated many times until it is released.
Let us change its behavior. Suppress the key repetition when the user doesn't release it. Get the character when the key is released and not pressed.
Team 3: no key repetition
Read and experiment phase 3 work in http://linux-kernel-lab.blogspot.com/2018/06/blocking-device.html
When a user types in the keyboard, he constantly presses and releases key. The normal behavior is to get the character as soon as the key is pressed. If it takes sometime to release, then the key is repeated many times until it is released.
Let us change its behavior. Suppress the key repetition when the user doesn't release it.
Team 4: systemtap: I/O monitoring
You are not using Shibata's work.systemtap is a script language developed by RedHat that runs in kernel mode. It collects and displays kernel data (or even user data) as the user wishes. See https://sourceware.org/systemtap/SystemTap_Beginners_Guide/
The script https://sourceware.org/systemtap/SystemTap_Beginners_Guide/traceio2sect.html shows how to monitor I/O activity on a specific device.
For this assignment, use the centos distribution because it deals much better with SystemTap.
Run this script to monitor different devices in your computer, specially, your mouse. Monitor your mouse in a X windows environment. Who uses it?
Create a C program that opens the mouse device and continually reads it and displays the character received. At the same time, monitor the mouse use by the systemtap script.
Team 5: pressed key
Read and experiment phase 3 work in http://linux-kernel-lab.blogspot.com/2018/06/blocking-device.html
Create /sys/pressed_key which shows 1 if there is some key being pressed and zero if there is no pressed key. Tip: see when the keyboard interrupts (atkbd_interrupt).
Team 6: clock and timer
Read and experiment phase 3 work in http://linux-kernel-lab.blogspot.com/2018/06/blocking-device.html
The manual of the versatile board is on:
It uses the timer:
This timer configuration (addresses and ports) are handled by ~/Downloads/pcs3746-sistemas-operacionais/1/linux/drivers/clocksource/timer-sp804.c
Questions:
1. How to be sure that timer-sp804.c is running on your linux? Insert a breakpoints on functions of this file to understand how they are called and why. Explain it.
2. Change some parameters of the time to see how they affect the linux. For instance, make the timer interruptions never happens, or make it happens in a very low frequency.
team 7: interruption source
Read and experiment phase 3 work in http://linux-kernel-lab.blogspot.com/2018/06/blocking-device.html
When an interruption happens, it is necessary to determine who caused it. Determine where does it happen in the Linux kernel. Insert breakpoints and take screenshots.
Display the last hardware interrupt in /sys/last_interrupt
Declare a variable in the kernel, such as last_interrupt.
In order to take the last interrupt, perhaps, you will have to make some change in a assembly code. In this case, use a STR. It is very likely that the clock interrupt will happen a lot, so you may suppress it from last_interrupt.
team 8: processes waiting keyboard
Read and experiment phase 3 work in http://linux-kernel-lab.blogspot.com/2018/06/blocking-device.html
Study: http://www.linusakesson.net/programming/tty/ and specially what is line discipline.
Create /sys/waiting_key which shows the pid of the processes that are waiting for some key to be pressed.
Team 9: A bare linux drive
Read and experiment phase 3 work in http://linux-kernel-lab.blogspot.com/2018/06/blocking-device.html
Create the bare drive /dev/bare_device by http://www.pcs.usp.br/~jkinoshi/2008/Exp8_revisada_13_08_07.doc in Shibata's work.
Experiment it for reading and writing as:
echo "asdf" > /dev/bare_device
cat /dev/bare_device
Shibata's team had to enable devtmpfs to work with /dev as /dev isn't present in rootfs.
Answer: how does linux kernel, using devtmpfs, populate /dev ?
It is possible, however, to have /dev/bare_device working without the devtmpfs kernel option enabled. Study it, disable the devtmpfs kernel option and make another /dev/bare_device work.
Team 10: systemtap: time in kernel and user space
You are not using Shibata's work.
systemtap is a script language developed by RedHat that runs in kernel mode. It collects and displays kernel data (or even user data) as the user wishes. See https://sourceware.org/systemtap/SystemTap_Beginners_Guide/
The scripthttps://sourceware.org/systemtap/SystemTap_Beginners_Guide/threadtimessect.html
shows how to determine the amount of time any given thread is spending in either kernel or user-space.
For this assignment, use the centos distribution because it deals much better with SystemTap.
Create a C program that uses a lot of CPU and another which uses a few (for instance: insert sleep in your code). Monitor both programs in your virtual machine. Give 2 cores to your virtual machine running centos. How does it handle both programs?
Call Detail Record Analysis
ResponderExcluirCall Detail Record Analysis
Call Detail Record Analysis
Call Detail Record Analysis
Call Detail Record Analysis
Call Detail Record Analysis