Postagens

Mostrando postagens de julho, 2018

Assignment 4

Team 1: page fault on malloc Using phase 4 of Shibata's team , write a program that continually gets memory (malloc) and writes on a structure, creating a linked list (where each cell is in this structure), i.e., a cell (this structure) must point to the former one.  After some time, due to virtual memory, data must go to disk in order to free memory to more data through do_swap_page. How does the Linux choose the page to evict? Let the program run freely. What error do you get? Insert a breakpoint closer to the interrupt vector when this error happens. Explain. Obs: observe the effect of differente sizes of the physical memory in qemu. Explain how virtual memory was allocated by /proc/$PID/maps (the process may be blocked by a getchar). Team 2: allocating a physical page frame Using phase 4 of Shibata's team , implement the program "large" that uses 2 times the physical memory (adjust memory size in qemu). This program declares a large vector. For each eleme...

virtual memory - do_swap

The Versatile board running Linux uses virtual memory. When a process is using more and more memory, it must swap old memory to disk in order to free space to the new memory. The same mechanism for virtual memory is also used in memory mapped files. Let us suppose that a large file is mapped into memory. As the memory is being filled, data from memory must be saved in the file. At first, it should be very easy to accomplish this memory swap, so I asked for some students to run a code like that, but they didn't get it.  Then, I asked again in the following year, but they failed too. Next year, I decided to ask for Shibata's team to study it and they managed to see the memory swap. The kernel had to be compiled differently. In order to compile the kernel: In /Downloads/pcs3746-sistemas-operacionais/1/linux create the file .config-fragment containing: CONFIG_DEBUG_INFO=y CONFIG_DEVTMPFS=y CONFIG_PCI=y CONFIG_PCI_VERSATILE=y CONFIG_VIRTIO_BLK=y CONFIG_VIRTIO_PCI=y ...