?
Solved

how process differnenciate?

Posted on 2000-04-28
14
Medium Priority
?
286 Views
Last Modified: 2010-04-02
Hi all,I run many program and I find every program has the same CS content.So,My questio is simple:

Why different process has different physic address in windows since they have same CS selector ?

Thanks
0
Comment
Question by:Babyworship
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 2761829
This is the "miracle" of virtual memory.  All programs "see" the same virtual memory space and the operating system along with VM hardware map the virtual address space to real physical addresses and your disk-based pagefile.
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2761901
Because they have different LDTs which has different linear address which is dissected into different pages which refer to different phisical address which make each one different in between which make my comment which is bad english expression which means i'm poor in English which encourage me study everyday which will result in better expression in the future which will help me ask and answer question here more easy...

Regards
Eirnava...

0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2762146
Hi:
  This is just saying what jhance and Wyn have said but in a different way.  
   Each process has it's own LDT - the OS keeps track of the active LDT by putting info in the LDTR (LDT Register).  An app's CS is simply a 13-bit index into its LDT.  The particular entry in its LDT has a 32-bit linear address which has to be deciphered.  Already you can see how addresses are already different since eventhough 2 app's have an index of say 3 they go to two different LDTs.
   The 32-bit linear address is composed of 3 pieces: 10-bits for the  Directory, 10-bits for the Page and 12 bits for the offset.
   The 10-bits for the directory is again an index into a Page Directory Directory (which is pointed to by Control Register 3) - here's another reason the addresses differ.  When the particular entry in the Page Directory Table is accesses, it has an address to a Page Table.  The 10-bit for the Page in the linear address is an index into that Page Table.  And, finally, the very-very particular page table has an address to a physical address chunk is "real-live" memory.  The 12-bit offset in the linear address says where this page starts relative to the physical address indicated by the page table.  
   So, I made a short story long, but hopefully you see there are 3 reasons why two app's have the same CS and they hash to two different spots in physical memory.
  Glenn
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Babyworship
ID: 2762280
Thanks , Glenn ,I will give you the points for your great comment and help.But I still have one confusion in your comment:

I know CS always points to the zero address of the 4g virtual linear address in differnt programs, so , how it become different 32 linear address representing "The 32-bit linear address is composed of 3 pieces: 10-bits for the  Directory, 10-bits for the Page and 12 bits for the offset." as you state?

In short,how the 32bit comes different in different program?

Thanks!!
0
 

Author Comment

by:Babyworship
ID: 2762283
Thanks, Wyn,you are lots of fun:-)
0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2762289
I also had to stop laughing after reading Wyn's comment before commenting.  It's a classic!  
  I think Babyworship what you're saying is the CS selector 13-bit index is always 0? IF so, that just means the 0th index into the app's LDT.  You have to remember each app has its own LDT so that as another app starts executing, the LDTR will point to another/different LDT.  In the two LDT's 0th entry, even if the linear addresses are identical (although I do not believe you can "see" that info unless you are at Ring0), you still have the Page Directory Table (Control Register 3 points to 2 different directory tables for 2 different apps) and Page Tables to decipher the linear address.
   Glenn
0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2762321
>In short,how the 32bit comes different >in different program?
   Oops, I didn't answer your above question.  Let's say the 32-bit linear addresses are identical.  Since the Control Register 3 will point to two different Page Directory Tables, eventhough the 10-bit index into those two distinct tables are the same, the pointers to the Page Tables in the entry in the Page Directory Tables will be different.  Thus, already you're accessing different data structures to get the physical address.
  Glenn
0
 

Author Comment

by:Babyworship
ID: 2762354
Thanks,Glenn,say,differnt process has different LDT which has different starting address,is this address used into the 32bit address above?3

Thanks
0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2762361
No, the final physical address is from the Page Table.
   Glenn
0
 

Author Comment

by:Babyworship
ID: 2762399
Hi ,Glenn,I mean the 32bit address before applying paging.i.e:from the descriptor in the LDT table.
Is the IDT table base address useful for calculating the fianl address?  
0
 
LVL 3

Accepted Solution

by:
GlennDean earned 160 total points
ID: 2762499
Hi:
  Different paging tables means the 32-bit physical addresses are different.  
   The IDT has, to best of my knowledge, has nothing to do with going from CS to physical address.
   Glenn
0
 

Author Comment

by:Babyworship
ID: 2762519
Thanks!

Wyn,thank you too!!

And Jhance!

0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2762527
Hi Babyworship:
   Just out of curiosity, it's rare to find anyone who even cares 0.1% about all this stuff.  Are you working on a special project at work or maybe trying to write a Protected Mode program or you're just curious about all this stuff?
   Glenn
0
 

Author Comment

by:Babyworship
ID: 2762545
GlennDean ,would you please give me a email ?

babyworship@163.net

I want to let you know some.

Thank you here again!!!!!!

0

Featured Post

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question