virtual-address-space

Understanding Virtual Address, Virtual Memory and Paging

好久不见. 提交于 2019-12-17 17:24:33
问题 I've been learning these topics and read many articles and books but they all lack some complementary information and confused me even more. So here, I’d like to explain what I know while I am asking my questions. Hopefully, this topic will be useful for many like me. I'd also like to learn validity of my knowledge and corrections if necessary. Virtual Memory Some articles say “Virtual Memory is some space of Hard Disk which emulates Physical Memory so that we can have more memory than we

Reasonable valid start address for mmap address hint so as to be gauranteed that things work

99封情书 提交于 2019-12-11 10:42:16
问题 In one of our assignments we are required to build a distributed shared memory between 2 machines, I was using a paging based technique such that the base addresses are different on both the machines. But there is this linked list test case which almost mandates that both address ranges are same. mmap's fixed address using MAP_FIXED causes the slave machine to crash( because the stack of the reply server thread was getting overwritten ), i figured that creating an address that is gauranteed

What is the difference between these two functions: `ioremap_uc()` and `set_memory_uc`?

♀尐吖头ヾ 提交于 2019-12-10 17:11:26
问题 When I want to mark memory region as Write Combined (to disable cacheable and use BIU) or Uncacheable through set PAT(Page attribute table - 7bit in PTE), then what do I must to use, and what is the difference between two these functions? Drivers should use ioremap_[uc|wc] to access PCI BARs with [uc|wc] access types: void __iomem *ioremap_wc(resource_size_t phys_addr, unsigned long size) Drivers should use set_memory_[uc|wc] to set access type for RAM ranges: int set_memory_uc(unsigned long

How does Windows give 4GB address space each to multiple processes when the total memory it can access is also limited to 4GB

拜拜、爱过 提交于 2019-12-06 08:58:18
问题 How does Windows give 4GB address space each to multiple processes when the total memory it can access is also limited to 4GB. The solution of above question i found in Windows Memory Management (Written by: Pankaj Garg) Solution: To achieve this Windows uses a feature of x86 processor (386 and above) known as paging. Paging allows the software to use a different memory address (known as logical address) than the physical memory address. The Processor’ paging unit translates this logical

Unit Testing for x86 LargeAddressAware compatibility

陌路散爱 提交于 2019-12-04 20:35:34
问题 For a win32 executable (x86) we can set the LargeAddressAware flag so it can access a virtual address space of 4 GB (instead of just 2 GB) when running on x64 Windows. This looks very appealing. However, there are risks involved. For example see: Drawbacks of using /LARGEADDRESSAWARE for 32 bit Windows executables? So let's go ahead and configure the system that is executing some unit tests with the system-wide registry switch AllocationPreference set to MEM_TOP_DOWN . That should do, shouldn

is number of frame = number of pages(linux)?

走远了吗. 提交于 2019-12-04 13:54:04
问题 I am studying linux device driver and found that number of pages are equal to number of frame. Each page map to each frame.It says like whenever program needs memory it will allocate pages. But in OS books i found like virtual address divides into pages and these pages are loaded into frames.then how can number of pages be equal to frame? which of above is correct? how linux store information in page table regarding virtual,page,frame mapping? I am totally confused. 回答1: Physical pages are

Where does the OS store argv and argc when a child process is executed?

99封情书 提交于 2019-12-04 12:45:59
问题 I'm having some difficulty understanding how the OS passes data from the address space of a parent process to the address space of a child process. Namely, in a C program, where is argc and argv stored upon being passed into main? I understand how argv is essentially a double pointer. What I'm not understanding is what the OS does with those values after loading them into the kernel. After creating an address space for the child process does it push these values on the stack of the new space?

How does Windows give 4GB address space each to multiple processes when the total memory it can access is also limited to 4GB

ⅰ亾dé卋堺 提交于 2019-12-04 12:42:44
How does Windows give 4GB address space each to multiple processes when the total memory it can access is also limited to 4GB. The solution of above question i found in Windows Memory Management (Written by: Pankaj Garg) Solution: To achieve this Windows uses a feature of x86 processor (386 and above) known as paging. Paging allows the software to use a different memory address (known as logical address) than the physical memory address. The Processor’ paging unit translates this logical address to the physicals address transparently. This allows every process in the system to have its own 4GB

x86-64: canonical addresses and actual available range

梦想的初衷 提交于 2019-12-04 08:08:24
Intel and AMD documentation says that for 64 bit mode only 48 bits are actually available for virtual addresses, and bits from 48 to 63 must replicate bit 47 (sign-extension). As far as I know, all current CPU are implemented this way, but nothing (in theory) forbids to extend the available space in future implementations (and this won't break the binary compatibility). Is there a standard way to programatically determine the number of meaningful bits? (i.e. some specific CPUID, as happens for physical addresses). I know that in practice 48 bits are far more than enough for any reasonable

how to check if exe is set as LARGEADDRESSAWARE

前提是你 提交于 2019-12-03 11:35:48
问题 I am developing a C# program that will load files and get information such as loaded file created date, modification date, size etc. Another thing that I need to know is whether the loaded file ( executable.exe ) is linked with the LARGEADDRESSAWARE flag. The FileInfo class doesn't provide this information. Does anyone know how in C# can I find out whether a given executable.exe is linked with the LARGEADDRESSAWARE flag (to handle addresses larger than 2 GB)? 回答1: Here is some code that