NetBSD Problem Report #42202
From www@NetBSD.org Tue Oct 20 02:59:00 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id 5038963B902
for <gnats-bugs@gnats.netbsd.org>; Tue, 20 Oct 2009 02:59:00 +0000 (UTC)
Message-Id: <20091020025900.0E56463B877@www.NetBSD.org>
Date: Tue, 20 Oct 2009 02:59:00 +0000 (UTC)
From: kosaki_kt@ybb.ne.jp
Reply-To: kosaki_kt@ybb.ne.jp
To: gnats-bugs@NetBSD.org
Subject: boot installcd fails ((amd64/i386)
X-Send-Pr-Version: www-1.0
>Number: 42202
>Category: install
>Synopsis: boot installcd fails ((amd64/i386)
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: dyoung
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Oct 20 03:00:01 +0000 2009
>Closed-Date: Sun Nov 08 16:56:02 +0000 2009
>Last-Modified: Sat Sep 11 12:45:01 +0000 2010
>Originator: kosaki
>Release: NetBSD 5.99.20
>Organization:
>Environment:
NetBSD phnm1 5.99.20 NetBSD 5.99.20 (GENERIC) #0: Mon Oct 19 17:09:36 JST 2009 kosaki@phnm1:/udd2/amd64/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
boot installcd fails ((amd64/i386)
>How-To-Repeat:
build iso-image
>Fix:
not a real fix but to create /usr/mdec/boot to boot cd
in new
src/sys/arch/i386/stand/lib/biosdisk.c
in the function
void
biosdisk_probe(void)
{
return; /* add return to boot cd (only for cd not for hdd ) */
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback
State-Changed-By: jmcneill@NetBSD.org
State-Changed-When: Tue, 20 Oct 2009 11:18:30 +0000
State-Changed-Why:
Please provide more information on how the install CD fails. Thanks!
Responsible-Changed-From-To: install-manager->jmcneill
Responsible-Changed-By: jmcneill@NetBSD.org
Responsible-Changed-When: Tue, 20 Oct 2009 11:20:11 +0000
Responsible-Changed-Why:
my fault
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: install-manager@NetBSD.org, netbsd-bugs@NetBSD.org, gnats-admin@NetBSD.org,
jmcneill@NetBSD.org, kosaki_kt@ybb.ne.jp, tsutsui@ceres.dti.ne.jp
Subject: Re: install/42202 (boot installcd fails ((amd64/i386))
Date: Tue, 20 Oct 2009 23:17:56 +0900
> Synopsis: boot installcd fails ((amd64/i386)
> Please provide more information on how the install CD fails. Thanks!
It looks now /boot becomes too large for bootxx_cd9660:
---
/* $NetBSD: cdboot.S,v 1.8 2008/05/03 13:07:31 ad Exp $ */
:
/*
* This is a primary boot loader that loads a secondary boot loader
* directly from CD without performing floppy/hard disk emulation as
* described by the El Torito specification.
*
* TODO:
* - Support for loading secondary boot loader > 64kB
*/
---
% tar ztvf base.tgz | grep mdec/boot
-r--r--r-- 1 root wheel 65628 Oct 19 05:31 ./usr/mdec/boot
---
Shrinked /boot (by disabling unneeded FSes for bootcd) seems also working,
as well as the proposed fix by submitter.
(though I'm not sure why larger /boot still works on some machines)
---
Izumi Tsutsui
From: "Jared D. McNeill" <jmcneill@invisible.ca>
To: <gnats-bugs@NetBSD.org>,
<jmcneill@NetBSD.org>,
<gnats-admin@netbsd.org>,
<netbsd-bugs@netbsd.org>,
<kosaki_kt@ybb.ne.jp>
Cc:
Subject: Re: install/42202 (boot installcd fails ((amd64/i386))
Date: Tue, 20 Oct 2009 10:51:01 -0400
Nice catch! I have trimmed some fat in /boot and can now produce an image <
64k, can you confirm that it works now?
-rwxr-xr-x 1 jmcneill users 65276 Oct 20 10:48 biosboot/boot
Thanks,
Jared
--------------------------------------------------
From: "Izumi Tsutsui" <tsutsui@ceres.dti.ne.jp>
Sent: Tuesday, October 20, 2009 10:20 AM
To: <jmcneill@NetBSD.org>; <gnats-admin@netbsd.org>;
<netbsd-bugs@netbsd.org>; <kosaki_kt@ybb.ne.jp>
Subject: Re: install/42202 (boot installcd fails ((amd64/i386))
> The following reply was made to PR install/42202; it has been noted by
> GNATS.
>
> From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
> To: gnats-bugs@NetBSD.org
> Cc: install-manager@NetBSD.org, netbsd-bugs@NetBSD.org,
> gnats-admin@NetBSD.org,
> jmcneill@NetBSD.org, kosaki_kt@ybb.ne.jp, tsutsui@ceres.dti.ne.jp
> Subject: Re: install/42202 (boot installcd fails ((amd64/i386))
> Date: Tue, 20 Oct 2009 23:17:56 +0900
>
> > Synopsis: boot installcd fails ((amd64/i386)
>
> > Please provide more information on how the install CD fails. Thanks!
>
> It looks now /boot becomes too large for bootxx_cd9660:
>
> ---
> /* $NetBSD: cdboot.S,v 1.8 2008/05/03 13:07:31 ad Exp $ */
> :
> /*
> * This is a primary boot loader that loads a secondary boot loader
> * directly from CD without performing floppy/hard disk emulation as
> * described by the El Torito specification.
> *
> * TODO:
> * - Support for loading secondary boot loader > 64kB
> */
> ---
> % tar ztvf base.tgz | grep mdec/boot
> -r--r--r-- 1 root wheel 65628 Oct 19 05:31 ./usr/mdec/boot
> ---
>
> Shrinked /boot (by disabling unneeded FSes for bootcd) seems also working,
> as well as the proposed fix by submitter.
>
> (though I'm not sure why larger /boot still works on some machines)
> ---
> Izumi Tsutsui
>
>
From: Nicolas Joly <njoly@pasteur.fr>
To: gnats-bugs@NetBSD.org
Cc: jmcneill@NetBSD.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org, kosaki_kt@ybb.ne.jp
Subject: Re: install/42202 (boot installcd fails ((amd64/i386))
Date: Wed, 21 Oct 2009 13:12:04 +0200
On Tue, Oct 20, 2009 at 02:55:02PM +0000, Jared D. McNeill wrote:
> The following reply was made to PR install/42202; it has been noted by GNATS.
>
> From: "Jared D. McNeill" <jmcneill@invisible.ca>
> To: <gnats-bugs@NetBSD.org>,
> <jmcneill@NetBSD.org>,
> <gnats-admin@netbsd.org>,
> <netbsd-bugs@netbsd.org>,
> <kosaki_kt@ybb.ne.jp>
> Cc:
> Subject: Re: install/42202 (boot installcd fails ((amd64/i386))
> Date: Tue, 20 Oct 2009 10:51:01 -0400
>
> Nice catch! I have trimmed some fat in /boot and can now produce an image <
> 64k, can you confirm that it works now?
>
> -rwxr-xr-x 1 jmcneill users 65276 Oct 20 10:48 biosboot/boot
How about adding a test somewhere to ensure that it won't silently
overflow again ?
--
Nicolas Joly
Biological Software and Databanks.
Institut Pasteur, Paris.
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: njoly@pasteur.fr
Cc: gnats-bugs@NetBSD.org, jmcneill@NetBSD.org, gnats-admin@NetBSD.org,
netbsd-bugs@NetBSD.org, kosaki_kt@ybb.ne.jp, tsutsui@ceres.dti.ne.jp
Subject: Re: install/42202 (boot installcd fails ((amd64/i386))
Date: Wed, 21 Oct 2009 22:59:26 +0900
> > Nice catch! I have trimmed some fat in /boot and can now produce an image <
> > 64k, can you confirm that it works now?
> >
> > -rwxr-xr-x 1 jmcneill users 65276 Oct 20 10:48 biosboot/boot
>
> How about adding a test somewhere to ensure that it won't silently
> overflow again ?
The real fix is to update cdboot.S to support real <-> protect mode
switches provided by i386/stand/lib/realprot.S, which is already used
by other primary bootxx loaders.
(I have not checked dosboot and fatboot though)
---
Izumi Tsutsui
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org, jmcneill@NetBSD.org
Cc: njoly@pasteur.fr, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
kosaki_kt@ybb.ne.jp, tsutsui@ceres.dti.ne.jp
Subject: Re: install/42202 (boot installcd fails ((amd64/i386))
Date: Sat, 24 Oct 2009 07:24:43 +0900
I wrote:
> The real fix is to update cdboot.S to support real <-> protect mode
> switches provided by i386/stand/lib/realprot.S, which is already used
> by other primary bootxx loaders.
Ah, no. The problem depends on implementation of INT 13h function 42h
(some BIOSes might handle it properly though), so we might have to
split a large xfer within 64KB in read_sectors function.
The attached dumb patch (checks and split >64KB xfers)
seems to work around even with ~67KB /boot on my machine.
(though I'm not familiar with x86 asm at all)
---
Index: stand/cdboot/cdboot.S
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/cdboot/cdboot.S,v
retrieving revision 1.8
diff -u -r1.8 cdboot.S
--- stand/cdboot/cdboot.S 3 May 2008 13:07:31 -0000 1.8
+++ stand/cdboot/cdboot.S 23 Oct 2009 22:12:50 -0000
@@ -47,6 +47,9 @@
#define PVD_ADDR 0x1000 /* Where Primary VD is loaded */
#define ROOTDIR_ADDR 0x1800 /* Where Root Directory is loaded */
#define LOADER_ADDR SECONDARY_LOAD_ADDRESS
+#define SEGMENT_SIZE 0x10000
+#define MAX_NBLOCK (SEGMENT_SIZE / BLOCK_SIZE)
+#define NEXT_SEGMENT (SEGMENT_SIZE >> 4)
#ifdef BOOT_FROM_FAT
#define MBR_AFTERBPB 90 /* BPB size in FAT32 partition BR */
@@ -297,16 +300,33 @@
*/
read_sectors:
pusha
- movl %eax, edd_lba /* Convert LBA to segment */
shrl $4, %ebx
+read_again:
+ movl %eax, edd_lba /* Convert LBA to segment */
movw %bx, edd_segment
+ pushl %eax
+ push %bx
+ push %dx
+ cmpb $MAX_NBLOCK, %dh
+ jle 1f
+ movb $MAX_NBLOCK, %dh
+1:
movb %dh, edd_nsecs
movb boot_drive, %dl
movw $edd_packet, %si
-read_again:
movb $0x42, %ah
int $0x13
+ pop %dx
+ pop %bx
+ popl %eax
jc read_fail
+ cmpb $MAX_NBLOCK, %dh
+ jle 2f
+ subb $MAX_NBLOCK, %dh
+ addl $MAX_NBLOCK, %eax
+ addw $NEXT_SEGMENT, %bx
+ jmp read_again
+2:
popa
ret
read_fail:
---
Izumi Tsutsui
From: David Laight <dsl@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/42202 CVS commit: src/sys/arch/i386/stand/cdboot
Date: Sat, 24 Oct 2009 11:23:07 +0000
Module Name: src
Committed By: dsl
Date: Sat Oct 24 11:23:07 UTC 2009
Modified Files:
src/sys/arch/i386/stand/cdboot: cdboot.S
Log Message:
Support reading /boot > 64k. Based on the patch from Izumi Tsutsui.
Compiles but not actually tested! Fixes PR/42202
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/cdboot/cdboot.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: feedback->closed
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Sat, 24 Oct 2009 13:01:26 +0000
State-Changed-Why:
cdboot (also known as bootxx_cd9660) will now load a /boot that exceeds 64k.
State-Changed-From-To: closed->open
State-Changed-By: dyoung@NetBSD.org
State-Changed-When: Mon, 02 Nov 2009 18:30:35 +0000
State-Changed-Why:
Booting from ISO9660 is still broken.
Let's hear some positive feedback before closing this one, ok?
State-Changed-From-To: open->feedback
State-Changed-By: dyoung@NetBSD.org
State-Changed-When: Mon, 02 Nov 2009 18:31:03 +0000
State-Changed-Why:
Waiting for feedback.
From: <kosaki_kt@ybb.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: jmcneill@NetBSD.org, netbsd-bugs@netbsd.org, gnats-admin@netbsd.org,
dyoung@NetBSD.org, kosaki_kt@ybb.ne.jp
Subject: Re: install/42202 (boot installcd fails ((amd64/i386))
Date: Tue, 3 Nov 2009 13:11:31 +0900 (JST)
--- dyoung@NetBSD.org wrote:
> Synopsis: boot installcd fails ((amd64/i386)
>
> State-Changed-From-To: open->feedback
> State-Changed-By: dyoung@NetBSD.org
> State-Changed-When: Mon, 02 Nov 2009 18:31:03 +0000
> State-Changed-Why:
> Waiting for feedback.
>
>
>
>
With sources OCT 16 and new cdboot.S (v 1.11 2009/10/24 12:57:17 dsl Exp)
build installcd (i386/amd64 )
size of /usr/mdec/boot is 65628
and boot successfully with s-ata cd drive
Responsible-Changed-From-To: jmcneill->dyoung
Responsible-Changed-By: tsutsui@NetBSD.org
Responsible-Changed-When: Mon, 09 Nov 2009 01:56:02 +0900
Responsible-Changed-Why:
Assign to a person who wanted more confirmation.
State-Changed-From-To: feedback->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Mon, 09 Nov 2009 01:56:02 +0900
State-Changed-Why:
Close again after double-check.
From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/42202 CVS commit: src/sys/arch/i386/stand/boot
Date: Sat, 11 Sep 2010 12:43:54 +0000
Module Name: src
Committed By: tsutsui
Date: Sat Sep 11 12:43:54 UTC 2010
Modified Files:
src/sys/arch/i386/stand/boot: Makefile.boot
Log Message:
Enable SUPPORT_EXT2FS. Tested on i386 that has root on ext2fs
with 128 byte and 256 byte inode sizes on QEMU.
Note for netbsd-5, this also requires HEAP_START=0x30000
as applied in rev 1.37, and this might also get another limit
on cdboot as described in PR install/42202.
To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/stand/boot/Makefile.boot
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.