GP2X How To Use Usb Gadget With Xp And Gp2x 2.0.0


crusty

Still Fresh
Joined
Jan 2, 2006
Messages
64
Location
Barbados, West Indies
Website
Visit site
I hope someone with the ability will add this to the wiki at
http://wiki.gp2x.org/wiki/Development_Tutorials in the Hardware section.

Gp2x How-to Use USB Gadget with MS-Window XP and Firmware 2.0.0
---------------------------------------------------------------------------------

Based on the message written by scorpio on 30 April 2006 at
http://www.gp32x.de/board/index.php?showtopic=27647&st=210

The following instructions were used to establish an ethernet
type connection over the standard USB cable attached between
a Gp2x and a PC running MS-Windows XP Home version 2002 SP2.

If you use a version of MS-Windows 2000 it is possible you do not
have the drivers and they can be downloaded from:

http://www.microsoft.com/whdc/device/network/NDIS/rndis.mspx


Step Description
---- ---------------------------------------------------
1. Plug in the standard USB cable to the Gp2x and PC.

2. Turn on the Gp2x and the PC.

3. On the Gp2x, select Setting from the main screen and
System from the second screen.

4. Use the Joypad to move down the displayed list until
"USB Network" is highlighted. This item is not displayed
when the list is first shown and you must scroll down
several times to select it.

5. Use the Joypad left-right arrows to select either "ON"
or "ALWAYS ON".

6. Use the Joypad to move down to the IP entry fields.

7. Use the "Y" key to cycle through the first number values
until "10" is shown.

8. Use the Joypad to move right to the second number and
the "Y" key to cycle through number values until "1" is
shown.

9. Repeat steps 7 and 8 for the third and fourth numbers,
specifying values of "0" and "235" .

The IP address value should appear as 10.1.0.235 if steps
7 to 9 are done correctly.

10. Move down to the FTP, Telnet Server entry and select "ON"
or "ALWAYS ON".

Press the "B" key to exit from the System screen, letting
the Gp2x start its servers.

11. MS-Windows XP should detect the network connection in a
few seconds and report it above the Start bar.

12. If XP reports it does not have a driver for the device then
copy the text at the bottom of this instruction into a text
file named "linux.inf" and save in a suitable directory/folder.

13. When XP prompts to install a new driver, choose to manually
install from a known location. Enter the name of the
directory/folder into which "linux.inf" was stored.

14. Wait the several seconds for the install to complete.

15. By default, XP will configure the new network connection
to find its IP address automatically (from a DHCP server).
This needs to be changed to a fixed value in the same
subnet mask range as that specified on the Gp2x.

16. Use the Start menu - Control Panel - Network Connections tab.

17. Find the line with Device Name "Linux USB Ethernet / RNDIS..."
and select the "Local Area Network Connection X" text, then
select File - Properties from the main menu to open the
Properties dialog.

18. In the box titled "This connection uses the following items:"
select "Internet Protocol (TCP/IP)" and click on the Properties
button below this box.

19. Choose "Use the following IP address" and enter "10.1.0.234".
NOTE: this IP address must be different from that given in points
7 to 10 but in the same subnet mask range. If the subnet mask is
specified as in the next instruction then only the first number (10)
must be identical to that assigned to the Gp2x.

20. Enter the Subnet mask as "255.0.0.0".

21. Press OK to close this dialog box and OK to close the second
dialog box.

22. Observe the Network Connections Status value should change to
"Connected", and may include "Firewalled".

23. The two devices are now communicating over the USB ethernet.

24. On the PC, choose "Start Menu - Run" and enter "telnet" at the
prompt. A dosbox will appear with the telnet application.

25. Use the telnet command: "open 10.1.0.235" to get to a login
prompt. Enter the User as "root". This user does not require
a password. If prompted for a password then press <enter>.

26. The bash shell will present its prompt and you have terminal
access to the Gp2x.

27. Use standard GNU/Linux commands at the shell prompt.

28. Type "logout" to exit from the shell.

29. Type "quit" to exit from telnet.

30. Type "exit" to exit from the Command line prompt.

31. The Windows XP version of the FTP client has problems with the
Windows Firewall so you will need another FTP client program to
do file transfers if you see a message referring to PORT/EPRT and
PASV/EPSV or "no data connection". LeapFTP is a commercial program
that seems to work well (http://www.leapware.com). There are others.


* * * End of How-to Use USB Gadget with MS-Window XP and Firmware 2.0.0

;----------- begin linux.inf ----------------------
; MS-Windows driver config matching some basic modes of the
; Linux-USB Ethernet/RNDIS gadget firmware:
;
; - RNDIS plus CDC Ethernet ... this may be familiar as a DOCSIS
; cable modem profile, and supports most non-Microsoft USB hosts
;
; - RNDIS plus CDC Subset ... used by hardware that incapable of
; full CDC Ethernet support.
;
; Microsoft only directly supports RNDIS drivers, and bundled them into XP.
; The Microsoft "Remote NDIS USB Driver Kit" is currently found at:
; http://www.microsoft.com/whdc/hwdev/resour...ices/rndis.mspx


[Version]
Signature = "$CHICAGO$"
Class = Net
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %Linux%
Compatible = 1
MillenniumPreferred = .ME
DriverVer = 03/30/2004,0.0.0.0
; catalog file would be used by WHQL
;CatalogFile = Linux.cat

[Manufacturer]
%Linux% = LinuxDevices,NT.5.1

[LinuxDevices]
; NetChip IDs, used by both firmware modes
%LinuxDevice% = RNDIS, USB\VID_0525&PID_a4a2

[LinuxDevices.NT.5.1]
%LinuxDevice% = RNDIS.NT.5.1, USB\VID_0525&PID_a4a2

[ControlFlags]
ExcludeFromSelect=*

; Windows 98, Windows 98 Second Edition specific sections --------

[RNDIS]
DeviceID = usb8023
MaxInstance = 512
DriverVer = 03/30/2004,0.0.0.0
AddReg = RNDIS_AddReg_98, RNDIS_AddReg_Common

[RNDIS_AddReg_98]
HKR, , DevLoader, 0, *ndis
HKR, , DeviceVxDs, 0, usb8023.sys
HKR, NDIS, LogDriverName, 0, "usb8023"
HKR, NDIS, MajorNdisVersion, 1, 5
HKR, NDIS, MinorNdisVersion, 1, 0
HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5"
HKR, Ndi\Interfaces, DefLower, 0, "ethernet"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_98"
HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_98"
HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_98"
HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2"

[RNDIS_Install_98]
CopyFiles=RNDIS_CopyFiles_98

[RNDIS_CopyFiles_98]
usb8023.sys, usb8023w.sys, , 0
rndismp.sys, rndismpw.sys, , 0

; Windows Millennium Edition specific sections --------------------

[RNDIS.ME]
DeviceID = usb8023
MaxInstance = 512
DriverVer = 03/30/2004,0.0.0.0
AddReg = RNDIS_AddReg_ME, RNDIS_AddReg_Common
Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
BusType = 15

[RNDIS_AddReg_ME]
HKR, , DevLoader, 0, *ndis
HKR, , DeviceVxDs, 0, usb8023.sys
HKR, NDIS, LogDriverName, 0, "usb8023"
HKR, NDIS, MajorNdisVersion, 1, 5
HKR, NDIS, MinorNdisVersion, 1, 0
HKR, Ndi\Interfaces, DefUpper, 0, "ndis3,ndis4,ndis5"
HKR, Ndi\Interfaces, DefLower, 0, "ethernet"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis3,ndis4,ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
HKR, Ndi\Install, ndis3, 0, "RNDIS_Install_ME"
HKR, Ndi\Install, ndis4, 0, "RNDIS_Install_ME"
HKR, Ndi\Install, ndis5, 0, "RNDIS_Install_ME"
HKR, Ndi, DeviceId, 0, "USB\VID_0525&PID_a4a2"

[RNDIS_Install_ME]
CopyFiles=RNDIS_CopyFiles_ME

[RNDIS_CopyFiles_ME]
usb8023.sys, usb8023m.sys, , 0
rndismp.sys, rndismpm.sys, , 0

; Windows 2000 specific sections ---------------------------------

[RNDIS.NT]
Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
BusType = 15
DriverVer = 03/30/2004,0.0.0.0
AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common
CopyFiles = RNDIS_CopyFiles_NT

[RNDIS.NT.Services]
AddService = USB_RNDIS, 2, RNDIS_ServiceInst_NT, RNDIS_EventLog

[RNDIS_CopyFiles_NT]
; no rename of files on Windows 2000, use the 'k' names as is
usb8023k.sys, , , 0
rndismpk.sys, , , 0

[RNDIS_ServiceInst_NT]
DisplayName = %ServiceDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\usb8023k.sys
LoadOrderGroup = NDIS
AddReg = RNDIS_WMI_AddReg_NT

[RNDIS_WMI_AddReg_NT]
HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismpk.sys"

; Windows XP specific sections -----------------------------------

[RNDIS.NT.5.1]
Characteristics = 0x84 ; NCF_PHYSICAL + NCF_HAS_UI
BusType = 15
DriverVer = 03/30/2004,0.0.0.0
AddReg = RNDIS_AddReg_NT, RNDIS_AddReg_Common
; no copyfiles - the files are already in place

[RNDIS.NT.5.1.Services]
AddService = USB_RNDIS, 2, RNDIS_ServiceInst_51, RNDIS_EventLog

[RNDIS_ServiceInst_51]
DisplayName = %ServiceDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\usb8023.sys
LoadOrderGroup = NDIS
AddReg = RNDIS_WMI_AddReg_51

[RNDIS_WMI_AddReg_51]
HKR, , MofImagePath, 0x00020000, "System32\drivers\rndismp.sys"

; Windows 2000 and Windows XP common sections --------------------

[RNDIS_AddReg_NT]
HKR, Ndi, Service, 0, "USB_RNDIS"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"

[RNDIS_EventLog]
AddReg = RNDIS_EventLog_AddReg

[RNDIS_EventLog_AddReg]
HKR, , EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\netevent.dll"
HKR, , TypesSupported, 0x00010001, 7

; Common Sections -------------------------------------------------

[RNDIS_AddReg_Common]
HKR, NDI\params\NetworkAddress, ParamDesc, 0, %NetworkAddress%
HKR, NDI\params\NetworkAddress, type, 0, "edit"
HKR, NDI\params\NetworkAddress, LimitText, 0, "12"
HKR, NDI\params\NetworkAddress, UpperCase, 0, "1"
HKR, NDI\params\NetworkAddress, default, 0, " "
HKR, NDI\params\NetworkAddress, optional, 0, "1"

[SourceDisksNames]
1=%SourceDisk%,,1

[SourceDisksFiles]
usb8023m.sys=1
rndismpm.sys=1
usb8023w.sys=1
rndismpw.sys=1
usb8023k.sys=1
rndismpk.sys=1

[DestinationDirs]
RNDIS_CopyFiles_98 = 10, system32/drivers
RNDIS_CopyFiles_ME = 10, system32/drivers
RNDIS_CopyFiles_NT = 12

[Strings]
ServiceDisplayName = "USB Remote NDIS Network Device Driver"
NetworkAddress = "Network Address"
Linux = "Linux Developer Community"
LinuxDevice = "Linux USB Ethernet/RNDIS Gadget"
SourceDisk = "Ethernet/RNDIS Gadget Driver Install Disk"

;----------- end linux.inf ----------------------
 
Last edited by a moderator:
crusty posted on May 1 2006 at 10:28 AM said:
15. By default at XP will configure the new network connection
to find its IP address automatically (from a DHCP server).
This needs to be changed to a fixed value identical to that
specified on the Gp2x.

[...]

19. Choose "Use the following IP address" and enter "10.1.0.235".

20. Enter the Subnet mask as "255.0.0.0".

I'm glad you found my information useful, but perhaps I was a bit vague on the specifics. The PC and the GP2X should have different IP addresses. I.e., if the GP2X is configured to 10.1.0.235, then the PC will need to be configured to something else, for example, 10.1.0.1 (in my case), 10.1.0.234 or even 10.2.0.1. The important thing is that no device connected via the network should have the same IP address as any other device on the network.

Basically, because the subnet mask is set to 255.0.0.0, this means that only the first number has to be the same for the devices to be able to talk to each other. By convention, it's usually the last number you change, but this probably isn't the place to get into the nitty-gritty of network configuration. A good starting point for more information might be http://en.wikipedia.org/wiki/Subnet_mask.

The reason it works for you is probably because at the lowest levels, network devices are addressed by their MAC address (AKA "physical address"), and if you only have two devices on the physical connection, you might get away with it (actually, I'm a little surprised it does work!)

So, just to reiterate, it looks like you've written a good guide, but you just need to specify that the IP addresses of the GP2X and PC need to be different, even if it's only by one digit on the last number.
 
Last edited by a moderator:
scorpio posted on May 1 2006 at 06:10 AM said:
I'm glad you found my information useful, but perhaps I was a bit vague on the specifics. The PC and the GP2X should have different IP addresses. I.e., if the GP2X is configured to 10.1.0.235, then the PC will need to be configured to something else, for example, 10.1.0.1 (in my case), 10.1.0.234 or even 10.2.0.1. The important thing is that no device connected via the network should have the same IP address as any other device on the network.

So, just to reiterate, it looks like you've written a good guide, but you just need to specify that the IP addresses of the GP2X and PC need to be different, even if it's only by one digit on the last number.

Thanks for the review. The changes have been made as you suggest.
 
Last edited by a moderator:
Why that 'odd' IP? I've used 192.168.0.1 for my gp2x and 192.168.0.2 for the PC. My lan is on 192.168.1.*
I though 192.168 was reserved for lan's and anything else could cause probs if you have a net connection. Mind you i'm that the up on network stuff. ;)

P.s. You little nuget about the two ip's having to be different fix my probs. :) I though it had to be the same, the conections was happening but no telnet connection and samba share was showing my pc. LoL All working now, and I have to say, the new OS is fantastic!!!!!
 
crusty posted on May 1 2006 at 11:33 AM said:
Thanks for the review. The changes have been made as you suggest.
Cheers! All you need now is confirmation from someone who's needed to use it, so that it can be confirmed to be complete, and it should be good to go.
 
Last edited by a moderator:
MadDog posted on May 1 2006 at 12:05 PM said:
Why that 'odd' IP? I've used 192.168.0.1 for my gp2x and 192.168.0.2 for the PC. My lan is on 192.168.1.*
I though 192.168 was reserved for lan's and anything else could cause probs if you have a net connection. Mind you i'm that the up on network stuff. ;)

There are several ranges of addresses reserved for private LANs:

(x = any number between 0 - 255)

192.168.x.x
10.x.x.x
172.16.x.x - 172.31.x.x

(There's also 169.254.x.x, but these are reserved for automatic private IPs, such as what Windows will allocate)
 
Last edited by a moderator:
nice guide. did indeed need it. was fun to try some "real" computer stuf on my gp2x. though i tried the Xynth GUI but that was very basic but nice...(http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,8,1244)

What i realy needed was the windows driver ^^ thx
You should ad some simple lines that i didn't think of:
Dont forget to Activate the telnetserver, or what ever you are going to try.

Anyone know this device: http://www.projectblackdog.com/
seems like gp2x can be a nice basic competitor :)
 
Hi,
Jacxz posted on May 2 2006 at 09:12 PM said:
Anyone know this device: http://www.projectblackdog.com/
seems like gp2x can be a nice basic competitor :)
You might want to have a look at http://arstechnica.com/reviews/hardware/pocketserver.ars, which is where I first saw it, reviewed against a simialr solution. I don't think it's really comparable to the GP2X, as it comes across to me as being more of a black box looking for an application, rather than an end product. The GP2X has a screen, speaker and controls, which makes it more of a standalone product, whereas the BlackDog is more like a component.
 
Last edited by a moderator:
Jacxz posted on May 2 2006 at 04:12 PM said:
You should ad some simple lines that i didn't think of:
Dont forget to Activate the telnetserver, or what ever you are going to try.
The guide has been updated to include the following:

24. On the Gp2x, if not already in the Setting - System details
screen then select Setting from the main screen and System from
the second screen. Move down to the FTP, Telnet Server entry and
select "ON" or "ALWAYS ON".

On the PC, choose "Start Menu - Run" and enter "telnet" at the
prompt. A dosbox will appear with the telnet application.

...

31. The Windows XP version of the FTP client has problems with the
Windows Firewall so you will need another FTP client program to
do file transfers if you see a message referring to PORT/EPRT and
PASV/EPSV or "no data connection". LeapFTP is a commercial program
that seems to work well (http://www.leapware.com). There are others.
 
Last edited by a moderator:
Excellent articale !

Thanks

Sorry scorpio, but I could not get your notes to work the other day, this now works.

This needs to go into the unoffical Gp2x manual. Someone sent it to the maintainer of it..

Two additional points

Step:
10.3 Turn on Telnet client
10.4 Press B to exit the setting screen and start the services.


Thanks all !
 
Nickmon posted on May 2 2006 at 06:49 PM said:
Two additional points

Step:
10.3 Turn on Telnet client
10.4 Press B to exit the setting screen and start the services.
The guide has been updated as follows:

9. Repeat steps 7 and 8 for the third and fourth numbers,
specifying values of "0" and "235" .

The IP address value should appear as 10.1.0.235 if steps
7 to 9 are done correctly.

10. Move down to the FTP, Telnet Server entry and select "ON"
or "ALWAYS ON".

Press the "B" key to exit from the System screen, letting
the Gp2x start its servers.
 
Last edited by a moderator:
yoyoyoyoyoyoyo posted on May 2 2006 at 09:44 PM said:
What does this do? After I do everything and get the telnet box up and type in everything it says:
Code:
[root@gp2x root]$
It appears you're now in the (gp2x) system. Do what you please :)
 
Last edited by a moderator:
i have problemes on my windows 2000 the required files are not presente and i can find them on my harddrive. i have only usb8023y.sys and rndismpy.sys. i have to modifiy the linux.inf file?
[RNDIS_CopyFiles_NT]
; no rename of files on Windows 2000, use the 'k' names as is
usb8023k.sys, , , 0
rndismpk.sys, , , 0

if i don,wload the NDIS driver : Here
i only have usb8023y.sys and rndismpy.sys.
 
yoyoyoyoyoyoyo posted on May 3 2006 at 02:44 AM said:
What does this do? After I do everything and get the telnet box up and type in everything it says:
Code:
[root@gp2x root]$

You are now in Linux land, try some of the following:

pwd - print working directory
ls - same as dos dit
ps -ef - list processes running
cd / - change to root of file system

or google for linux/unix commands...
 
Last edited by a moderator:
mayby that's a stupid question, but how do I make this to work under linux? Assume that I have usbnet module compiled. When I type "ifconfig -a" I can see usb0 interface but what do I do with this from there? I've tried "iconfig (gp2x ip) up" but that didn't work. To be honest, I'm not really sure what I was doing...my knowledge of networking sucks greatly...
 
one thing thats important as told in the guide by now is that in the system menu the following is a must know:

B - Save and exit
X - Exit to settings w/o save
START - Exit to main menu w/o save
Y - increase value (ip)
A - lower value (ip)

then ofcourse i need some help :)
what password is it to the ftp server, tried to connect with SmartFTP but root or so didn't work :(

should i be able to use an FTP like Smart or do i have to do it using comands within Telnet??
 
Jacxz posted on May 3 2006 at 09:16 AM said:
then ofcourse i need some help :)
what password is it to the ftp server, tried to connect with SmartFTP but root or so didn't work :(

should i be able to use an FTP like Smart or do i have to do it using comands within Telnet??
There is no root password so leave that field blank in SmartFTP's entry.

I suggest you create a new user with reduced privileges:

adduser -s /bin/bash <username>

and use that as much as possible for subsequent work.
 
Last edited by a moderator:
Back
Top