Re: Stored data missed in setup.S

Andrew Kirilenko (icedank@gmx.net)
Wed, 23 Apr 2003 16:39:57 +0300


Hello!

> > I feel myself stupid, when fighting against setup.S. Here is small piece
> > of code (/arch/i386/boot/setup.S)
> >
> > --->
> > start_of_setup: # line 160
> > # bla bla bla - some checking code
> > movb $1, %al
> > movb %al, (0x100)
> > ....
> > ....
> > pushw %ax
> > movb (0x100), %al
>
> You put something from offset 0x100 into %al.
>
> > cmpb $1, %al
>
> Then you compared it against 1. This is where the comparaison
> occurred.
>
> > popw %ax # pop don't change any flags - 386 asm reference
>
> Then you put something else into %ax. Whatever it is, doesn't count.
>
> > je bail820 # and it don't jump -- al != 1
>
> Then you jumped based upon the comparison you made before you
> destroyed the contents of %al by poping %eax (%eax is (%ah << 8) | %al).
>
> If you don't want to muck with registers, just do:
>
> cmpb $1, (0x100)
> jz wherever
>
> You don't need to put memory oprands into registers to compare.
>
> > meme820: # line 300
> > <---

OK. And now code looks like:
-->
start_of_setup: # line 160
# bla bla bla - some checking code
movb $1, %al
movb %al, (0x100)
....
....
cmpb $1, (0x100)
je bail820 # and it DON'T jump here
<--

I'm sure, I'm doing something wrong. But what???

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/