From owner-freebsd-mips@freebsd.org Wed Apr 4 15:22:14 2018 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A580EF96B98 for ; Wed, 4 Apr 2018 15:22:14 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28325811F5 for ; Wed, 4 Apr 2018 15:22:13 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: c14acd0a-381b-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id c14acd0a-381b-11e8-b951-f99fef315fd9; Wed, 04 Apr 2018 15:20:49 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w34FM5JU084426; Wed, 4 Apr 2018 09:22:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1522855325.49673.231.camel@freebsd.org> Subject: Re: od command behavior change From: Ian Lepore To: Mori Hiroki , "freebsd-mips@freebsd.org" Date: Wed, 04 Apr 2018 09:22:05 -0600 In-Reply-To: <415409.96436.qm@web101706.mail.ssk.yahoo.co.jp> References: <967709.5440.qm@web101702.mail.ssk.yahoo.co.jp> <415409.96436.qm@web101706.mail.ssk.yahoo.co.jp> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Apr 2018 15:22:14 -0000 On Wed, 2018-04-04 at 15:24 +0900, Mori Hiroki wrote: > Hi. > > I checked usr.bin/hexdump code. But I can't found reason. > > I seem j option and device file is cause of this problem. > > # od -N 6 -t x1 -j 4 /dev/flash/spi0s.u-boot-env > od: /dev/flash/spi0s.u-boot-env: Invalid argument > 0000004 > > # od -N 6 -t x1 /dev/flash/spi0s.u-boot-env > 0000000    50  30  00  01  00  18                                     >     > 0000006 > > # dd if=/dev/flash/spi0s.u-boot-env of=/tmp/aaa > # od -N 6 -t x1 -j 4 /tmp/aaa > 0000004    00  18  84  32  96  00                                     >     > 0000012 Reads of spiflash devices must be aligned to 512 byte offsets and lengths, and writes must be aligned to erase size (usually 4k or 64k). This should always work right:  dd if=/dev/flash/spi0s.u-boot-env count=1 | od -N 6 -t x1 -j 4 -- Ian