2005-11-09 20:35:58

by Steven Schveighoffer

[permalink] [raw]
Subject: Reading BIOS information from a kernel driver

I am trying to read a string that the BIOS has placed into memory.

The BIOS placed the string into memory at real-mode address F000:FA00
(i.e. physical address FFA00h).

1. Is there a linear address which always contains this address
location? i.e. if there is a spot where I can do:

char * mystring = (char *)0xMagicAddress;

2. If not, how do I map a linear address to this physical address so I
can read it?

I'm pretty sure that the string can be read, but I would prefer to know
exactly where the string is located before looking. For example, the
following command finds the string:

dd if=/proc/kcore bs=1024 count=3000 | grep mystring

-Steve


2005-11-10 23:31:40

by Aleksey Gorelov

[permalink] [raw]
Subject: RE: Reading BIOS information from a kernel driver

>-----Original Message-----
>From: [email protected]
>[mailto:[email protected]] On Behalf Of
>Steven Schveighoffer
>Sent: Wednesday, November 09, 2005 12:36 PM
>To: [email protected]
>Subject: Reading BIOS information from a kernel driver
>
>I am trying to read a string that the BIOS has placed into memory.
>
>The BIOS placed the string into memory at real-mode address F000:FA00
>(i.e. physical address FFA00h).
>
>1. Is there a linear address which always contains this address
>location? i.e. if there is a spot where I can do:
>
>char * mystring = (char *)0xMagicAddress;
>
>2. If not, how do I map a linear address to this physical address so I
>can read it?
>
>I'm pretty sure that the string can be read, but I would prefer to know
>exactly where the string is located before looking. For example, the
>following command finds the string:
>
>dd if=/proc/kcore bs=1024 count=3000 | grep mystring
>
>-Steve

I think you are looking for phys_to_virt(0xffa00)

Aleks.

2005-11-11 05:30:47

by Arjan van de Ven

[permalink] [raw]
Subject: RE: Reading BIOS information from a kernel driver


>
> I think you are looking for phys_to_virt(0xffa00)

and ioremap



2005-11-11 06:18:47

by Aleksey Gorelov

[permalink] [raw]
Subject: RE: Reading BIOS information from a kernel driver




-----Original Message-----
From: Arjan van de Ven [mailto:[email protected]]
Sent: Thu 11/10/2005 9:30 PM
To: Aleksey Gorelov
Cc: Steven Schveighoffer; [email protected]
Subject: RE: Reading BIOS information from a kernel driver


>>
>> I think you are looking for phys_to_virt(0xffa00)

>and ioremap

Well, area in question is always mapped... So, phys_to_virt OR ioremap
will do the right thing - in fact, ioremap implementation
actually does phys_to_virt for 0xa0000 - 0x100000