-
Notifications
You must be signed in to change notification settings - Fork 0
/
linux-under-the-hood.txt
executable file
·59 lines (55 loc) · 2.47 KB
/
linux-under-the-hood.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
1.1
- user interacts with shell/gui -> create Processes
processes using libraries via system-calls and signals interact with kernal. kernal using pluggable drivers can access hardware directly.
networking happen in kernel level.
--
1.2
- cpu access Disk, RAM and Network.
- to perform task effectively, the kernal manage the hardware via modules.
- memory management -> to manage ram.
- Scheduling -> to slice the time of cpu on different proc
- drivers -> to access disk, networking and other hardware device.
- application can communicate with kernal through system-calls.
--
1.3
- lsmod -> command to print all loaded driver
- modinfo driver-name -> to get more info about a driver
- linux store driver of device at /dev/** ,
when listing ls -l
- first character in permissions [b|c]rwxr-xr-x:
kernel distinguish in 2 types of devices
- b -> block devices is used to store block of data.
- c -> used to stream data, like a serial port, which is a char device.
- two number major, minor: internal representation in the kernel for this file in /dev/
- /dev/** interfaces for user, kernel deals with the major and minor number
--
1.4
- glibc gnu version of libc, c standard library, all linux distribuation use it.
a generic interface that allow application to access kernel using system-calls.
--
1.5
- shell; used by user and application. application can feed it with variables[can be stored
in config file]. linux store config in /usr/lib/systemd/system which contain where to get
the required env vars. which can be used to give application the needed information.
--
1.6
- Linux is a file oriented os
- everything is happening as a file: device access, I/O handling, inter process communication..
- Every process keep a table of file descriptors that shwos files that are currently in use.
- Common fd are:
- 0 -> STDIN
- 1 -> STDOUT
- 2 -> STDERR
- to list all pid-> ls /proc. to list fd used by specific proc -> ls /proc/pid/fd
---
SysAdmin
-
--
vagrant is a virtual machine that use virtual box to execute and run vm.
--
we can interupt the booting process start in grub mode press e
and we now can edit how the kernel start [rbgb (start all svc by default)
confirm(useful in troubleshooting problem), single(can start other runlevel->
init 3[usermode and networking support])]
ps auxw | egrep '\[' <- KERNEL PROCESSES.
kernel modules are located in /lib/modules