![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 10
Rep Power: 0
![]() |
Descriptor tables
This question doesn't have anything directly to do with assembly code but is "essential," I would think, to assembly (and is from what I've seen a topic in many assembly tutorials).
Anyway, my question is relating to the area of the descriptor table entry called the "limit." This limit is supposed to hold a 20-bit number describing the size of the segment, in bytes (or 4K if granularity bit is enabled). Now, nearly everywhere I've read says that in protected mode segments can be up to 4GB. Yet 2^20=1,048,576B and hence 1MB segments at most seem possible. I don't understand how this can be. I think the discrepancy is obvious. The information on the 'net regarding memory logic layout & low level CPU stuff is pretty scant. It's either usually outdated and maybe only covers real mode and old processors or really condensed. If anyone has any good links, pass them along ![]() Help is appreciated. I feel like I ask too many questions here. ![]() |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
What you're talking about is platform and tool dependent. From what does your question arise, exactly?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2005
Posts: 10
Rep Power: 0
![]() |
Hmm, platform and tool dependent? Not sure what you mean by tool, but I was of the thought that OSes only managed what were already fixed CPU-memory relationships (ie, the segmented real and protected modes and flat memory model). The question arises mainly out of curiosity, but I suppose it'd help whenever I desire to start learning assembly lang. too.
|
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
I presume, possibly erroneously, that you're referring to descriptor tables for some memory management approaches. Not every system indulges in memory management or segmented addressing schemes, or even "real" vs. "protected" modes. It's very implementation dependent. Despite the huge number of desktop machines out there running a few "common" operating systems, there are even more non-desktop microprocessor "computers" or systems. If you want to learn assembly language, pick a processor -- they differ, often radically. When you have a processor in hand (or mind), then familiarize yourself with what IT does and how it does it. A great deal of system software is an adjunct constrained by the capabilities of the underlying machine.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Apr 2005
Posts: 10
Rep Power: 0
![]() |
You're correct. I was talking specifically about PC memory management/CPUs. I thought "PC" was assumed by default on the forum, but apparently not, which is probably a good thing.
|
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
A very large amount of commercial programming is not in "PCs". Neither does PC mean "IBM PC compatible". The world of the microprocessor is actually quite diverse and probably more widespread than frequently thought. I don't have the usual picture of the market, I suppose; in 35 years of microprocessor programming interspersed throughout other engineering duties, "desktop" programs are but a tiny fraction of the whole.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 | ||
|
Newbie
|
Quote:
Quote:
![]() Either you have byte-resolution and 1MB max size, or 4kB (page) resolution and 4GB size (this is used by most OSes). |
||
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|