Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

x86 assembly question



Hello,
I suspect that some assembly code is not doing what I think it should.
But as it's in the early stage of boot it's hard to debug.

Here's the (32bits) code:
	push %ebx /* save start_info to stack */
	/* do stuff */
        movl $RELOC(__kernel_end), %ebp
        addl $3, %ebp
        andl $~3, %ebp
        movl 0(%ebp), %eax /* read size */
        addl %ebp, %eax /* compute esym */
        /* check if start_info is within symbol table */
        movl -4(%esp), %ebx
        cmp %ebx, %ebp;
        jb .save_esym /* %ebx < __kernel_end */
        cmp %ebx, %eax
        jae .save_esym /* %ebx >= esym */
	/* no symbol table */

basically, we get a (physical address) in %ebx, which I call start_info,
which is saved to stack.
Later I compute the read the size of what should be the symbol table
and compute its end address. Then I want to check if start_info
is in the computed symbol table, if it's the case then there's no symbol table.

Now, with a kernel with no symbol table things to wrong, and I suspect this
code doesn't do what it should. Could someone familiar with x86 assembly
tell me if I got something wrong ?

thanks in advance

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index