Re: CS, DS, and SS Segments Together?
From: xyoavx (spamtrap_at_crayne.org)
Date: 01/03/05
- Previous message: Yousuf Khan : "Re: About 64-bit portability"
- In reply to: Matt: "Re: CS, DS, and SS Segments Together?"
- Next in thread: Matt: "Re: CS, DS, and SS Segments Together?"
- Reply: Matt: "Re: CS, DS, and SS Segments Together?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 3 Jan 2005 22:28:28 +0000 (UTC)
Hi Matt
Thanks a lot for your profound answer. Wherefrom did you get this
information ?
(books, articles, websites etc). I've never found such information,
although I read many books & articles.
Thanks in advance
Regards,
xyoavx
Matt wrote:
> "xyoavx" <spamtrap@crayne.org> wrote in message
> news:1104685938.201884.44330@c13g2000cwb.googlegroups.com...
> > Hi
> > You write:
> > Remember that the DS selector starts at 0 and goes to FFFFFFFF. It
> > isn't
> > limited to the data sections of the current program.
> > My question is: why should I give a limit of FFFFFFFF if I know
that my
> > data segment needs only 200 bytes ?
>
> Because there isn't any purpose to doing that when you are using
paging. If
> your data section is loaded at 4KB then accessing memory at 8KB will
cause
> an exception. (Remember, 0KB or NULL is typically reserved as an
error
> return from memory allocation functions.)
>
> There is, instead, very good reason *not* to change the limit of DS.
A large
> amount of code expects ds.base == 0 and ds.limit == 4GB. Calling into
shared
> libraries means they will have to change the value of DS.
Unfortunately it's
> not as simple as recompiling the code to handle this, but even if it
were,
> most programs would run much slower because they spent so much time
changing
> DS.
>
> Even if your program does not load any share libraries (which is
impossible
> on Windows), this still won't work. Newer x86 processors support a
few
> special instructions for making OS calls. These instructions are used
for
> making *fast* system calls. The caveat is that they assume the
segment
> registers all have a base of 0 and limit of 4GB. Changing the limit
of DS
> will not work with these fast system call instructions.
>
> -Matt
- Previous message: Yousuf Khan : "Re: About 64-bit portability"
- In reply to: Matt: "Re: CS, DS, and SS Segments Together?"
- Next in thread: Matt: "Re: CS, DS, and SS Segments Together?"
- Reply: Matt: "Re: CS, DS, and SS Segments Together?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|