开发者

What is a address space of process? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

Please any body tell what is meant by address space ? w开发者_运维百科hy it is called like that ? and also about the virtual memory ?

Thanks in advance

Regards Pavankumar


I think address space refers to a segment.

In real mode (intel's XT and 286) segment is just a way to make a program independent of it's space in memory. When a program gets compiled the addresses (of varables, labels - functions) are hardcoded into a program. - This way it would be difficult to load two programs at the same time, because they would all want to use the same addresses.

We need to use relative addresses instead of absolute ones. The resolution between the relative and physical addresses are made relative to segments. If one program is loaded starting from the segment 0x200 and another program is loaded starting from 0x600 they can freely use the same address (for example 0x41) because that will be relative to their respective segments. In our case (real mode) the segment 0x200 will be translated to physical address 0x2000 (through multiplying it by 0x10) and after adding the relative address, the resulting physical address will be 0x2041.

There are many segments which can be used. Data operations by default are made relative to the program's Data Segment (held in the DS register of the cpu) and code operations are made relative to Code Sement (held in the CS register). Stack addresses are resolved to physical addresses using the Stack Segment (SS register).

But in real mode you can freely use the segments, you can access other program's segments or enter arbitrary values which will be resolved to arbitrary physical addresses.

In protected mode the whole concept changed. Segments do not hold addresses any more. They hold selectors. They only refer to an element in a table, where the real base addresses are held. The table also contains limits, so you can no longer address ANY physical address, only inside the portion of memory which was given to your program by the OS. This introduces the concept of ownership of memory blocks by processes.

I think this is enough for the start, feel free to read more on either Wikipedia or other good sources. The topic is quite documented.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜