From 4c3dd1d8a94d3202f8f48cf695457543fba37900 Mon Sep 17 00:00:00 2001 From: Tom Moguljak Date: Mon, 11 Sep 2023 21:49:01 +0200 Subject: [PATCH] Ajustement du readme --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/README.md b/README.md index e96bdae..e989096 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,52 @@ # TP 1 : Mémoire ## Exercice 1 +Soit le [programme](Exo1/adresses_virtuelles.c) suivant qui affiche les adresses virtuelles de certaines variables lors de l'exécution du processus. +En utilisant le (pseudo) fichier `/proc/pid/maps`, vérifiez à quel segment de pages ces adresses appartiennent. + +```console +tom@Error404:/mnt/c/Users/naser/Documents/scr/TP1$ ./adresses_virtuelles +``` + +>mon pid est 20 + +``` +main = 0x564bfc70e169 +&argc = 0x7ffd8f4ac78c +&i = 0x7ffd8f4ac794 +&j = 0x564bfc711fe0 +t = 0x564bfc711040 +m = 0x564bfd7e62a0 +``` + +```console +tom@Error404:/mnt/c/Users/naser/Documents/scr/TP1$ cat /proc/20/maps +``` + +``` +564bfc70d000-564bfc70e000 r--p 00000000 00:48 3659174697600603 /mnt/c/Users/naser/Documents/scr/TP1/adresses_virtuelles +564bfc70e000-564bfc70f000 r-xp 00001000 00:48 3659174697600603 /mnt/c/Users/naser/Documents/scr/TP1/adresses_virtuelles +564bfc70f000-564bfc710000 r--p 00002000 00:48 3659174697600603 /mnt/c/Users/naser/Documents/scr/TP1/adresses_virtuelles +564bfc710000-564bfc711000 r--p 00002000 00:48 3659174697600603 /mnt/c/Users/naser/Documents/scr/TP1/adresses_virtuelles +564bfc711000-564bfc712000 rw-p 00003000 00:48 3659174697600603 /mnt/c/Users/naser/Documents/scr/TP1/adresses_virtuelles +564bfd7e6000-564bfd807000 rw-p 00000000 00:00 0 [heap] +7f246a43d000-7f246a440000 rw-p 00000000 00:00 0 +7f246a440000-7f246a466000 r--p 00000000 08:20 10783 /usr/lib/x86_64-linux-gnu/libc.so.6 +7f246a466000-7f246a5bb000 r-xp 00026000 08:20 10783 /usr/lib/x86_64-linux-gnu/libc.so.6 +7f246a5bb000-7f246a60e000 r--p 0017b000 08:20 10783 /usr/lib/x86_64-linux-gnu/libc.so.6 +7f246a64e000-7f246a658000 r--p 00026000 08:20 10780 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 +7f246a658000-7f246a65a000 r--p 00030000 08:20 10780 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 +7f246a65a000-7f246a65c000 rw-p 00032000 08:20 10780 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 +7ffd8f48e000-7ffd8f4af000 rw-p 00000000 00:00 0 [stack] +7ffd8f568000-7ffd8f56c000 r--p 00000000 00:00 0 [vvar] +7ffd8f56c000-7ffd8f56e000 r-xp 00000000 00:00 0 [vdso] +``` + +``` +main appartient au deuxieme segment de pages (564bfc70e000-564bfc70f000) +&argc appartient au stack (7ffd8f48e000-7ffd8f4af000) +&i appartient aussi au stack (7ffd8f48e000-7ffd8f4af000) +&j appartient au heap (564bfd7e6000-564bfd807000) +t appartient au heap (564bfd7e6000-564bfd807000) +m appartient au heap (564bfd7e6000-564bfd807000) +``` \ No newline at end of file