0

i read like paging is used for page to pageframe conversion and thats how virtual address achived. But during illeagal access in the memory we getting segmentation fault instead of page fault?

  1. is both pagefualt and segmentation fault is same? or both are different scheme to achive the virtual address?
  2. if a.out is needed 64KB then how section of the a.out stored (i.e stack, heap, bss, text) stored in memory?

after searching in google i found good article.

http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Memory/virtual.html

kst
  • 5
  • 3

1 Answers1

0

Page fault occurs when a reference is made to a page which is not currently in memory, and the hardware has to be interrupted to fetch the page from external storage, not all pages can be in memory at the same time. Page fault is transparent to the programmer as the MMU, memory management unit takes care of the interrupt handling.

Segmentation fault or seg fault occurs when an application tries access part of memory that is not accessible to it, especially when using pointers.

How a.out is stored in memory depends on size of pages, and also locality of reference when the compiled application is running. It does not matter whether the pages are from the stack, heap, bss, or text sections.

hackitect
  • 141
  • 1
  • 8