linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Andrew Kirilenko <icedank@gmx.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Searching for string problems
Date: Wed, 23 Apr 2003 15:37:09 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.53.0304231529320.25963@chaos> (raw)
In-Reply-To: <200304232200.20028.icedank@gmx.net>

On Wed, 23 Apr 2003, Andrew Kirilenko wrote:

> Hello!
>
> > > > > I've written something similar to this before - and it wont' work, so
> > > > > I've reimplemented it. The problem is, that I don't know how to set
> > > > > ES properly. I only know, that BIOS data (and code) is located in
> > > > > 0xe000..0xf000 (real address).
> > > >
> > > > Yeah. So. I set ES and DS to be exactly where CS is. This means that
> > > > if your &!)(^$&_ code executes it will work. So, instead of trying
> > > > it, you just blindly ignore it and state that it won't work.
> > > >
> > > > Bullshit. I do this for a living and I gave you some valuable time
> > > > which you rejected out-of-hand. Have fun.
> > >
> > > Of course, I've tried your code as well - the same result! Sorry, if you
> > > haven't understand me.
> > >
> > > The problem is, that I don't know where this BIOS code is relative to
> > > current code segment (CS). I only know (hope), that it should be in
> > > 0x0:0xe000...0x0:0xf000. I have tried to set ES to 0 (xor %ax, %ax; mov
> > > %ax, %es) - no luck as well. BTW, `strings /dev/mem | grep "REQUESTED
> > > STRING"` founds it perfectly...
> > >
> > > Best regards,
> > > Andrew.
> > > -
> >
> > The bios is in segment 0xf000. You set ES to that area. ES:DI will
> > start at 0 if bx=0 in the code shown. The BIOS is only 64k.
> > This means that where bx is being incremented (it should be incw, not
> > incb). It would generate an assembly error with incb which is why
> > I knew you didn't even try it.  -- you just jnz back to 1b, without
> > any additional test.
>
> 1. How to set ES to this area? "movw $0xf000, %ax ; movw %ax, %es" will be
> enough?

Yes.

> 2. Is the are really starts from 0xf000? Or 0xe000?

The stuff used to boot, usually the relocated and shadowed
BIOS ROM, always exists at absolute address 0x000f0000. Since
a 'segment' is a 16-byte thing, the appropriate segment
is 0xf000.  The code must be there because the 'reset-vector'
is (must be) 16 bytes from the end of this segment. That's
the code that first gets control during the startup sequence.

The BIOS setup menus and other stuff is (typically) put down
at 0xe000. However many new BIOS uncompress some stuff from
NVRAM and put it anywhere they want because they 'own' all
the RAM in the system until an attempted boot.

> 3. I'm smart enough to correct "incb %bx" to "incw %bx" ;)
>
> Best regards,
> Andrew.

If you use the string search primative I show, it will work.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.


  parent reply	other threads:[~2003-04-23 19:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-23 16:58 Searching for string problems Andrew Kirilenko
2003-04-23 17:39 ` Richard B. Johnson
2003-04-23 18:05   ` Andrew Kirilenko
2003-04-23 18:15     ` Richard B. Johnson
2003-04-23 18:25       ` Andrew Kirilenko
2003-04-23 18:56         ` Richard B. Johnson
2003-04-23 19:00           ` Andrew Kirilenko
2003-04-23 19:11             ` Randy.Dunlap
2003-04-23 19:37             ` Richard B. Johnson [this message]
2003-04-23 19:48               ` Andrew Kirilenko
2003-04-23 20:05                 ` Randy.Dunlap
2003-04-23 20:05                 ` Richard B. Johnson
2003-04-23 20:12                   ` Andrew Kirilenko
2003-04-23 18:59         ` Randy.Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.53.0304231529320.25963@chaos \
    --to=root@chaos.analogic.com \
    --cc=icedank@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).