Article View: alt.lang.asm
Article #434Re: The offset is so large
From: cmk128
Date: Sun, 11 Jun 2006 14:15
Date: Sun, 11 Jun 2006 14:15
47 lines
3191 bytes
3191 bytes
Frank Kotler 寫道:
> cmk128@hotmail.com wrote:
> > thanks for the great answrer,
>
> Sorry, I couldn't resist. :) Nathan gave you a more serious answer.
>
> > my memory layout is like that:
> >
> > OS library : 0x1800000
> > OS code : 0x1600000
> >
> > And my SS is 0x0 and ESP is 0x16ffffff,
>
> Do you mean SS.base is 0x0? SS = 0 would be an invalid selector. Or are
> we not in pmode yet? In any case, you've got a badly misaligned stack!
> Use a "round number". 0x17000000 should be okay for an initial esp.
>
> > that's why i go the negative
> > value in the OS library. But it is already? in my os library function,
> > when i declare a char array which larger than 4KB, i got a GP (general
> > protection fault). Please give me some suggestions to solve this.
>
> You can hardly expect us to diagnose problems in your OS! 4k sounds like
> a probable page size - maybe an error in your "page not present" handling?
>
> Might be more of an a.o.d. question than either asm or gnu gcc...
> Essentially, you need someone to debug your code for you, and you're
> probably not going to find anyone, so you'll have to do it yourself. You
> use Bochs, right? That's supposed to tell you something (I've never used
> it). Or you could "instrument" your code - put something on the screen,
> or beep, before each section of code, so you can at least see how far
> you got before the crash...
>
> As Betov says, "Courage!"
>
> Best,
> Frank
Hi Frank
I fixed the problem, a negative value is ok, i proved it myself. My
stack frame is in lower memory location then the code frame, and it has
no problem. It was a c++ programming mistake in my code before, now
fixed.
thanks again
from Peter (cmk128@hotmail.com)
Technical Details
Message-ID:
<1150035336.713398.60060@m38g2000cwc.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!m38g2000cwc.googlegroups.com!not-for-mailReferences:
<1149914165.205201.192150@m38g2000cwc.googlegroups.com> <MNCdnRBuINEAzRfZnZ2dnUVZ_q2dnZ2d@comcast.com> <1149941295.897580.211400@g10g2000cwb.googlegroups.com> <qeCdnQ9cEJP1YxfZnZ2dnUVZ_vSdnZ2d@comcast.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f7d8d,c887c247d41a26de X-Google-Thread: 11318c,c887c247d41a26de X-Google-Attributes: gidf7d8d,gid11318c,public X-Google-Language: ENGLISH,UTF8 Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!m38g2000cwc.googlegroups.com!not-for-mail From: cmk128@hotmail.com Newsgroups: alt.lang.asm,gnu.gcc.help Subject: Re: The offset is so large Date: 11 Jun 2006 07:15:36 -0700 Organization: http://groups.google.com Lines: 48 Message-ID: <1150035336.713398.60060@m38g2000cwc.googlegroups.com> References: <1149914165.205201.192150@m38g2000cwc.googlegroups.com> <MNCdnRBuINEAzRfZnZ2dnUVZ_q2dnZ2d@comcast.com> <1149941295.897580.211400@g10g2000cwb.googlegroups.com> <qeCdnQ9cEJP1YxfZnZ2dnUVZ_vSdnZ2d@comcast.com> NNTP-Posting-Host: 59.188.70.158 Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1150035341 603 127.0.0.1 (11 Jun 2006 14:15:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 11 Jun 2006 14:15:41 +0000 (UTC) In-Reply-To: <qeCdnQ9cEJP1YxfZnZ2dnUVZ_vSdnZ2d@comcast.com> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: m38g2000cwc.googlegroups.com; posting-host=59.188.70.158; posting-account=cL8-QAwAAAAxHD4gjqv464LpnCLN8_pk