Subject: port-i386/17003: Bootblock heap too small
To: None <gnats-bugs@gnats.netbsd.org>
From: None <scotte@warped.com>
List: netbsd-bugs
Date: 05/24/2002 16:23:55
>Number:         17003
>Category:       port-i386
>Synopsis:       Booting runs out of heap
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 24 09:25:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Scott Ellis
>Release:        NetBSD 1.5ZC
>Organization:
   //////////////////////////////////////////////////////////////////////
  //    Scott Ellis     //             scotte@warped.com              //
 //////////////////////////////////////////////////////////////////////
// WARNING: This signature warps  time and space in its vicinity    //
>Environment:
	
	
System: NetBSD intrepid 1.5ZC NetBSD 1.5ZC (INTREPID) #0: Sun Apr 28 08:40:36 PDT 2002 scotte@intrepid:/misc/localsrc/netbsd/netbsd_cvs_src/src/sys/arch/i386/compile/INTREPID i386
Architecture: i386
Machine: i386
>Description:
	
Booting with the April28th -current bootblock_com0 (or bootblock) results in
an error when accessing the partition (via "dir", or when typing "boot").  The
error reported (sorry, didn't copy down the exact error) was basically an "out
of space" error, and referenced things such as "(heap+49533)".

Increasing the defined heap size in the i386 makefile from 5000 to 10000 solved
the problem for me (t'was a shot in the dark, but it worked).

In particular, this happened when attempting to boot on a 120G EIDE drive
installed on an ATA/100 PCI controller.

# /dev/rwd0d:
type: ESDI
disk: WDC WD1200JB-75C
label: fictitious
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 16383
total sectors: 234375000
rpm: 7200
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

6 partitions:
#        size    offset     fstype  [fsize bsize cpg/sgs]
 a:   6144768         0     4.2BSD   8192 65536  4272   # (Cyl.    0 - 6095)
 b:    525168   6144768       swap                      # (Cyl. 6096 - 6616)
 d: 234375000         0     unused      0     0         # (Cyl.    0 - 232514*)
 e:   2048256   6669936     4.2BSD   4096  8192   181   # (Cyl. 6617 - 8648)
 f: 225656808   8718192     4.2BSD   8192 65536  4128   # (Cyl. 8649 - 232514*)

pciide1 at pci0 dev 11 function 0: Promise Ultra100/ATA Bus Master IDE Accelerat
or (rev. 0x02)
pciide1: bus-master DMA support present
pciide1: primary channel configured to native-PCI mode
pciide1: using irq 11 for native-PCI interrupt
wd0 at pciide1 channel 0 drive 0: <WDC WD1200JB-75CRA0>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 111 GB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 234375000 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA data
 transfers)
pciide1: secondary channel configured to native-PCI mode
pciide1: disabling secondary channel (no drives)

>How-To-Repeat:
	
Install the bootblock, and try and boot. ;-)
>Fix:
	
In /usr/src/sys/arch/i386/stand/biosboot/Makefile, change the line:

SAMISCCPPFLAGS+= -DHEAP_START=0x20000 -DHEAP_LIMIT=0x50000

to

SAMISCCPPFLAGS+= -DHEAP_START=0x20000 -DHEAP_LIMIT=0x100000
>Release-Note:
>Audit-Trail:
>Unformatted: