From: "ron minnich" <rminnich@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] a question on APE
Date: Tue, 18 Dec 2007 09:38:43 -0800 [thread overview]
Message-ID: <13426df10712180938i72e63d86qcedfa551261ce09c@mail.gmail.com> (raw)
In-Reply-To: <47677CAF.4080009@gmx.de>
On Dec 17, 2007 11:54 PM, Kernel Panic <cinap_lenrek@gmx.de> wrote:
> Ahh... just looked at the code...
> Ok, as i expected... recv() calls a different read() from
> /sys/src/libc/9sys/read.c. It will all work if
> recv() would call the thing from this one:
> /sys/src/ape/lib/ap/plan9/read.c.
I'm not seeing that. I would be happy if you are right but I can't confirm it.
I run acid on the binary:
recv 0x000cd7b6 SUBL $0x10,SP
recv+0x3 0x000cd7b9 MOVL flags+0xc(FP),AX
recv+0x7 0x000cd7bd ANDL $0x1,AX
recv+0xa 0x000cd7c0 CMPL AX,$0x0
recv+0xd 0x000cd7c3 JEQ recv+0x22(SB)
recv+0xf 0x000cd7c5 MOVL $0x29,errno(SB)
recv+0x19 0x000cd7cf MOVL $0xffffffff,AX
recv+0x1e 0x000cd7d4 ADDL $0x10,SP
recv+0x21 0x000cd7d7 RET
recv+0x22 0x000cd7d8 MOVL fd+0x0(FP),CX
recv+0x26 0x000cd7dc MOVL CX,0x0(SP)
recv+0x29 0x000cd7df MOVL a+0x4(FP),CX
recv+0x2d 0x000cd7e3 MOVL CX,0x4(SP)
recv+0x31 0x000cd7e7 MOVL n+0x8(FP),CX
recv+0x35 0x000cd7eb MOVL CX,0x8(SP)
recv+0x39 0x000cd7ef CALL read(SB)
recv+0x3e 0x000cd7f4 ADDL $0x10,SP
recv+0x41 0x000cd7f7 RET
so it calls read.
Read is this:
read 0x000c3834 SUBL $0x28,SP
read+0x3 0x000c3837 MOVL nbytes+0x8(FP),DI
read+0x7 0x000c383b MOVL buf+0x4(FP),SI
read+0xb 0x000c383f MOVL d+0x0(FP),BX
read+0xf 0x000c3843 CMPL BX,$0x0
read+0x12 0x000c3846 JLT read+0x19(SB)
read+0x14 0x000c3848 CMPL BX,$0x60
read+0x17 0x000c384b JLT read+0x2c(SB)
read+0x19 0x000c384d MOVL $0x4,errno(SB)
read+0x23 0x000c3857 MOVL $0xffffffff,AX
read+0x28 0x000c385c ADDL $0x28,SP
read+0x2b 0x000c385f RET
read+0x2c 0x000c3860 LEAL 0x0(BX)(BX*4),CX
read+0x2f 0x000c3863 SHLL $0x2,CX
read+0x32 0x000c3866 LEAL _fdinfo(SB)(CX*1),AX
read+0x39 0x000c386d MOVL 0x0(AX),AX
read+0x3b 0x000c386f ANDL $0x2,AX
read+0x3e 0x000c3872 CMPL AX,$0x0
read+0x41 0x000c3875 JEQ read+0x19(SB)
read+0x43 0x000c3877 CMPL DI,$0x0
read+0x46 0x000c387a JHI read+0x4e(SB)
read+0x48 0x000c387c XORL AX,AX
read+0x4a 0x000c387e ADDL $0x28,SP
read+0x4d 0x000c3881 RET
read+0x4e 0x000c3882 CMPL SI,$0x0
read+0x51 0x000c3885 JNE read+0x66(SB)
read+0x53 0x000c3887 MOVL $0x9,errno(SB)
read+0x5d 0x000c3891 MOVL $0xffffffff,AX
read+0x62 0x000c3896 ADDL $0x28,SP
read+0x65 0x000c3899 RET
which is the ape version. There is only one read symbol in the binary,
and it's a T.
So I am not convinced the recv is calling the wrong thing. That said,
I'm still going to change it in source to see what happens :-)
ron
prev parent reply other threads:[~2007-12-18 17:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-18 1:36 ron minnich
2007-12-18 1:44 ` andrey mirtchovski
2007-12-18 7:32 ` Kernel Panic
2007-12-18 7:54 ` Kernel Panic
2007-12-18 17:38 ` ron minnich [this message]
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=13426df10712180938i72e63d86qcedfa551261ce09c@mail.gmail.com \
--to=rminnich@gmail.com \
--cc=9fans@cse.psu.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).