From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Qkey7-00086X-CY for mharc-grub-devel@gnu.org; Sat, 23 Jul 2011 12:22:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]:51046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkey4-00086R-9m for grub-devel@gnu.org; Sat, 23 Jul 2011 12:22:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qkey2-0001zS-Rr for grub-devel@gnu.org; Sat, 23 Jul 2011 12:22:20 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:55924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkey2-0001zO-HQ for grub-devel@gnu.org; Sat, 23 Jul 2011 12:22:18 -0400 Received: by wwf22 with SMTP id 22so2415548wwf.30 for ; Sat, 23 Jul 2011 09:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; bh=rECIbei4UavKbT4TR7yOSPIiDXM+ltLE4E5/QqXQXp8=; b=qvBnRxLXiQk8f/DZWCRy8KzZp2+dn8LljR4I/D3LflNWk7mb0cIybScFYueRZYDiTg eSFecvfiYBGpn8ELQDhwS29kGLVPmq1/KsgrtrbzavqOrEcOG2QMEh30uXF8Pm+o4XOL 74vUbgyakl1u6vR+HRPn3PTNEZJUC2SoXWBrg= Received: by 10.216.62.195 with SMTP id y45mr2624929wec.15.1311438137518; Sat, 23 Jul 2011 09:22:17 -0700 (PDT) Received: from debian.x201.phnet (154-76.62-81.cust.bluewin.ch [81.62.76.154]) by mx.google.com with ESMTPS id m46sm2248463weq.29.2011.07.23.09.22.15 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Jul 2011 09:22:16 -0700 (PDT) Message-ID: <4E2AF535.6090500@gmail.com> Date: Sat, 23 Jul 2011 18:22:13 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110626 Iceowl/1.0b2 Icedove/3.1.11 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: Using grub on fuloong 6004 References: <87sjpxuu9j.fsf@snail.Pool> <4E2AB7C1.5070305@gmail.com> <87oc0luope.fsf@snail.Pool> In-Reply-To: <87oc0luope.fsf@snail.Pool> X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig002698F22C8FE4BFFFA9CE57" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2011 16:22:21 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig002698F22C8FE4BFFFA9CE57 Content-Type: multipart/mixed; boundary="------------020303050807060509030800" This is a multi-part message in MIME format. --------------020303050807060509030800 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 23.07.2011 15:11, David Kuehling wrote: >>>>>> "Vladimir" =3D=3D Vladimir '=CF=86-coder/phcoder' Serbinenko writes: >>> sudo grub-mkimage --config=3D/boot/grub.elf.conf \ >>> --output=3D/boot/grub3.elf --format=3Dmipsel-fuloong-elf --verbose \ = ata >>> part_msdos ext2 reboot halt lspci ohci usbtest usbms linux \ fat xfs >>> part_gpt multiboot2 minicmd configfile gcry_md5 hashsum >>> >> ata was renamed to pata. > Just recreated my grub.elf with ata in the grub.elf.conf replaced by > pata, plus 'pata' module added to the grub-mkimage command line. > > Now the grub blanks the screen and hangs when loaded from pmon. > I've fixed 2 regressions in trunk. > Maybe I should add that I'm using a 750GB hard-disk with 4k sectors in > my Fuloong. Could that be a problem? It's neigher a problem for pmon > nor for linux, though. I'm attaching a patch which should add the support for 4K sectors with AT= A. > cheers, > > David > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------020303050807060509030800 Content-Type: text/x-diff; name="4Kata.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="4Kata.diff" =3D=3D=3D modified file 'grub-core/disk/ata.c' --- grub-core/disk/ata.c 2011-07-07 19:46:25 +0000 +++ grub-core/disk/ata.c 2011-07-23 16:17:06 +0000 @@ -57,6 +57,7 @@ { grub_dprintf ("ata", "Addressing: %d\n", dev->addr); grub_dprintf ("ata", "Sectors: %lld\n", (unsigned long long) dev->= size); + grub_dprintf ("ata", "Sector size: %u\n", 1U << dev->log_sector_si= ze); } } =20 @@ -170,6 +171,21 @@ else dev->size =3D grub_le_to_cpu64(*((grub_uint64_t *) &info16[100])); =20 + if (info16[106] & (1 << 12)) + { + grub_uint32_t secsize; + secsize =3D grub_le_to_cpu32 (*((grub_uint32_t *) &info16[117])); + if (secsize & (secsize - 1) || !secsize + || secsize > 1048576) + secsize =3D 256; + for (dev->log_sector_size =3D 0; + (1U << dev->log_sector_size) < secsize; + dev->log_sector_size++); + dev->log_sector_size++; + } + else + dev->log_sector_size =3D 9; + /* Read CHS information. */ dev->cylinders =3D info16[1]; dev->heads =3D info16[3]; @@ -314,7 +330,7 @@ grub_ata_setaddress (ata, &parms, sector, batch, addressing); parms.taskfile.cmd =3D (! rw ? cmd : cmd_write); parms.buffer =3D buf; - parms.size =3D batch * GRUB_DISK_SECTOR_SIZE; + parms.size =3D batch << ata->log_sector_size; parms.write =3D rw; if (ata->dma) parms.dma =3D 1; @@ -322,9 +338,9 @@ err =3D ata->dev->readwrite (ata, &parms, 0); if (err) return err; - if (parms.size !=3D batch * GRUB_DISK_SECTOR_SIZE) + if (parms.size !=3D batch << ata->log_sector_size) return grub_error (GRUB_ERR_READ_ERROR, "incomplete read"); - buf +=3D GRUB_DISK_SECTOR_SIZE * batch; + buf +=3D batch << ata->log_sector_size; sector +=3D batch; nsectors +=3D batch; } @@ -433,6 +449,7 @@ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not an ATA harddisk"); =20 disk->total_sectors =3D ata->size; + disk->log_sector_size =3D ata->log_sector_size; =20 disk->id =3D grub_make_scsi_id (id, bus, 0); =20 =3D=3D=3D modified file 'include/grub/ata.h' --- include/grub/ata.h 2011-07-07 10:21:53 +0000 +++ include/grub/ata.h 2011-07-23 15:38:46 +0000 @@ -170,6 +170,7 @@ =20 /* Sector count. */ grub_uint64_t size; + grub_uint32_t log_sector_size; =20 /* CHS maximums. */ grub_uint16_t cylinders; --------------020303050807060509030800-- --------------enig002698F22C8FE4BFFFA9CE57 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.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk4q9TUACgkQNak7dOguQglCmAEAlgjGpVU7Eco+giLtD/6oPbGt 2l5zW2++GrfLFA12owIA/iQttEByspEgRb3Fo6nUnMCeAWbk2Ga2qoiZZqFZFzuD =FtHW -----END PGP SIGNATURE----- --------------enig002698F22C8FE4BFFFA9CE57--