Questions tagged [virtual-address-space]

virtual address space (VAS) or address space is the set of ranges of virtual addresses that an operating system makes available to a process

A virtual address does not represent the actual physical location of an object in memory; instead, the system maintains a page table for each process, which is an internal data structure used to translate virtual addresses into their corresponding physical addresses. Each time a thread references an address, the system translates the virtual address to a physical address.

A virtual address space (VAS) or address space is the set of ranges of virtual addresses that an operating system makes available to a process.[1] The range of virtual addresses usually starts at a low address and can extend to the highest address allowed by the computer's instruction set architecture. This provides several benefits, one of which is, if each process is given a separate address space, security through process isolation.

http://en.wikipedia.org/wiki/Virtual_address_space
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366912(v=vs.85).aspx

234 questions
1
vote
3 answers

Is the memory allocated by malloc not necessarily physically continous?

the memory allocated by malloc could occupy several pages and these pages are not necessarily next to each other, is this correct?
PeopleMoutainPeopleSea
  • 1,492
  • 1
  • 15
  • 24
1
vote
0 answers

Function address in executable ( inspected by objdump ) not matching the address of the same function printed by printf. What happens under the hood?

I'm on an Ubuntu ( 22.04.3) x86_64 system. I know how virtual memory and pages work in general and I also know that systems can use ASLR. However I'd like to know what exactly happens in an Ubuntu system in this specific scenario. I have this little…
1
vote
1 answer

Why does MAXVA in xv6 source code differ from the value in the xv6 textbook?

Why is the MAXVA value defined differently in the xv6 textbook of MIT 6s081 and the xv6 source code? The textbook states that the maximum address is 2^38 - 1 = 0x3fffffffff, while the source code defines MAXVA as (1L << (9 + 9 + 9 + 12 - 1)), which…
Aries Zhao
  • 29
  • 6
1
vote
2 answers

MPI + Function Pointers?

If I'm running the same binary (which implies the same architecture) on multiple nodes of a Beowulf cluster in an MPI configuration, is it safe to pass function pointers via MPI as a way of telling another node to call a function? Under what…
dsimcha
  • 67,514
  • 53
  • 213
  • 334
1
vote
1 answer

AArch64 memory synchronization operations on multiply-mapped addresses

Suppose I have two pages that map to the same physical memory. Would an acquire operation (or fence) on a virtual address in one page properly synchronize with a release operation (or fence) on a virtual address in the other? Secondly, would cache…
1
vote
1 answer

Does memory allocation show up when opening "/proc/self/maps"?

I have just started learning about virtual memory and I don't understand if I can see the memory that I have allocated with mmap(). The 2 show_maps() print the same text. Shouldn't I also see the allocated memory from mmap() in the second…
Runner
  • 11
  • 1
1
vote
0 answers

Why does VMMAP show 128TB of virtual memory address space for any given process on windows 10?

Windows is supposed to divide the address space such way that there's a split, the low 128 TB is supposed to be for user-space, then after the x86 non-canonical addresses, the higher 128TB is supposed to belong to kernel-space. I opened VMMAP to…
Trey
  • 474
  • 2
  • 9
  • 32
1
vote
1 answer

Does Windows map DLLs to the same virtual address in different processes?

Say two processes are using Kernel32.dll, does Windows map the DLLs to the same virtual address space in both processes? If not, how does paging mechanism end up using the same physical address where the DLL is in fact loaded for both processes? I…
user16469617
1
vote
0 answers

How to find the virtual address of a page (including vmalloc situation) in linux kernel?

There is page_address() in linux kernel to get the virtual address of a page. However I find that it is not work when a page is allocted by vmalloc() in following demo. #include #include #include…
1
vote
1 answer

Is the kernel's physical memory mapping the same between all virtual address spaces?

On boot, I understand the the kernel is loaded into main memory. When we spawn processes, a portion of the virtual address space is reserved for the kernel. If every processes' virtual address space contains a mapping to the kernel, and the…
Joe
  • 587
  • 1
  • 8
  • 15
1
vote
1 answer

How to loop through all page table entries of a process in xv6?

I'm trying to loop through all pages for a process in xv6. I've looked at this diagram to understand how it works: but my code is getting: unexpected trap 14 from cpu 0 eip 801045ff (cr2=0xdfbb000) Code: pde_t * physPgDir = (void…
1
vote
0 answers

How to acquire virtual address space and separately provision memory on Win64, MacOS and Linux?

I would like to build a memory allocator to manage a large chunk of non-shared, linear address space (e.g. 32GB). I need to run this on the Big-3 operating systems, but I can live with having OS-specific code. Functionality desired: At start,…
1
vote
1 answer

Virtual Memory To Physical Translation?

My book had the following image: And a question of how many PTE's are there in L2 (or L1), the answer was 16 = 2^4 but why is that? In the question it's given that each PTE size is 2 bytes so the answer should be 2^4/2 = 8 Since L2 index holds…
1
vote
2 answers

virtual addressing v.s. physical addressing

I do not quite understand the benefit of "multiple independent virtual address, which point to the same physical address", even though I read many books and posts, E.g.,in a similar question Difference between physical addressing and virtual…
1
vote
1 answer

How do I determine the page number from the virtual address?

I am looking for help with the following homework question: It is assumed that a program has a virtual space of 1200 words. Consider the following series of virtual addresses: 60; 222; 160; 910; 450; 345; 412; 10; 180; 20; 443; 766; 812. Give the…
Bulbasaur
  • 303
  • 3
  • 19