All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Kirilenko <icedank@gmx.net>
To: linux-kernel@vger.kernel.org
Subject: Re: Searching for string problems
Date: Wed, 23 Apr 2003 21:05:38 +0300	[thread overview]
Message-ID: <200304232105.38722.icedank@gmx.net> (raw)
In-Reply-To: <Pine.LNX.4.53.0304231311460.25222@chaos>

Hello!

> If you need to search the whole BIOS for that string, you need to
> set up an outer loop using an unused register which starts at
> the offset of the BIOS and increments by one byte everytime
> you can't find the string. This value gets put into %di, instead
> of the absolute number specified above.
>
> Like:
>
> scan:	movw	%cs, %ax
> 	movw	%ax, %ds
> 	movw	%ax, %es
> 	movw	$where_in_BIOS_to_start, %bx
> 	cld
> 1:	movw	$cl_id_str, %si		# Offset of search string
> 	movw	$cl_id_end, %cx		# Offset of string end + 1
> 	subw	%si, %cx		# String length
> 	decw	%cx			# Don't look for the \0
> 	movw	%bx, %di		# ES:DI = where to look
> 	repz	cmpsb			# Loop while the same
> 	jz	found			# Found the string
> 	incb	%bx			# Next starting offset
> 	cmpb	$_BIOS_END, %bx		# Check for limit
> 	jb	1b			# Continue
> never_found_anywhere:
>
> found:

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).

Best regards,
Andrew.

  reply	other threads:[~2003-04-23 17:53 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 [this message]
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
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=200304232105.38722.icedank@gmx.net \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.