From owner-freebsd-arm@FreeBSD.ORG Mon Mar 16 22:58:11 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47DED85B for ; Mon, 16 Mar 2015 22:58:11 +0000 (UTC) Received: from mail-qc0-x230.google.com (mail-qc0-x230.google.com [IPv6:2607:f8b0:400d:c01::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F2B83A0 for ; Mon, 16 Mar 2015 22:58:10 +0000 (UTC) Received: by qcto4 with SMTP id o4so58630465qct.3 for ; Mon, 16 Mar 2015 15:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=l36BUIKTCvVDkQqhRlXSSdHyCZzT88r+X1oI3v+5RXo=; b=K8TV73O0JIeTSNWg5ER1T4X3wPG8QWdjtabvPNVMDlbOgPJDlb32rcf4dY1rCX6REg tFU4Wt3fVv4qzeneoWjLKJbfQ4R6y2QO5kFFHoxkMS7sVQw6rDzMFLA7dtWS038UA2kK l8TdHIZc3NidYtrBNLzkLm7FDCn3iRCAQFXLmOXDTV/vLWjm23I4by4Uq7MZas3CC1Y4 YYJMBtFizEKPNcbHnTv087olLEAtudYG9FVFJsiq/jf7wemnKPL6vP7XZnHOLQc4Qqk3 mfTuMsD9wlxKBeybHaUDhBw+WUAhmvn+ZRSwWnNSLsE2P2OYjrMpIxQIqXCkPLMlXSsk L78Q== MIME-Version: 1.0 X-Received: by 10.55.20.213 with SMTP id 82mr104251535qku.46.1426546690150; Mon, 16 Mar 2015 15:58:10 -0700 (PDT) Received: by 10.140.37.82 with HTTP; Mon, 16 Mar 2015 15:58:10 -0700 (PDT) In-Reply-To: <29227F8C-4A83-4C95-9CD2-BA14E797A882@sbcglobal.net> References: <29227F8C-4A83-4C95-9CD2-BA14E797A882@sbcglobal.net> Date: Mon, 16 Mar 2015 19:58:10 -0300 Message-ID: Subject: Re: hexdumping /dev/mem From: =?UTF-8?Q?Mat=C3=ADas_Perret_Cantoni?= To: Thomas Skibo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2015 22:58:11 -0000 2015-03-16 18:42 GMT-03:00 Thomas Skibo : > >> On Mar 16, 2015, at 1:00 PM, Mat=C3=ADas Perret Cantoni wrote: >> >> Hello! >> >> I'm trying to read a 32 bit register of the System Level Control >> Registers of the ZedBoard (Zynq-7000 SoC) from a running FreeBSD. I >> thought that I could simply do it with hexdump(1) to avoid writing a >> driver since I only need to read it once. I've tried: >> >> >> #hexdump -s 0xF8000910 -n 4 /dev/mem >> >> >> and I get this message: >> >> hexdump: /dev/mem: Invalid argument >> >> >> Reading some archives in this mailing list I've found that "the arm >> version of /dev/mem is not functionally equivalent to that of amd64 or >> i386. Arm disallows access to non-DRAM addresses through /dev/mem=E2=80= =9D. > > That=E2=80=99s correct. /dev/mem only reads from memory not devices. > > I always use kdb to peek/dump registers. You have to translate the devic= e addresses (use =E2=80=9Cshow devmap=E2=80=9D to see the mappings). > Looks like kdb is what I needed :). I don't even need hexdump. I guess I'm learning pretty basic stuff here. > But, once you know the kernel virtual addresses of the registers, you mig= ht be able to hexdump them through /dev/kmem. (I don=E2=80=99t have a Zedb= oard in front of me to try that.) > I couldn't find any man page for "kdb" or "db", and the help command of db didn't help much. ddb(4) and the section "On-Line Kernel Debugging Using DDB" of the developers-handbook were useful, but there's no clue about the show devmap there. Is there any other documentation source that I can read to find more about this? And last, once I entered kdb, is there any way to go back to the system without rebooting? Thank you! >> >> Is there any other way of doing this? Maybe the whole idea of using >> hexdump for this isn't really good. >> >> >> >> Thanks in advance. >> Regards, >> Matias. >> _______________________________________________ >> freebsd-arm@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-arm >> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" > > ------- > Thomas Skibo > thomasskibo@sbcglobal.net > > > >