From owner-freebsd-small Tue Feb 18 16:48:11 2003 Delivered-To: freebsd-small@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 45D3A37B401 for ; Tue, 18 Feb 2003 16:48:09 -0800 (PST) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC30743F93 for ; Tue, 18 Feb 2003 16:48:08 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.3/8.12.3) with ESMTP id h1J0m395008000; Tue, 18 Feb 2003 16:48:03 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.3/8.12.3/Submit) id h1J0m3vE007999; Tue, 18 Feb 2003 16:48:03 -0800 (PST) (envelope-from rizzo) Date: Tue, 18 Feb 2003 16:48:02 -0800 From: Luigi Rizzo To: soekris-tech@lists.soekris.com Cc: small@freebsd.org Subject: summary and patch for CF problems in booting the 4501 Message-ID: <20030218164802.A484@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-small@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, recently I encountered problems in booting the Soekris4501 (bios 1.00a and 1.10) with some new CF cards (64MB and 256MB, respectively, made by Samsung). The same CF cards work fine when mounted on IDE-CF adapters to boot a desktop PC. After some investigation which consumed the best part of the day, it turned out that the 4501 seems to have problems reading multiple sectors at once on those particular CF cards (which is curious, because I have booted successfully the soekris box with other 64M cards). I am unclear on where the problem is -- maybe the BIOS and the CF disagree on the geometry, though the problem still occurs on a 29-sector file (the natsemi.lzrom etherboot code) which seems to fit in the first track. A quick and dirty patch to fix the problem in the FreeBSD loader (boot1) and the Etherboot loader (boot1a.bin) consists in forcing the loader to load one sector at a time. Fortunately the code is already structured to support something similar on crossing track boundaries, so it suffices to replace the sequence: jb read.2 # this movb %ah,%al # track with the sequence movb $1, %al nop nop right before the 'read.2' label. The string to be replaced is \0162\02\0210\0340 and the replacement is \0260\01\0220\0220 A binary patch is the following (the location of the code changes in /boot/boot1 and /boot/boot1a.bin): ofs=328 # for boot1 ofs=335 # for boot1a.bin file="/boot/boot1a.bin" sh -c "echo -e '\0260\01\0220\0220'" | \ dd of=${file} bs=1 count=4 oseek=${ofs} conv=notrunc I am not sure if this is a complete fix, i.e. there might be other parts of the kernel which use the BIOS to access the CF loading multiple sectors at once. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-small" in the body of the message