Re: linear vs. logical addresses? how does cpu interpret kerneladdrs?

From: Richard B. Johnson
Date: Wed Sep 17 2003 - 06:39:59 EST


On Tue, 16 Sep 2003, Ben Johnson wrote:

> short version:
>
> 1) When I am referencing a pointer in the kernel, is the value of that
> pointer variable interpreted by the cpu as a logical or linear address?
>
> 2) if I have two overlapping data/stack segments presently selected,
> each with a different base, how does the cpu know which segment/base
> address to use to get the linear address?
>
[SNIPPED...]
All stack offsets are accessed relative to SS. No exceptions.
However a compiler may calculate those offsets based upon
something else.
This is why DS must equal SS if 'C' is going to access both
stack data variables and data segment variables. This is how
the 'C' code converter is set up. It is not a CPU limitation.
If you change the SS in the kernel, strange and wonderful
things will occur.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (794.73 BogoMips).
Note 96.31% of all statistics are fiction.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/