[ros-kernel] Can someone give me a hand in here
Waldo Alvarez
wac at ghost.matcom.uh.cu
Thu Dec 18 11:24:45 CET 2003
On Wed, 17 Dec 2003, Skywing wrote:
> You must never read past the terminating null, *especially* in kernel mode.
> If the string is on a page boundary, that could cause a crash.
Then I suppose I have to check for such a case, using an extra register or
intentionally putting a 0 at page boundaries saving in the stack that
final data, and walking through pages in such a way. There will be just a
very ligth performance degradation.
> The only registers that you don't need to save (on x86) are eax, ecx, and
> edx.
Yes I tested it saving ebx and still the same. Thanks for the info. But
what's the reason? The compiler checks for it before the
function is called everytime?
> -----Original Message-----
> From: ros-kernel-bounces at reactos.com [mailto:ros-kernel-bounces at reactos.com]
> On Behalf Of Waldo Alvarez
> Sent: Wednesday, December 17, 2003 1:21 PM
> To: ReactOS Kernel List
> Subject: [ros-kernel] Can someone give me a hand in here
>
> Hello:
>
> I was changing this file in ROS to speedup strlen but ReactOS
> crashes with a page fault very quick since strlen is used almost
> everywhere. But I'm not used to this kind of assembler format. Can someone
> take a look at it. It could read at most 3 bytes beyond the ending 0 in
> the string but i don't think it could be a problem since the page size is
> 4 kb the other reason could be the ebx register I'm not saving. as opposed
> to the previous function.
>
> Thanks in advance
> Waldo Alvarez
>
>
> _______________________________________________
> Ros-kernel mailing list
> Ros-kernel at reactos.com
> http://reactos.com/mailman/listinfo/ros-kernel
>
More information about the Ros-kernel
mailing list