From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1PWTOb-0007dn-LQ for mharc-grub-devel@gnu.org; Sat, 25 Dec 2010 07:38:49 -0500 Received: from [140.186.70.92] (port=49948 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PWTOZ-0007di-RW for grub-devel@gnu.org; Sat, 25 Dec 2010 07:38:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PWTOY-0005e8-EB for grub-devel@gnu.org; Sat, 25 Dec 2010 07:38:47 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:62901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PWTOY-0005e1-7K for grub-devel@gnu.org; Sat, 25 Dec 2010 07:38:46 -0500 Received: by wyj26 with SMTP id 26so7772649wyj.0 for ; Sat, 25 Dec 2010 04:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=Fjl/F5BlWdHvxJSb4Ddx6zvaAsd9ahEP9vaFANexQP4=; b=KYIIYbEtpcJUaurJe9x14lXbAOrQk4eUnLUji3F20o6dtm5V5se/3OCVh2tTSAZfg7 /zQDqs3/uP9unUgl0HP78sEBWa6wvnWipuXZnhRprR4JeWcQ++1dyRsIhyFEBnRGpD35 FsTR4kQmb+B5d7OZ7xsuo96w0oSSfjQYaBgpw= DomainKey-Signature: a=rsa-sha1; c=nofws; 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; b=rcBgWEJ7rM0ot9ZITAlRfCOHLPloNnuA4mODZorf55J3hLrwFQL0LQKLuhgsbYxusj Jg1QNK/sGMGirdsrJrpQONzvvQ6LNxcOr2lAgp5vWqYzBfpKl9lXFtHpb9Ehl1jBxtgQ BdAs0olZYDqodgV8/wajgQi2/W8EO2Vwg4yQA= Received: by 10.227.134.10 with SMTP id h10mr6309205wbt.118.1293280723569; Sat, 25 Dec 2010 04:38:43 -0800 (PST) Received: from debian.bg45.phnet (12-131.62-81.cust.bluewin.ch [81.62.131.12]) by mx.google.com with ESMTPS id m10sm6877877wbc.10.2010.12.25.04.38.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 25 Dec 2010 04:38:42 -0800 (PST) Message-ID: <4D15E5C9.8000501@gmail.com> Date: Sat, 25 Dec 2010 13:38:33 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101211 Icedove/3.0.11 MIME-Version: 1.0 To: grub-devel@gnu.org References: <4D0FB8A2.5060407@gmail.com> In-Reply-To: <4D0FB8A2.5060407@gmail.com> X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig9B76EA77A4C40A88AAA3665A" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: USB bulk transfert from GRUB ? X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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, 25 Dec 2010 12:38:49 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9B76EA77A4C40A88AAA3665A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/20/2010 09:12 PM, Nicolas de Peslo=C3=BCan wrote: > Hi, > > Some USB devices require a specific command to be sent (using USB bulk > transfer) before they switch > to "storage mode". Such devices are switched by USBmodeSwitch > (http://www.draisberghof.de/usb_modeswitch/), after the operating > system start. USBmodeSwitch use > libusb to send the right command to the right USB endpoint, depending > on the ID of the USB device. > > In order to be able to boot from such devices, one needs to switch the > device early, before the operating system is started. I think GRUB2 > should be the right place for this. > > For as far as I understand, libusb is available from inside GRUB2,=20 No it's not. We use our own routines for USB transfers. Have a look at include/grub/usb.h. E.g: grub_usb_err_t grub_usb_bulk_write (grub_usb_device_t dev, int endpoint, grub_size_t size, char *data); > so it shouldn't be really difficult to add a command to initiate a > given bulk transfert to a given USB endpoint. (My understanding is > that no such command already exists). grub_usb_bulk_write does exactly this. However it's not to be exported as a command > > Contrary to USBModeSwitch that use a database at runtime to decide how > to switch the device, it is probably easier to decide this at > grub-mkconfig time, using the same database. > Doing any USB detection at grub-mkconfig time is a bad idea. USB is in flux and you can't possibly know e.g. the address of target device on runtime. On the other hand it should be easy to write a parser for device_reference.txt. It's also probably easier to write something that small from scratch than to port it (all the value is in the database, not code). Another question is how much autoconfigured it should be. Some people may prefer these devices be in non-storage mode as usually the only thing they store are useless buggy drivers. > Of course, I perfectly understand that the first part of GRUB2 cannot > be located from this kind of USB devices, because it needs to be > loaded before GRUB2 start, and we would face a chicken and egg problem.= > > Any comments ? > > Nicolas. > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig9B76EA77A4C40A88AAA3665A 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.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk0V5ckACgkQNak7dOguQgnHyAD+KIlW3OmIncYQse6Lvb7toVr+ A4ACs0obpt0SF9npqSUA/0VXBzF7jk24Cb/T7v8hDRNrPodiG2MRGI1bfCVT1iMQ =zjTM -----END PGP SIGNATURE----- --------------enig9B76EA77A4C40A88AAA3665A--