0
votes

I was reading an operating system book and I found the following information which I couldn't understand :

Logical and physical addresses are the same in compile-time and load-time address-binding schemes; logical (virtual) and physical addresses differ in execution-time address-binding scheme".

so does it mean that in the compile-time address-binding which converts symbolic addresses to physical address or to relocatable addresses and in load-time address-binding which converts relocatable addresses to physical address , the program deals with physical addresses and the CPU generates the physical address directly ?!

and in execution-time address-binding scheme in which the location of the program in main memory may change so there would be separated address spaces ?!

is that the idea or Am I missing something ?

1

1 Answers

1
votes

Which operating system text are you reading from; ie. what date?

Traditional UNIX tools comprised a compiler (ccN), which converted source into asm; an assembler (as), which converted asm into either relocatable object code or executable; and a loader (ld) which combined object code files into a resolved executable.

Note that the assembler, if all symbols were resolved, could create an executable: the convention a.out is an artifact of this.

Other systems, notably IBM mainframes and later MSDOS, referred to loading as link editting, a difference without distinction.

When ld resolved (assigned) addresses to the executable, those addresses were virtual; although in practice might have been physical. Ld didn't care, its job was to combine N object files into a fully resolved executable, perhaps guided by rules like: .text = 0x0, .data = .text + size(.text), .... If I had an embedded system with only physical addresses, I could guide ld with other rules.

The resultant, a.out has a notion of the addresses of everything, and on modern equipment (where modern means any significant computer since 1978) these are virtual addresses, which the operating system which maps the executable into memory resolves to other physical memory addresses.

In more modern system, (since circa 2003), the a.out does not contain exact addresses, rather contains relative addresses and internal mapping tables. This enables operating systems to change a programs addresses each time they are run to thwart some simple malware attacks.