virtual-address-space

Understanding Virtual Address, Virtual Memory and Paging

耗尽温柔 提交于 2019-11-28 03:02:29
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 actually have.”. Some other articles say “Virtual Memory is the combination of Physical Memory (RAM), a

Drawbacks of using /LARGEADDRESSAWARE for 32 bit Windows executables?

牧云@^-^@ 提交于 2019-11-27 17:20:59
We need to link one of our executables with this flag as it uses lots of memory. But why give one EXE file special treatment. Why not standardize on /LARGEADDRESSAWARE? So the question is: Is there anything wrong with using /LARGEADDRESSAWARE even if you don't need it. Why not use it as standard for all EXE files? Opmet blindly applying the LargeAddressAware flag to your 32bit executable deploys a ticking time bomb ! by setting this flag you are testifying to the OS: yes, my application (and all DLLs being loaded during runtime) can cope with memory addresses up to 4 GB. so don't restrict the

How remap_pfn_range remaps kernel memory to user space?

穿精又带淫゛_ 提交于 2019-11-27 14:44:07
问题 remap_pfn_range function (used in mmap call in driver) can be used to map kernel memory to user space. How is it done? Can anyone explain precise steps? Kernel Mode is a privileged mode (PM) while user space is non privileged (NPM). In PM CPU can access all memory while in NPM some memory is restricted - cannot be accessed by CPU. When remap_pfn_range is called, how is that range of memory which was restricted only to PM is now accessible to user space? Looking at remap_pfn_range code there

Why does a 32-bit OS support 4 GB of RAM?

£可爱£侵袭症+ 提交于 2019-11-27 05:34:31
问题 Just reading some notes in a purdue lecture about OSs, and it says: A program sees memory as an array of bytes that goes from address 0 to 2^32-1 (0 to 4GB-1) Why 4 GB? 回答1: Because 32 bits are able to represent numbers up to 2 32 − 1 = 4294967295 = 4 GiB − 1 and therefore address up to 2 32 individual bytes which would be 4 GiB then. There are ways to circumvent that, though. For example using PAE even a 32-bit operating system can support more memory. Historically this has most commonly

Disable and re-enable address space layout randomization only for myself

。_饼干妹妹 提交于 2019-11-27 04:14:58
I would like to disable address space layout randomization (ASLR) on my system (Ubuntu Gnu/Linux 2.6.32-41-server), but, if I use sysctl -w kernel.randomize_va_space=0 the change would affect all users on the system, I presume. (Is this true?) How can I limit the effects of disabling ASLR to myself as a user only, or only to the shell session in which I invoke the command to disable? BTW, I see that my system's current (default) setting is sysctl -w kernel.randomize_va_space=0 Why 2 and not 1 or 3? Where can I find documentation about the numerical values of /proc/sys settings, their ranges,

How to translate a virtual memory address to a physical address?

 ̄綄美尐妖づ 提交于 2019-11-27 00:37:37
问题 In my C++ program (on Windows), I'm allocating a block of memory and can make sure it stays locked (unswapped and contiguous) in physical memory (i.e. using VirtualAllocEx(), MapUserPhysicalPages() etc). In the context of my process, I can get the VIRTUAL memory address of that block, but I need to find out the PHYSICAL memory address of it in order to pass it to some external device. 1. Is there any way I can translate the virtual address to the physical one within my program, in USER mode?

Drawbacks of using /LARGEADDRESSAWARE for 32 bit Windows executables?

大憨熊 提交于 2019-11-26 18:55:42
问题 We need to link one of our executables with this flag as it uses lots of memory. But why give one EXE file special treatment. Why not standardize on /LARGEADDRESSAWARE? So the question is: Is there anything wrong with using /LARGEADDRESSAWARE even if you don't need it. Why not use it as standard for all EXE files? 回答1: blindly applying the LargeAddressAware flag to your 32bit executable deploys a ticking time bomb ! by setting this flag you are testifying to the OS: yes, my application (and

Is there any API for determining the physical address from virtual address in Linux?

别来无恙 提交于 2019-11-26 17:40:54
Is there any API for determining the physical address from virtual address in Linux operating system? Kernel and user space work with virtual addresses (also called linear addresses) that are mapped to physical addresses by the memory management hardware. This mapping is defined by page tables, set up by the operating system. DMA devices use bus addresses. On an i386 PC, bus addresses are the same as physical addresses, but other architectures may have special address mapping hardware to convert bus addresses to physical addresses. In Linux, you can use these functions from asm/io.h : virt_to

Why is the ELF execution entry point virtual address of the form 0x80xxxxx and not zero 0x0?

非 Y 不嫁゛ 提交于 2019-11-26 17:34:10
When executed, program will start running from virtual address 0x80482c0. This address doesn't point to our main() procedure, but to a procedure named _start which is created by the linker. My Google research so far just led me to some (vague) historical speculations like this: There is folklore that 0x08048000 once was STACK_TOP (that is, the stack grew downwards from near 0x08048000 towards 0) on a port of *NIX to i386 that was promulgated by a group from Santa Cruz, California. This was when 128MB of RAM was expensive, and 4GB of RAM was unthinkable. Can anyone confirm/deny this? As Mads

Disable and re-enable address space layout randomization only for myself

核能气质少年 提交于 2019-11-26 11:08:26
问题 I would like to disable address space layout randomization (ASLR) on my system (Ubuntu Gnu/Linux 2.6.32-41-server), but, if I use sysctl -w kernel.randomize_va_space=0 the change would affect all users on the system, I presume. (Is this true?) How can I limit the effects of disabling ASLR to myself as a user only, or only to the shell session in which I invoke the command to disable? BTW, I see that my system\'s current (default) setting is sysctl -w kernel.randomize_va_space=0 Why 2 and not