August 21
Today, I’m reading cpu.land blog about how computers run the program. I’m re-reading it actually. That is going good so far. In the previous read, I couldn’t grasp a few things. It could be because I don’t know much and I’ve read it on phone so I couldn’t explore much.
This time I’ve already explored few things with the question like how ls
works. Thanks to GPT, it helped a lot in my quest.
Essentially, when we type ls
in terminal and press enter
,
- shell parses the command
- finds the binary
- uses syscall to interact with kernel to create a child process
- child process replaces itself with the loaded binary program
- then
ls
runs and uses syscalls to get the necessary data and other ops - it prints to the terminal
- it exits
- control comes back to the shell
- we got the shell prompt again
- voila!
In my quest I used tools like otool
, lldb
(I guess) to mess up with things. I’ve also found a nice reverse engineering guide from a github.io website that I’ve linked in my LIIL
page.
So many things, software interrupts, hardware interrupts, userland, kernel, registers, mmu, virtual memory, paging, security rings, there is a lot of interesting things.
Now back to reading THE BOOK!
I’ve read about C++ based sorting techniques that are appropriate for pairs
, tuples
, & structs
. And the way to use custom callback functions.
I’ve also learned about auto
iteration and structs
, pairs
& tuples
. I’ve skimmed through the binary search part. I’ll go through with full attention tomorrow. Once I did it, I’ll review my progress and fill in the knowlege gaps before moving on to the next chapter.
Stored the learnings at: https://github.com/Maheshkumar-novice/TIL/blob/main/cpp/sorting.cpp