Re: read PCI memory and config spyce through /dev/mem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 06 May 2013 14:44:03 -0000, "Warlich, Christof" said:

> $ dd if=/dev/mem bs=1 count=1024 skip=4150263808
> dd: reading `/dev/mem': Bad address
> 0+0 records in
> 0+0 records out
> 0 bytes (0 B) copied, 6.6658e-05 s, 0.0 kB/s
>
> The kernel config help says that _PCI_ memory access is even
> possible with STRICT_DEVMEM enabled. Can anyone give me a hint
> what I may do wrong?

You *do* realize that doing a byte access on a 64-bit PCI register
will probably fail, right?  And changing it to bs=8 won't fix it either,
because some registers are 32-bit, and some are write-only.

Bottom line - what you're doing wrong is not accessing the PCI address
space in the exact manner that the PCI spec requires.  You're lucky it
just threw "bad address" - it *is* possible to end up wiping your entire
system this way if you screw up the PCI config for your disk controller or
similar.  Be glad you didn't have to recover from your backups this time.

You *do* have backups, right?

Attachment: pgpwz4eZd1pfM.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux