{"id":456,"date":"2020-08-18T19:23:47","date_gmt":"2020-08-18T20:23:47","guid":{"rendered":"http:\/\/www.linux-tutorial.info\/?page_id=77"},"modified":"2020-08-22T19:26:16","modified_gmt":"2020-08-22T20:26:16","slug":"this-is-the-page-title-toplevel-289","status":"publish","type":"page","link":"http:\/\/www.linux-tutorial.info\/?page_id=456","title":{"rendered":"Memory Mapping"},"content":{"rendered":"\n<title>Memory Mapping<\/title>\n<p>\nWhen an image is executed, the contents of the executable image must be brought into\nthe process&#8217; virtual address space.\nThe same is also true of any shared libraries that the executable image has been linked to use.\nThe executable file is not actually brought into physical memory, instead it is merely\nlinked into the process&#8217; virtual memory.\nThen, as the parts of the program are referenced by the running application, the\nimage is brought into memory from the executable image.\nThis linking of an image into a process&#8217; virtual address space is known as memory mapping.\n<p>\n<img decoding=\"async\" src=\"vm_area.gif\"><br \/>\n<p>\nFigure: Areas of Virtual Memory<\/center>\n<p>Every process&#8217; virtual memory is represented by an <tt>mm_struct<\/tt> data structure.\nThis contains information about the image that it is currently executing (for example <font face=\"helvetica\">bash<\/font>)\nand also has pointers  to a number of <tt>vm_area_struct<\/tt> data structures.\nEach <tt>vm_area_struct<\/tt> data structure describes the start and end of the area of virtual memory,\nthe process&#8217; access rights to that memory and a set of operations for that memory.\nThese operations are a set of routines that Linux must use when manipulating this area of\nvirtual memory.\nFor example, one of the virtual memory operations performs the correct actions when the\nprocess has attempted to access this virtual memory but finds (via a page fault) that the\nmemory is not actually in physical memory.\nThis operation is the <em>nopage<\/em> operation.\nThe <em>nopage<\/em> operation is used when Linux demand pages the pages of an executable\nimage into memory.\n<p>\nWhen an executable image is mapped into a process&#8217; virtual address a set of <tt>vm_area_struct<\/tt>\ndata structures is generated.\nEach <tt>vm_area_struct<\/tt> data structure represents a part of the executable image; the executable\ncode, initialized data (variables), unintialized data and so on.\nLinux supports a number of standard virtual memory operations and, as\nthe <tt>vm_area_struct<\/tt> data structures are created, the correct set of virtual memory operations\nare associated with them.\n<p>\n","protected":false},"excerpt":{"rendered":"<p>Memory Mapping When an image is executed, the contents of the executable image must be brought into the process&#8217; virtual address space. The same is also true of any shared libraries that the executable image has been linked to use. &hellip; <a href=\"http:\/\/www.linux-tutorial.info\/?page_id=456\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-456","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=456"}],"version-history":[{"count":1,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/456\/revisions"}],"predecessor-version":[{"id":624,"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=\/wp\/v2\/pages\/456\/revisions\/624"}],"wp:attachment":[{"href":"http:\/\/www.linux-tutorial.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}