From: Josh Marshall <joshua.r.marshall.1991@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] unable to start plan9 on atom330 in virtualbox
Date: Tue, 14 Jun 2011 14:43:20 -0400 [thread overview]
Message-ID: <BANLkTi=QO2BfgTTPEq7mt+GyO5TU5cLAPQ@mail.gmail.com> (raw)
In-Reply-To: <7546ab2cd523ea7db9f9bea4822993fd@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 2802 bytes --]
Is there a resource whereby I could pickup this kind of debug skill, or is
this experience, and assembly knowledge?
On Mon, Jun 13, 2011 at 3:01 AM, <cinap_lenrek@gmx.de> wrote:
> ok, i think i can explain the "unlock of ilock: pc f0140fc5, held by ..."
> message.
>
> i extracted that 9pcflop kernel with muzgos cdfpart from the current iso
> and
> disassembled with acid arround.
>
> the routine that calls unlock looks like this:
>
> the routine that calls the unlock (shutdown from ether79c970.c)
> 0xf0140f79 0xf0140f79 SUBL $0x14,SP
> 0xf0140f7c 0xf0140f7c MOVL 0x18(SP),AX
> # ctlr = arg->foobar
> 0xf0140f80 0xf0140f80 MOVL 0x78(AX),CX
> 0xf0140f83 0xf0140f83 MOVL CX,0x10(SP)
> 0xf0140f87 0xf0140f87 MOVL CX,0x0(SP)
> # ilock(ctlr)
> 0xf0140f8a 0xf0140f8a CALL 0xf019af31
> 0xf0140f8f 0xf0140f8f MOVL 0x10(SP),AX
> 0xf0140f93 0xf0140f93 MOVL AX,0x0(SP)
> 0xf0140f96 0xf0140f96 MOVL $0x18,AX
> 0xf0140f9b 0xf0140f9b MOVL AX,0x4(SP)
> # io32r(ctlr, 0x18) ???
> 0xf0140f9f 0xf0140f9f CALL 0xf01409b4
> 0xf0140fa4 0xf0140fa4 MOVL 0x10(SP),AX
> 0xf0140fa8 0xf0140fa8 MOVL AX,0x0(SP)
> 0xf0140fab 0xf0140fab MOVL $0x18,AX
> 0xf0140fb0 0xf0140fb0 MOVL AX,0x4(SP)
> # io16r(ctlr, 0x18);
> 0xf0140fb4 0xf0140fb4 CALL 0xf014093f
> 0xf0140fb9 0xf0140fb9 MOVL 0x10(SP),AX
> 0xf0140fbd 0xf0140fbd MOVL AX,0x0(SP)
> # unlock(ctlr)
> 0xf0140fc0 0xf0140fc0 CALL 0xf019b0be
> 0xf0140fc5 0xf0140fc5 ADDL $0x14,SP
> 0xf0140fc8 0xf0140fc8 RET
>
> it have no debug symbols so i looked for magic numbers
> arround (in this case 0x18)
>
> wich turned out to be:
>
> ether79c970.c:31: Sreset = 0x0018, /* software reset
> */
>
> # this looks like io32r() from ether79c970.c
> acid: asm(0xf01409b4)
> 0xf01409b4 0xf01409b4 SUBL $0x8,SP
> 0xf01409b7 0xf01409b7 MOVL 0xc(SP),CX
> # port = arg2
> 0xf01409bb 0xf01409bb MOVL 0x1c(CX),CX
> # port += arg1
> 0xf01409be 0xf01409be ADDL 0x10(SP),CX
> 0xf01409c2 0xf01409c2 MOVL CX,0x0(SP)
> # inl(port)
> 0xf01409c5 0xf01409c5 CALL 0xf010036e
> 0xf01409ca 0xf01409ca ADDL $0x8,SP
> 0xf01409cd 0xf01409cd RET
>
> # this is inl()
> acid: asm(0xf010036e)
> 0xf010036e 0xf010036e MOVL 0x4(SP),DX
> 0xf0100372 0xf0100372 INL DX,AX
> 0xf0100373 0xf0100373 RET
>
> so there is your bug!
>
> static void
> shutdown(Ether *ether)
> {
> Ctlr *ctlr;
>
> ctlr = ether->ctlr;
> ilock(ctlr);
> io32r(ctlr, Sreset);
> io16r(ctlr, Sreset);
> unlock(ctlr);
> }
>
> it was commented out before...
>
> the file just changed... i think they try to fix it right now...
>
> --
> cinap
>
>
[-- Attachment #2: Type: text/html, Size: 3376 bytes --]
next prev parent reply other threads:[~2011-06-14 18:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-11 21:55 Cr0t
2011-06-11 22:15 ` Jacob Todd
2011-06-11 22:23 ` Gorka Guardiola
2011-06-11 23:43 ` blstuart
2011-06-11 23:25 ` Cr0t daywalker
2011-06-11 23:36 ` Gorka Guardiola
2011-06-11 23:40 ` cinap_lenrek
2011-06-11 23:45 ` Robert Ransom
2011-06-11 23:51 ` cinap_lenrek
2011-06-11 23:47 ` Cr0t daywalker
2011-06-12 0:32 ` cinap_lenrek
2011-06-12 0:40 ` Cr0t daywalker
2011-06-12 16:56 ` Iruatã Souza
2011-06-13 2:42 ` cinap_lenrek
2011-06-13 7:01 ` cinap_lenrek
2011-06-13 7:06 ` cinap_lenrek
2011-06-13 7:15 ` cinap_lenrek
2011-06-13 22:41 ` Cr0t
2011-06-14 18:43 ` Josh Marshall [this message]
2011-06-14 21:42 ` Cr0t daywalker
2011-06-15 12:21 ` Cr0t daywalker
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='BANLkTi=QO2BfgTTPEq7mt+GyO5TU5cLAPQ@mail.gmail.com' \
--to=joshua.r.marshall.1991@gmail.com \
--cc=9fans@9fans.net \
/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).