Page 1 of 1

USB KB

Posted: Sun May 16, 2004 5:25 am
by ripplar
Here's a question I have downloaded the new sdk that is ava. My question is if I use the ps2kdb.h in the sdk/ee/include directory what is the command or what do I need to put in my code to init the kbd. If I was to load up the sdk/iop/irx/ps2kbd.irx would that make the cin command work or do I need something else to type in beside that like init_kbd()

Ripplar

:?:

Posted: Sun May 16, 2004 7:22 pm
by TyRaNiD
You also currently need a usb driver, which you can get off a few game disks.

It should be called something like usbd.irx, load that module first before the one for the kbd and then just init the keyboard library.

Posted: Mon May 17, 2004 12:57 pm
by ripplar
Thanks alot TyRaNiD for the help but I guess I need to typ init_kbd() and then type what input I need inside the () for ex...


int a, b ,c
scr_printf("enter 2 numbers\n");
init_kbd(a);
init_kbd(b);
scr_printf("these numbers equal ... when added\n");
c=add (a,b);

something along these line would this allow input from a kb to get intergers a and b..

still having trouble...

Ok

Posted: Wed May 19, 2004 11:59 am
by ripplar
I figure some more info out and here is my problem when I try to compile

the following code:

#include <tamtypes.h>
#include <sifcmd.h>
#include <kernel1.h>
#include <sifrpc.h>
#include <libkbd.h>
// The above file are part of the PS2LIB and are used in the following functions

// The code below is try to get the PS2 keyboard to react

int main()
{
PS2KbdInit();


return 0;
}



ee-gcc -D_EE -fshort-double -fno-builtin -O2 -G0 -c -Wall -I/usr/local/ps2dev/ps
2lib/ee/include -I/usr/local/ps2dev/ps2lib/common/include -I. kbd.c -o kbd.o
kbd.c:16:2: warning: no newline at end of file
ee-gcc -nostartfiles -T/usr/local/ps2dev/ps2lib/ee/startup/linkfile -L/usr/local
/ps2dev/ps2lib/ee/lib -o kbd.elf /usr/local/ps2dev/ps2lib/ee/startup/crt0.o kbd
.o -lkernel
kbd.o: In function `main':
kbd.o(.text+0x8): undefined reference to `PS2KbdInit'
collect2: ld returned 1 exit status
make: *** [kbd.elf] Error 1


Now I have wverything set according to Dan Peori toolchanin.sh file @ <[email protected]>

anysuggestions at what to look at. The stuff I'm trying to requires keyboard access.

Posted: Wed May 19, 2004 2:01 pm
by pixel
Now where in the world did you see a libkbd.h file in ps2lib ?

There is one in ps2hid. But now I wonder how this file got in your include path. Anyway, that libkbd is part of the ps2hid package. So, you actually need to add -lkbd to your linking phase, so that the libkbd portion of ps2hid will get linked in. If you presumabily compiled ps2hid correctly, and that the libkbd.a lies under some library searching path.

Posted: Wed May 19, 2004 2:09 pm
by ooPo
Simple translation:

Find out which directory contains libkbd.a, then add this to your flags:

-L/path/to/your/libraries -lkbd

Thanks

Posted: Thu May 20, 2004 9:49 am
by ripplar
Thanks ooPo for your input I will let you know what's going on with this after I try you inputs.. Also I'm using PS2SDK to get my libkbd libs I just added the different file into my $PS2LIB include directories.

ok

Posted: Thu Jun 03, 2004 9:51 am
by ripplar
I have added my my lkdb to my make file and compiled it correctly with out error. I have a new proble when using Pukklink v1.0b and Inlink v1.3.7 I load my usbd.irx file fine. It tells me USB Driver(Version 1.1.0) (all good I assume). Now the fun part it seems to lockup and I have to turn off my ps2 after tring to load the file ps2kbd.irx. It does apsolutely nothing. I tell me loading file then drops connection due to time out or lost. Please help...

ripplar

opps

Posted: Thu Jun 03, 2004 9:53 am
by ripplar
forgive my spelling having a long day

Posted: Thu Oct 28, 2004 3:43 am
by mharris
Sorry for bumping such an old thread, but I've been away for a while...
ripplar wrote:I have added my my lkdb to my make file and compiled it correctly with out error. I have a new proble when using Pukklink v1.0b and Inlink v1.3.7 I load my usbd.irx file fine. It tells me USB Driver(Version 1.1.0) (all good I assume). Now the fun part it seems to lockup and I have to turn off my ps2 after tring to load the file ps2kbd.irx. It does apsolutely nothing. I tell me loading file then drops connection due to time out or lost. Please help...
I am working on a similar thing, and I think the problem is with inlink.

I'm in the process of moving my dev environment from emacs+linux to eclipse+windows (mostly because my windows machine is newer and faster than my aging linux box). In any event, I have the same issue when I try to run it from inlink 1.3.7 on the WinXP machine: it loads and inits the SCE usbd.irx OK, but loading ps2kbd.irx hangs the PS2 and inlink gets a socket error. The PS2 must be physically switched off.

Interestingly, when I load the identical .elf and .irx files from my Linux machine (via pksh) it has no problems at all and behaves as expected. So my guess is that it's inlink. I haven't yet tried building a Win32 version of pksh to try out; that's next.

Posted: Thu Oct 28, 2004 4:35 am
by ooPo
There's a win32 version of ps2client on my site if you quickly want to give it a try:

http://www.oopo.net/consoledev/files/ps2client.exe