Re: Searching for string problems

Andrew Kirilenko (icedank@gmx.net)
Wed, 23 Apr 2003 21:05:38 +0300


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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/