From owner-freebsd-embedded@FreeBSD.ORG Thu Nov 2 14:05:36 2006 Return-Path: X-Original-To: freebsd-embedded@freebsd.org Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A61016A50D for ; Thu, 2 Nov 2006 14:05:36 +0000 (UTC) (envelope-from lab@gta.com) Received: from gta.com (gta-edge-199-20.gta.com [199.120.225.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 6EC3843D90 for ; Thu, 2 Nov 2006 14:05:21 +0000 (GMT) (envelope-from lab@gta.com) Received: (qmail 66242 invoked by uid 1000); 2 Nov 2006 14:05:20 -0000 Date: 2 Nov 2006 14:05:20 -0000 Message-ID: <20061102140520.66241.qmail@gta.com> From: Larry Baird To: freebsd-embedded@freebsd.org In-Reply-To: User-Agent: tin/1.5.9-20010723 ("Chord of Souls") (UNIX) (FreeBSD/4.10-RELEASE (i386)) Cc: Subject: Re: bootmgr on pc engines wrap board X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Nov 2006 14:05:36 -0000 In article you wrote: > Hi, > > bootmgr hangs on the PC Engines WRAP board. > > It's been brought up before on the small@ list (IIRC), but with no > solution. > > It hangs just after > > "1 FreeBSD > 2 FreeBSD" > > I have a stack of the WRAP boards I was going to use for the NTP > Pool, but I really want to use a nanobsd style install which needs > bootmgr - so I'm stuck. Can anyone help? You might be running into a problem I was recently fighting with. I had a number of WRAP boards running fine using software based upon freeBSD 4.x. When trying to upgrad3 to software based upon 6.x that kept stopping in boot2. My results are different then yours in that I would see "Read error" from boot1. I initially tried setting BOOT_BOOT1_FLAGS to 0. If I remember correctly, this yielded identical results to what you are seeing. I then as a quick hack replaced the read routine in /sys/boot/i386/boot2/boot1.S with the read routine from 4.x. This allowed me to boot. Hopefully one day I'll get the time to fully analyze the 6.x read assembly to understand if there is a better fix. Patch is below. Index: boot1.S =================================================================== --- boot1.S (revision 8679) +++ boot1.S (working copy) @@ -268,25 +268,7 @@ * %dl - byte - drive number * stack - 10 bytes - EDD Packet */ -read: testb $FL_PACKET,%cs:MEM_REL+flags-start # LBA support enabled? - jz read.1 # No, use CHS - cmpb $0x80,%dl # Hard drive? - jb read.1 # No, use CHS - mov $0x55aa,%bx # Magic - push %dx # Save - movb $0x41,%ah # BIOS: Check - int $0x13 # extensions present - pop %dx # Restore - jc read.1 # If error, use CHS - cmp $0xaa55,%bx # Magic? - jne read.1 # No, so use CHS - testb $0x1,%cl # Packet interface? - jz read.1 # No, so use CHS - mov %bp,%si # Disk packet - movb $0x42,%ah # BIOS: Extended - int $0x13 # read - retw # To caller -read.1: push %dx # Save +read: push %dx # Save movb $0x8,%ah # BIOS: Get drive int $0x13 # parameters movb %dh,%ch # Max head number @@ -309,7 +291,7 @@ pop %dx # Restore cmpl $0x3ff,%eax # Cylinder number supportable? sti # Enable interrupts - ja ereturn # No, return an error + ja read.7 # No, try EDD xchgb %al,%ah # Set up cylinder rorb $0x2,%al # number orb %ch,%al # Merge @@ -320,11 +302,7 @@ mov 0x2(%bp),%ah # Blocks to read cmpb %ah,%al # To read jb read.2 # this -#ifdef TRACK_AT_A_TIME movb %ah,%al # track -#else - movb $1,%al # one sector -#endif read.2: mov $0x5,%di # Try count read.3: les 0x4(%bp),%bx # Transfer buffer push %ax # Save @@ -345,8 +323,24 @@ read.5: shlb %bl # buffer add %bl,0x5(%bp) # pointer, sub %al,0x2(%bp) # block count - ja read.1 # If not done + ja read # If not done read.6: retw # To caller +read.7: testb $FL_PACKET,%cs:MEM_REL+flags-start # LBA support enabled? + jz ereturn # No, so return an error + mov $0x55aa,%bx # Magic + push %dx # Save + movb $0x41,%ah # BIOS: Check + int $0x13 # extensions present + pop %dx # Restore + jc return # If error, return an error + cmp $0xaa55,%bx # Magic? + jne ereturn # No, so return an error + testb $0x1,%cl # Packet interface? + jz ereturn # No, so return an error + mov %bp,%si # Disk packet + movb $0x42,%ah # BIOS: Extended + int $0x13 # read + retw # To caller /* Messages */ -- ------------------------------------------------------------------------ Larry Baird | http://www.gta.com Global Technology Associates, Inc. | Orlando, FL Email: lab@gta.com | TEL 407-380-0220, FAX 407-380-6080