It seems to be a famous book so I bought it <a target="_blank" href="https://www.amazon.co.jp/gp/product/4797328355/ref=as_li_tl?ie=UTF8&camp=247&creative=1211&creativeASIN=4797328355&linkCode=as2&tag=lespacetranqu-22&linkId=b690c3257ff896f2239f1107e > Ordinary Linux programming The royal road of gcc programming that can be learned from the mechanism of Linux <img src = "// ir-jp.amazon-adsystem.com/e/ir?t=lespacetranqu-22&l=am2&o=9&a=4797328355" "width =" 1 "height =" 1 "border =" 0 "alt =" "style =" border: none! Important; margin: 0px! Important; "/> <a target="_blank" href="https://www.amazon.co.jp/gp/product/B075ST51Y5/ref=as_li_tl?ie=UTF8&camp=247&creative=1211&creativeASIN=B075ST51Y5&linkCode=as2&tag=lespacetranqu-22&linkId=aa0915aa60a5a > Ordinary Linux programming 2nd edition: The royal road of gcc programming that can be learned from the mechanism of Linux <img src = "// ir-jp.amazon-adsystem.com/e/ir?t=lespacetranqu-22&l=am2&o=" 9 & a = B075ST51Y5 "width =" 1 "height =" 1 "border =" 0 "alt =" "style =" border: none! Important; margin: 0px! Important; "/>
Try normal Linux programming Part 1 https://qiita.com/uturned0/items/b9ae846f2aff5865c074 Try normal Linux programming Part 2 https://qiita.com/uturned0/items/56beac990cdd6f1059ed Try normal Linux programming Part 3 https://qiita.com/uturned0/items/675092da8aa89c4b1ff0 Part 4 https://qiita.com/uturned0/items/8f5765cfc0f0be8a1981 Part 5 https://qiita.com/uturned0/items/ab97deb489c994a836da
chapter 2
unix -> System V -> Solaris unix -> bsd -> FreeBSD, mac os x
linux was built from scratch. But the spec is similar to system v / bsd
Is it that linux is not unix because it is made from scratch to the last?
Currently, POSIX is a standard that makes each other similar.
Linux OS and Linux Kernel are different. linux = linux kernel
The kernel is just one program. vmlinuz
is one of the programs.
ls /boot/vmlinuz-3.10.0-xxx.el7.x86_64
The only thing Linus the Great is looking at is the kernel.
Only the kernel can interact directly with the hardware. The device driver is in ** kernel only **.
Those that use the kernel function are called system calls. open / read / write etc
chapter 2.2 Library functions and system calls are different, but the boundaries are ambiguous.
The library function printf (3) uses the write () system call. The library function strlen (3) does not use system calls and is complete by itself
write of the man 1 write
command
man 2 write
system call write
It was written that it was scary immediately
Attention Successful write () returns ** does not guarantee that the data was recorded on disk **. In fact, some buggy implementations don't even guarantee that space is reserved for the data.
Implementation is man essential
libc
The standard C library, commonly known as libc, is very important
$ ll /lib/libc.so.6
lrwxrwxrwx. 1 root root 12 2019-10-01 18:58:09 /lib/libc.so.6 -> libc-2.17.so
In liunx, GNU libc is abbreviated as glibc than glibushi.
libc.so.2 and so on / libs are all C libraries. This is managed by someone who is not Linux libc.so.6 contains mathematical functions
chapter 2 End
Recommended Posts