lkml.org 
[lkml]   [2001]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Memory Access Problem
Date
From
> 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.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:53    [W:0.036 / U:1.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site