linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Hafting <helgehaf@idb.hist.no>
To: Ian Thompson <ithompso@stargateip.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How can I jump to non-linux address space?
Date: Thu, 04 Oct 2001 11:04:03 +0200	[thread overview]
Message-ID: <3BBC2603.7C1327AC@idb.hist.no> (raw)
In-Reply-To: <NFBBIBIEHMPDJNKCIKOBEEGJCAAA.ithompso@stargateip.com>

Ian Thompson wrote:
> 
> Hi all,
> 
> I'm sorry if this is off-topic, but I wasn't sure where else to ask...
> 
> My kernel is running from RAM, and I want to jump to an address in ROM
> (which unfortunately, the kernel doesn't seem to know anything about).  I

The kernel can get to know - all you need is code that maps the
ROM address range into some available virtual address range.
Look at device driver code - they do such mapping for ROM and/or
memory-based io regions.

> don't plan on trying to resume the kernel after doing this.  However, I'm
> getting a prefetch abort.  If I try and load the data, I get a similar
> error: "Unable to handle kernel paging request at virtual address 00003000"
> where 0x3000 is the ROM address I'm trying to jump to / load from.  How can
> I pass execution to this address?  Do I have to turn off the MMU?  

How to set up the cpu before jumping to a ROM that won't return
can be tricky indeed.  This depends on what that ROM code expect!

Do that ROM code work when the MMU has remapped its adresses so it
appears at some adress completely different from the bus address?  (only
if it contains relative jumps only - no absolute addresses.) Does
it work with 4G segments?  Does it work at all in protected mode,
with all interrupts routed to the linux kernel instead of the bios?
Does this code expect to find something (data, device interfaces,
vga memory) at certain addresses?  If so, this must be mapped too.
For linux moves all this around.

In practise, existing ROM's tend to assume that the machine is
in a state close to what the bios initializes it to,
with 64k segments, no MMU, and a lot of assumptions about
how interrupts and hw devices are set up.  _All_ of these
assumptions break after you start linux, and resetting 
everything is so hard that it is usually done by
running the bios cold boot code.

Helge Hafting

  reply	other threads:[~2001-10-04  9:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-04  1:10 How can I jump to non-linux address space? Ian Thompson
2001-10-04  9:04 ` Helge Hafting [this message]
2001-10-04 19:40   ` Ian Thompson
2001-10-04 20:32     ` Richard B. Johnson
2001-10-05  0:35       ` Ian Thompson
2001-10-05  7:55         ` Russell King
2001-10-08 12:51         ` Richard B. Johnson
2001-10-04 20:35 ` Russell King
2001-10-06  0:38   ` Ian Thompson
2001-10-06  7:57     ` Russell King
2001-10-08 17:43       ` Ian Thompson
2001-10-08 20:01         ` Russell King

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=3BBC2603.7C1327AC@idb.hist.no \
    --to=helgehaf@idb.hist.no \
    --cc=ithompso@stargateip.com \
    --cc=linux-kernel@vger.kernel.org \
    /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).