USB KB

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
ripplar
Posts: 8
Joined: Mon May 03, 2004 10:00 am

USB KB

Post 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

:?:
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post 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.
ripplar
Posts: 8
Joined: Mon May 03, 2004 10:00 am

Post 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...
ripplar
Posts: 8
Joined: Mon May 03, 2004 10:00 am

Ok

Post 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.
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post 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.
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Simple translation:

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

-L/path/to/your/libraries -lkbd
ripplar
Posts: 8
Joined: Mon May 03, 2004 10:00 am

Thanks

Post 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.
ripplar
Posts: 8
Joined: Mon May 03, 2004 10:00 am

ok

Post 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
ripplar
Posts: 8
Joined: Mon May 03, 2004 10:00 am

opps

Post by ripplar »

forgive my spelling having a long day
mharris
Posts: 155
Joined: Sun Jan 25, 2004 2:26 pm
Location: Annapolis, MD, USA

Post 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.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post 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
Post Reply