From owner-freebsd-current@FreeBSD.ORG Sat Nov 3 15:30:29 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41B3D35E; Sat, 3 Nov 2012 15:30:29 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id DB71F8FC08; Sat, 3 Nov 2012 15:30:28 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qA3FURmt032171; Sat, 3 Nov 2012 09:30:28 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qA3FUPua009975; Sat, 3 Nov 2012 09:30:25 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: FreeBSD as read-only firmware From: Ian Lepore To: Mehmet Erol Sanliturk In-Reply-To: References: <1167404891.20121103170049@serebryakov.spb.ru> Content-Type: text/plain; charset="us-ascii" Date: Sat, 03 Nov 2012 09:30:25 -0600 Message-ID: <1351956625.1120.44.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Alexander Yerenkow , lev@freebsd.org, freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 15:30:29 -0000 On Sat, 2012-11-03 at 08:01 -0700, Mehmet Erol Sanliturk wrote: > I do not know exact data transmission rate of SDHC cards , but , I > think , > it is faster than CD or DVD . For CD and DVD , at present there is NO > any > only READ CD or DVD devices . They are disappeared from the market . > For > writable CD or DVD , it may be possible to append some files at the > end of > recorded area , and the media may be corrupted by re-recording ( I > think ) . Expect roughly 22-25MB/sec on a modern SDHC with a 4-bit datapath. Be aware that there's no way to truly write protect an SD card. There is a write protect tab on a full-size card (but not on a MicroSD), but it's not enforced in the card's hardware, it is a polite request to the system "please don't write to this card" and some systems don't even have the hardware to sense the switch position. Since it's flash-memory based, it also may corrupt the media on write, including the possibility of corrupting existing data that has no relation to the new data being written. That is, you could have a write-protected partition and a write-enabled partition on the same SDCard, and writing into the write-enabled partition can damage data on the write-protected partition. This is because you have no control over the way the embedded flash microcontroller allocates storage internally, and it is free to place data pages from unrelated filesystems into the same blocks (block = erase/programming sized unit). I suspect all off-the-shelf nand-flash based storage has the same problems, but CF and SDCard are the only ones I've got hands-on experience with. At work we're now moving away from CF and SDCard and towards putting nand flash chips directly onto our boards, and using FreeBSD to access them rather than relying on the behaviors of some embedded microcontroller we know nothing about. -- Ian