All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@rainbow-software.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Debugging APM - cat /proc/apm produces oops
Date: Mon, 24 Jul 2006 23:51:37 +0200	[thread overview]
Message-ID: <200607242351.37578.linux@rainbow-software.org> (raw)
In-Reply-To: <20060724010658.687e78be.sfr@canb.auug.org.au>

On Sunday 23 July 2006 17:06, Stephen Rothwell wrote:
> On Sun, 23 Jul 2006 16:30:53 +0200 Ondrej Zary <linux@rainbow-software.org> 
wrote:

> >  printing eip:
> > 00002f9d
> > *pre = 00000000
> > Oops: 0002 [#4]
> > Modules linked in:
> > CPU:    0
> > EIP:    00c0:[<00002f9d>]    Not tainted VLI
>
>           ^^^^
> This is the APM BIOS 16 bit code segment.

Looking at BIOS disassembly:
2F97: push bp
2F98: mov bp,sp
2F9A: add sp,-2
2F9D: mov [bp][-2],bx    <-- it oopses here

I realized that I can modify the BIOS easily as it's stored in shadow RAM. So 
I replaced the offending MOV with three NOPs and tested again. This time it 
oopsed at 0x2FAD:
2FAD: cmp w,[bp][-2],1
2FB1: je 2FCB

that jump was taken during my single stepping, so I NOPped out the CMP and 
replaced JE with JMPS. Then booted Linux and APM seems to work fine - battery 
percentage and remaining time is there as well as AC power status.
There seems to be 4 these operations:
mov [bp][-2],bx
cmp w,[bp][-2],1
cmp w,[bp][-2],8002
cmp w,[bp][-2],8001
but I've hit only the first two of them. I wonder what's that for (especially 
when it works without that).

-- 
Ondrej Zary

  parent reply	other threads:[~2006-07-24 21:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-23 14:30 Debugging APM - cat /proc/apm produces oops Ondrej Zary
2006-07-23 14:41 ` Ondrej Zary
2006-07-23 15:06 ` Stephen Rothwell
2006-07-23 16:35   ` Ondrej Zary
2006-07-24 21:51   ` Ondrej Zary [this message]
2006-07-25 20:04   ` Ondrej Zary
2006-07-25 19:15 ` Alan Cox
2006-07-25 20:11   ` Ondrej Zary
  -- strict thread matches above, loose matches on Subject: below --
2006-07-25  7:46 Chuck Ebbert

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=200607242351.37578.linux@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.