From owner-freebsd-stable@FreeBSD.ORG Tue Jun 21 16:16:05 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11D991065672; Tue, 21 Jun 2011 16:16:05 +0000 (UTC) (envelope-from hlh@restart.be) Received: from tignes.restart.be (tignes.restart.be [IPv6:2001:41d0:2:56bf:0:1::]) by mx1.freebsd.org (Postfix) with ESMTP id 84C948FC15; Tue, 21 Jun 2011 16:16:04 +0000 (UTC) Received: from restart.be (avoriaz.tunnel.bel [IPv6:2001:41d0:2:56bf:1:ffff::]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smtp.restart.be", Issuer "CA master" (verified OK)) by tignes.restart.be (Postfix) with ESMTPS id 45A1F14FF9; Tue, 21 Jun 2011 18:16:00 +0200 (CEST) Received: from morzine.restart.bel (morzine.restart.be [IPv6:2001:41d0:2:56bf:1:2::]) (authenticated bits=0) by restart.be (8.14.5/8.14.5) with ESMTP id p5LGFxId023843; Tue, 21 Jun 2011 18:15:59 +0200 (CEST) (envelope-from hlh@restart.be) X-DKIM: Sendmail DKIM Filter v2.8.3 restart.be p5LGFxId023843 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=restart.be; s=avoriaz; t=1308672959; bh=zSysIZllsUotce84ZnG09PC54Pqnx5SSclcvIPvB1Ik=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=OmxGKVJe8LWgOflj8F/atEWj8DqPU+UyUR6QfZ9FHzaMbb0ZgbKpSiaLl5K9jALpg FxSBcW/hMhe2oOkFkENpg== X-DomainKeys: Sendmail DomainKeys Filter v1.0.2 restart.be p5LGFxId023843 DomainKey-Signature: a=rsa-sha1; s=avoriaz; d=restart.be; c=nofws; q=dns; h=message-id:date:from:organization:user-agent:mime-version:to:cc: subject:references:in-reply-to:content-type:content-transfer-encoding; b=ou8NIzGVLfrNPzFCSOinn6fQt4aI7yOgEAOsg67fmQNkfzAdoiu9YXcq+ma5n6+Bw 2ji3fqillp/RcJNWh0uAA== Message-ID: <4E00C3BE.3050004@restart.be> Date: Tue, 21 Jun 2011 18:15:58 +0200 From: Henri Hennebert Organization: RestartSoft User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.17) Gecko/20110616 Thunderbird/3.1.10 MIME-Version: 1.0 To: John Baldwin References: <201106210901.27338.jhb@freebsd.org> <4E00AFA6.4050305@restart.be> <201106211155.19231.jhb@freebsd.org> In-Reply-To: <201106211155.19231.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Re: ZFS boot inside on the second partition inside a slice X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2011 16:16:05 -0000 On 06/21/2011 17:55, John Baldwin wrote: > On Tuesday, June 21, 2011 10:50:14 am Henri Hennebert wrote: >> On 06/21/2011 15:01, John Baldwin wrote: >>> Index: zfsldr.S >>> =================================================================== >>> --- zfsldr.S (revision 223339) >>> +++ zfsldr.S (working copy) >>> @@ -234,9 +234,12 @@ nread.1: xor %ecx,%ecx # Get >>> callw read # Read from disk >>> lea 0x10(%bp),%sp # Clear stack >>> jnc return # If success, return >>> - mov $msg_read,%si # Otherwise, set the error >>> - # message and fall through to >>> - # the error routine >>> + mov %ah,%al # Format >>> + mov $read_err,%di # error >>> + call hex8 # code >>> + mov $msg_read,%si # Set the error message and >>> + # fall through to the error >>> + # routine >>> /* >>> * Print out the error message pointed to by %ds:(%si) followed >>> * by a prompt, wait for a keypress, and then reboot the machine. >>> @@ -296,12 +299,28 @@ read.1: mov $msg_chs,%si >>> jmp error >>> msg_chs: .asciz "CHS not supported" >>> >>> +/* >>> + * Convert AL to hex, saving the result to [EDI]. >>> + */ >>> +hex8: push %ax # Save >>> + shrb $0x4,%al # Do upper >>> + call hex8.1 # 4 >>> + pop %ax # Restore >>> +hex8.1: andb $0xf,%al # Get lower 4 >>> + cmpb $0xa,%al # Convert >>> + sbbb $0x69,%al # to hex >>> + das # digit >>> + orb $0x20,%al # To lower case >>> + stosb # Save char >>> + ret # (Recursive) >>> + >>> /* Messages */ >>> >>> -msg_read: .asciz "Read" >>> -msg_part: .asciz "Boot" >>> +msg_read: .ascii "Read error: " >>> +read_err: .asciz "XX" >>> +msg_part: .asciz "Boot error" >>> >>> -prompt: .asciz " error\r\n" >>> +prompt: .asciz "\r\n" >>> >>> .org PRT_OFF,0x90 >>> >> I get >> >> Read error: 01 > > Hmm, that would be 'invalid parameter'. > > Can you add a 'foo: jmp foo' infinite loop and move it around to figure out > which read call is failing? > main.5: mov %dx,MEM_ARG # Save args movb $NSECT,%dh # Sector count movl $1024,%eax # Offset to boot2 callw nread.1 # Read disk foo: jmp foo After this one I get 'Read error: 01' Henri