0x04 A glance into the kernel: turnstile
Sunday, March 15, 2020
/sys/sys/proc.h Thread and Turnstile line 228 A thread may block for a short , medium, or long period of time depending on the reason that it needs to wait. A short wait occurs when a thread need to wait for access to a lock that protects a data structure. A medium wait occurs while a thread waits for an event that is expected to occur quickly such as waiting for data to be read from a disk.…more
0x03 A glance into the kernel: Proc source
Friday, February 28, 2020
/sys/sys/proc.h My machine Linux debian-laptop 5.4.0-4-amd64 #1 SMP Debian 5.4.19-1 (2020-02-13) x86_64 GNU/Linux Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 39 bits physical, 48 bits virtual CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 142 Model name: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz Stepping: 9 CPU MHz: 3100.…more
0x02 A glance into the kernel: Overview on kernel services
Wednesday, February 26, 2020
Exercises I’d write down my own answers, please point out my errors with no mercy. I have to think more on these questions. Q1 Describe a scenario in which the timer-wheel algorithm used for the callout queue does not work well. Suggest an alternative data structure that runs more quickly than does the timer-wheel algorithm for your scenario. Q2 The SIGPROF profiling timer was originally intended to replace the profil system call to collect a statistical sampling of a program’s program counter.…more
0x01 A glance into the kernel: Overview on kernel services
Monday, February 24, 2020
Exercises I’d write down my own answers, please point out my errors with no mercy. Q1 When can a routine executing in the top half of the kernel be preempted? When can it be interrupted? The top half of the kernel provides services to processes in response to system calls or traps. And the FreeBSD kernel is rarely preempted to run another user process while executing in the top half of the kernel.…more
0x00 A glance into the kernel: Overview
Thursday, February 20, 2020
Overview As a newcomer to the OS world, I just read Operating System: Three Easy Pieces, grasped some basic terminologies and general ideas. Rather than a detailed textbook, it’s more like an index of those renowned papers. Now it’s time to dive deeper into the real world code, I decide to view the recent kernel source of FreeBSD. Why this post It’s not my own version of the textbook, the post which to be a series is just some notes and shared ideas.…more