Re: cat /dev/mem, cat /dev/ram ?

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Aug 08, 2007 at 04:36:08PM -0500, Christopher Reder wrote:
> In trying to track down potential ram issues, I was messing around with
> different devices.  I have a ram chip, 32meg on the bus of a at91rm9200. 
> 
>  
> 
> Is there a way to view the ram memory?  When I try cat /dev/mem, I get a bad
> virtual address and segmentation fault.

That's because it doesn't work that way on ARM. Get devmem2.c from
http://www.lartmaker.nl/lartware/port/devmem2.c and see how it open()s
and mmap()s /dev/mem. The utility is mainly used for playing with
(memory mapped) IO, but with some hacking you could let it read all
system ram as well (you need to know the memory map for that, of
course).

> When I try a cat /dev/ram0 , the cursor will blink like it is working and I
> can see that the kernel hasn't crashed.  Eventually, it fails as well, but
> on a null virtual address.  I have the output below and have cut it short so
> as to not include too much.  Can someone tell me if this is normal and if it
> isn't, what could be the cause of it (setup issue with kernel etc).  I am
> running 2.6.20, with the AT91 patches.

/dev/ram0 is a ramdisk, usually not very useful because it only
contains a small part of the memory.

> # cat /dev/ram0

Uhm, try cat /dev/ram0 > /dev/null

Without the redirect cat will spew the contents on the tty which can
really upset your terminal emulator and shell.

> <1>Unable to handle kernel NULL pointer dereference at virtual address 00000000
> [  459.880000] pgd = c1f5c000
> [  459.880000] [00000000] *pgd=21f44031, *pte=00000000, *ppte=00000000
> [  459.880000] Internal error: Oops: 17 [#2]
> [  459.880000] Modules linked in:
> [  459.880000] CPU: 0
> [  459.880000] PC is at __wake_up_common+0x30/0xbc
> [  459.880000] LR is at __wake_up+0x40/0x6c
> [  459.880000] pc : [<c003f460>]    lr : [<c00404e4>]    Not tainted
> [  459.880000] sp : c1f5bcf0  ip : c1f5bd20  fp : c1f5bd1c
> [  459.880000] r10: 00000003  r9 : c1f5bd40  r8 : 00000000
> [  459.880000] r7 : 00000001  r6 : c0000070  r5 : a0000013  r4 : c1f5a000
> [  459.880000] r3 : 00000000  r2 : 00000001  r1 : fffffff4  r0 : 00000000
> [  459.880000] Flags: nzcv  IRQs off  FIQs on  Mode SVC_32  Segment user
> [  459.880000] Control: C000717F
> [  459.880000] Table: 21F5C000  DAC: 00000015
> [  459.880000] Process cat (pid: 256, stack limit = 0xc1f5a258)
> [  459.880000] Stack: (0xc1f5bcf0 to 0xc1f5c000)
> [  459.880000] bce0:                                     0000002c c1f5a000 a0000013 c0335144

If you repeat it, does it crash at the same place or somewhere
different?


Erik

- -- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGuvsb/PlVHJtIto0RAv4ZAJ4+H1c1v+1iC/x89qT7nJDpKyif/wCdGXqN
tViPXjzBBYlzNsB/kmtjXoo=
=ZsqQ
-----END PGP SIGNATURE-----

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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