Try normal Linux programming Part 2

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

Try normal Linux programming Part 7
Try normal Linux programming Part 2
Try normal Linux programming Part 3
Try normal Linux programming Part 4
Try normal Linux programming Part 6
Trying normal Linux programming Part 1
Read Normal Linux Programming (Part 1 Only)
[For memo] Linux Part 2
Linux standard textbook part 5
New Linux commands! !! Part 2
Linux standard textbook part 4
Try NeosVR on Linux
Try programming with a shell!
Linux standard textbook memo 1 part 2
Reinforcement learning 5 Try programming CartPole?
Try translating English PDF Part 1
Try using SQLAlchemy + MySQL (Part 1)
Try using SQLAlchemy + MySQL (Part 2)
Making sound by programming Part 2
Linux standard textbook memo part 6
[Linux convenient command] Try inserting exa
Try using Pillow on iPython (Part 1)
[For memo] Linux Part 1 vi editor
Try installing OpenAM on Amazon Linux
Try using Pillow on iPython (Part 2)
Try deep learning with TensorFlow Part 2
WSL2 ~ Linux on Windows ~ (Part 1: Introduction)
Try the Linux kernel lockdown mechanism
[Linux convenient command] Try inserting csview
Try using Pillow on iPython (Part 3)
[Linux convenient command] Try inserting bat
Story of trying competitive programming Part 1
Try compiling Linux commands (cross-compilation practice)