how vritual addresses are mapped to physical addresses.
C++ Code Snippet illustration:
1-
2- int a = 20;
3- int *b = &a;
4-
5- std::cout « b « std::endl;
6-
7- *b = 21;
I understand that line 5 prints the virtual address of "a", but on line 7, does the program consult the kernel at all, in order to resolve the physical address that 20 will be stored in?
Most probably, the program is unaware that it doesn't have a real address space and kernel maps that automatically upon request. But I haven't touched this subject in a long time, you should read kernel docs or even a book, but with book you have to keep in mind that a large part of their info becomes outdated fast.
Обсуждают сегодня