I wathed the following videos.
Here is my note about system call.
From Wikipedia:
The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines the application programming interface (API), along with command line shells and utility interfaces, for software compatibility with variants of Unix and other operating systems.
There are a lot of programs (processes) on RAM. The OS process is known as kernel. For the user program to access devices, like a disk or network, the kernel expose some functions. In most modern operating systems, kernel code is in the process memory, in the stack space.
https://en.wikipedia.org/wiki/Process_state
A process could be blocked when it call I/O, because the I/O speed is slow than CPU clock.
https://www.tutorialspoint.com/assembly_programming/assembly_system_calls.htm
eax
.int 0x80
.
int
stands for an “interrput vector”.
Vector 0x80 is used to transfer control to the kernel.
This interrupt vector is initialized during system startup, along with other important vectors such as the system clock vector.
0x80
is hardcoded into both Linux and glibc, to be the system call number which transfers control to the kernel,"https://en.wikipedia.org/wiki/Page_table
https://stackoverflow.com/questions/55415778/do-pointers-refer-to-physical-or-to-virtual-memories
https://stackoverflow.com/questions/56619431/where-is-page-table-located
https://www.javatpoint.com/os-page-table-size
Logical Address = 24 bits Logical Address space = 2 ^ 24 bytes Let’s say, Page size = 4 KB = 2 ^ 12 Bytes Page offset = 12 Number of bits in a page = Logical Address - Page Offset = 24 - 12 = 12 bits Number of pages = 2 ^ 12 = 2 X 2 X 10 ^ 10 = 4 KB Let’s say, Page table entry = 1 Byte Therefore, the size of the page table = 4 KB X 1 Byte = 4 KB
https://en.wikipedia.org/wiki/Translation_lookaside_buffer
It is a part of the chip’s memory-management unit (MMU). … Referencing the physical memory addresses, a TLB may reside between the CPU and the CPU cache, between the CPU cache and primary storage memory, or between levels of a multi-level cache.
mmap
: memory map pages to the process address space (heap)munmap
: unmap pages from the process address space (heap)fork
: fork a process.fork()
Many web pages say, fork is a system call, but it is just a function, who wraps clone()
system call.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/fork.c#n2514
In this post, I wrote fork as system call.
fork()
system call.fork()
will copy the own process, and the new process is called “child process”.By Wikipedia:
- Cache: cache represents a small amount of very fast memory. A cache is a storage for a specific type of object, such as semaphores, process descriptors, file objects, etc.
- Slab: slab represents a contiguous piece of memory, usually made of several physically contiguous pages. The slab is the actual container of data associated with objects of the specific kind of the containing cache.
His explanation was wrong
Please refer to this page or check Blackmesh
’s comment on the video.
I need to review this Medium article. It was simple and nice.