From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: Using grub on fuloong 6004
Date: Sun, 24 Jul 2011 13:36:43 +0200 [thread overview]
Message-ID: <4E2C03CB.1000900@gmail.com> (raw)
In-Reply-To: <87fwlwx827.fsf@snail.Pool>
[-- Attachment #1.1: Type: text/plain, Size: 1820 bytes --]
> Now grub comes up and displays a prompt, but not a menu. Keyboard
> doesn't work however, so I cannot do anything with grub yet.
>
You can use the serial
> I tried to re-run grub-mkimage with module 'usb_keyboard' and 'ahci'
> added, but that didn't help, keyboard still not working:
>
usb_keyboard was obviously missing so I thought you use serial. Fuloong
neither uses nor implements AHCI.
> sudo grub-mkimage --config=/boot/grub.elf.conf
> --output=/boot/grub4-4k.elf --format=mipsel-fuloong-elf --verbose ata
> pata part_msdos ext2 reboot halt lspci ohci ahci usbtest usbms linux fat
> xfs part_gpt multiboot2 minicmd configfile gcry_md5 hashsum usb_keyboard
>
> grub.elf.conf:
>
> set root=pata0,msdos1
> set prefix=($root)/grub
Only module was renamed. Not the names of disks. You can achieve same
result much more easily with -p '(ata0,msdos1)/grub'
> I also ran 'grub-install' once, which put a full set of grub modules to
> /boot/grub. However, it failed to generate a grub image and complained:
>
> $ sudo /usr/local/sbin/grub-install
> /usr/local/bin/grub-mkimage: error: cannot stat /usr/local/lib/grub/mipsel-loongson/uhci.mod.
>
Fix attached
> according to lsusb, my keyboard is a
>
> Bus 002 Device 003: ID 0b51:0020 Comfort Keyboard Co. Comfort Keyboard
>
> , connected to the top-right usb slot. Other than that only a usb-mouse
> is also connected. No hubs or other advanced usb-hardware.
Can you try w/o mouse? Can you try with hotplugging keyboard rather than
having one on boot?
> Any ideas what's wrong now?
>
> cheers,
>
> David
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: uhci.diff --]
[-- Type: text/x-diff; name="uhci.diff", Size: 2909 bytes --]
=== 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_size);
}
}
@@ -170,6 +171,21 @@
else
dev->size = grub_le_to_cpu64(*((grub_uint64_t *) &info16[100]));
+ if (info16[106] & (1 << 12))
+ {
+ grub_uint32_t secsize;
+ secsize = grub_le_to_cpu32 (*((grub_uint32_t *) &info16[117]));
+ if (secsize & (secsize - 1) || !secsize
+ || secsize > 1048576)
+ secsize = 256;
+ for (dev->log_sector_size = 0;
+ (1U << dev->log_sector_size) < secsize;
+ dev->log_sector_size++);
+ dev->log_sector_size++;
+ }
+ else
+ dev->log_sector_size = 9;
+
/* Read CHS information. */
dev->cylinders = info16[1];
dev->heads = info16[3];
@@ -314,7 +330,7 @@
grub_ata_setaddress (ata, &parms, sector, batch, addressing);
parms.taskfile.cmd = (! rw ? cmd : cmd_write);
parms.buffer = buf;
- parms.size = batch * GRUB_DISK_SECTOR_SIZE;
+ parms.size = batch << ata->log_sector_size;
parms.write = rw;
if (ata->dma)
parms.dma = 1;
@@ -322,9 +338,9 @@
err = ata->dev->readwrite (ata, &parms, 0);
if (err)
return err;
- if (parms.size != batch * GRUB_DISK_SECTOR_SIZE)
+ if (parms.size != batch << ata->log_sector_size)
return grub_error (GRUB_ERR_READ_ERROR, "incomplete read");
- buf += GRUB_DISK_SECTOR_SIZE * batch;
+ buf += batch << ata->log_sector_size;
sector += batch;
nsectors += batch;
}
@@ -433,6 +449,7 @@
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not an ATA harddisk");
disk->total_sectors = ata->size;
+ disk->log_sector_size = ata->log_sector_size;
disk->id = grub_make_scsi_id (id, bus, 0);
=== 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 @@
/* Sector count. */
grub_uint64_t size;
+ grub_uint32_t log_sector_size;
/* CHS maximums. */
grub_uint16_t cylinders;
=== modified file 'util/grub-install.in'
--- util/grub-install.in 2011-07-10 14:06:31 +0000
+++ util/grub-install.in 2011-07-24 11:35:39 +0000
@@ -504,7 +504,11 @@
fi
if [ "x$disk_module" = xnative ]; then
- disk_module="pata ahci ohci uhci usbms"
+ disk_module="pata ahci ohci"
+ if [ "x$target_cpu" = "xi386" ] || [ "x$target_cpu" = "xx86_64" ]; then
+ disk_module="$disk_module uhci"
+ fi
+ disk_module="$disk_module usbms"
fi
# The order in this list is critical. Be careful when modifying it.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
next prev parent reply other threads:[~2011-07-24 11:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-23 11:11 Using grub on fuloong 6004 David Kuehling
2011-07-23 12:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-07-23 13:11 ` David Kuehling
2011-07-23 13:53 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-07-23 16:22 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-07-24 10:54 ` David Kuehling
2011-07-24 11:36 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2011-07-24 12:54 ` David Kuehling
2011-07-25 0:43 ` Vladimir 'φ-coder/phcoder' Serbinenko
2011-07-25 21:46 ` David Kuehling
2011-09-29 8:58 ` Vladimir 'φ-coder/phcoder' Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E2C03CB.1000900@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.