address-space

What is the addressability given number of 16 address wires (bus) and 8-bit word size?

爱⌒轻易说出口 提交于 2020-06-29 10:41:34
问题 A computer has 16 address wires (address bus?) and 8-bit word size. What is the addressability? I figured out that address space is 2^16 = 65536, but I still don't know how to calculate addressability. I know addressability is the bytes each space occupies but how do I figure this out? Any help would be appreciated, especially some general formula associating word size/address bus with addressability. I'm sorry if this question is super simple. 回答1: Since there are 2^16 unique values you can

Why is the heap section present when there are no malloc used

无人久伴 提交于 2020-02-07 07:23:07
问题 I am trying to find out whether heap exists in the address space of the process, if we don't call malloc. #include <stdio.h> int main() { getchar(); return 0; } Heap section is present in the maps even if i dont call malloc cat /proc/73268/maps 55d0b405c000-55d0b4160000 r-xp 00000000 08:01 5505031 /bin/bash 55d0b435f000-55d0b4363000 r--p 00103000 08:01 5505031 /bin/bash 55d0b4363000-55d0b436c000 rw-p 00107000 08:01 5505031 /bin/bash 55d0b436c000-55d0b4376000 rw-p 00000000 00:00 0 55d0b567e000

How the memory is mapped when fork is used?

て烟熏妆下的殇ゞ 提交于 2019-12-30 21:40:10
问题 i am new to "fork()",I read everywhere that when a fork() is called an exact copy of current (calling) process is started.Now when I run following code ,there should be two different processes, having two different memory locations assigned to their vars and functions. #include<stdio.h> int i=10; int pid; int main(){ if((pid=fork())==0){ i++;//somewhere I read that separate memory space for child is created when write is needed printf("parent address= %p\n",&i);// this should return the

How do you deal with numbers larger than UInt64 (C#)

瘦欲@ 提交于 2019-12-28 05:59:26
问题 In C#, how can one store and calculate with numbers that significantly exceed UInt64's max value (18,446,744,073,709,551,615)? 回答1: By using a BigInteger class; there's one in the the J# libraries (definitely accessible from C#), another in F# (need to test this one), and there are freestanding implementations such as this one in pure C#. 回答2: Can you use the .NET 4.0 beta? If so, you can use BigInteger. Otherwise, if you're sticking within 28 digits, you can use decimal - but be aware that

x86-64: canonical addresses and actual available range

霸气de小男生 提交于 2019-12-21 17:04:03
问题 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

AppDomain address space

这一生的挚爱 提交于 2019-12-20 10:29:15
问题 First, the question: do CLR specifications guarantee that the code executing in multiple app domains within the same process will share the same address space? By "sharing the address space" I mean that pointers to memory allocated in one of the app domains will be valid for reading and writing across all app domains hosted inside the same process. Consider this self-contained example illustrating the question: the program allocates a Worker object in a separate app domain. The Worker

Why can't OS use entire 64-bits for addressing? Why only the 48-bits?

…衆ロ難τιáo~ 提交于 2019-12-18 02:15:29
问题 I'm reading "Understanding Linux Kernel". Paging for 64-bit Architectures As we have seen in the previous sections, two-level paging is commonly used by 32-bit microprocessors. Two-level paging, however, is not suitable for computers that adopt a 64-bit architecture. Let's use a thought experiment to explain why: Start by assuming a standard page size of 4 KB. Because 1 KB covers a range of 2 10 addresses, 4 KB covers 2 12 addresses, so the Offset field is 12 bits. This leaves up to 52 bits

filename of memory mapped libraries osx

我怕爱的太早我们不能终老 提交于 2019-12-12 11:27:20
问题 I need to get the filenames of all memory mapped libraries of the current application. Currently I'm going through all mapped libraries via vm_region. Sadly it doesn't provide information about the filename of the current region. Is there a way to get this information in c without doing popen on vmmap ? 回答1: For regular mmap -ed files you can use proc_regionfilename() Note that you must provide a MAX_PATH-sized buffer to it. implemented in apple's libc - libproc.c, the underlying syscall is

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