From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Rich.Liu@ite.com.tw
Cc: linux-kernel@vger.kernel.org
Subject: Re: Memory Access Problem
Date: Tue, 15 May 2001 10:40:41 +0100 (BST) [thread overview]
Message-ID: <E14zbJp-0002Gu-00@the-village.bc.nu> (raw)
In-Reply-To: <412C066DD818D3118D4300805FD4667902090B77@ITEMAIL> from "Rich.Liu@ite.com.tw" at May 15, 2001 02:36:51 PM
> I use readw to access memory below 1MB , report "Segmentation fault"
> and stall in memory
>
> simple code below (this will get paraller port)
> ==
> int init_module(void){
> unsigned int *BIOS_Data=(unsigned int *)0x400;
> u32 test;
> test = readw(BIOS_Data);
>
> printk(KERN_CRIT "0x400:%x\n",test);
> }
> ==
> but those can work in kernel 2.2.19 , no problem .
>
> can anyone help me ?
2.2 had back compatibility support for old drivers that did this 2.4 does
not.
readb() is for bus accesses after mapping with ioremap
isa_readb() is a quick form for ISA bus which is always mapped
For main memory you want to use
phys_to_virt()
to get the virtual mapping of the page. That will work for the BIOS page but
not for arbitary higher pages which may not even be mapped.
prev parent reply other threads:[~2001-05-15 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-15 6:36 Rich.Liu
2001-05-15 9:40 ` Alan Cox [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=E14zbJp-0002Gu-00@the-village.bc.nu \
--to=alan@lxorguk.ukuu.org.uk \
--cc=Rich.Liu@ite.com.tw \
--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
all inboxes | Powered by JetHome®