Subject: Re: restorecd, fdisk problems on cobalt
To: None <port-cobalt@netbsd.org>
From: Eric Auge <eau@phear.org>
List: port-cobalt
Date: 12/30/2007 09:57:11
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig9D12E3E0995E3F0C556A5BF8
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Izumi Tsutsui wrote:
> eau@phear.org wrote:
>=20
>> Well for now the cd boot i've changed install.sh to do ${SH} -i
>> in order to have a shell prompt, so they are executing correctly
>> at boot.. if I made errors, I will be able to correct easily.
>=20
> Diff of install-core.sh might help.
>=20
>> # dd if=3D/dev/zero of=3D/dev/rwd0d count=3D1
>> 1+0 records in
>> 1+0 records out
>> 512 bytes transferred in 0.003 secs (170666 bytes/sec)
>> # fdisk -S /dev/wd0
>> [1]   Trace/BPT trap          fdisk -S /dev/wd0
>> #
>>
>> Still not good, MBR cleaned, but still crashing..
>>
>> what else could it be?
>=20
> Hmm, You could try
> - fdisk wd0  (not /dev/wd0)
> - fdisk -S wd0  (not /dev/wd0)
> - fdisk -S -b 1024/255/63 wd0
> - fdisk -0 -u -f -b 1024/255/63 -s 0/0/0 wd0
> - fdisk -v -0 -u -f -b 1024/255/63 -s 0/0/0 wd0
> etc?
>=20
> (fdisk(8) man page description for -b, -f and -u seems inconsistent..)
>=20
>>> fdisk(8) seems problematic on non-x86 ports (which don't have BIOS va=
lues),
>>> but I have not tracked what triggers it.
>> I try to look at fdisk srcs ... any starting point is welcome anyway.
>=20
> I guess the problem is in intuit_translated_geometry()
> and get_mapping() in src/sbin/fdisk/fdisk.c.
> Maybe we should add some sanity checks if each parameter
> read from disk isn't zero, but sprinkling printf()s there
> might help to track the problem.

# ./usr/bin/gdb /sbin/fdisk
GNU gdb 5.3nb1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you =
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for detail=
s.
This GDB was configured as "mipsel--netbsd"...(no debugging symbols
found)...
(gdb) run -S wd0
Starting program: /sbin/fdisk -S wd0
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00402cc4 in intuit_translated_geometry ()
(gdb) bt
#0  0x00402cc4 in intuit_translated_geometry ()
#1  0x00407580 in main ()
#2  0x00401628 in _start ()
(gdb)

good catch! :)

I'm trying to go further...

> ---
> Izumi Tsutsui
>=20
Eric.


--------------enig9D12E3E0995E3F0C556A5BF8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHd11rSdZNA80H8MYRAhdWAKCTPJGO74HPIafI2rmWpah3pd815QCeK9Gv
nu8s66ryKVlufeM89b0uOiI=
=2KrZ
-----END PGP SIGNATURE-----

--------------enig9D12E3E0995E3F0C556A5BF8--