Welcome! Log In Create A New Profile

Advanced

remote file descriptors [Updated: now with windows driver]

Posted by punto 
remote file descriptors [Updated: now with windows driver]
July 02, 2009 03:13AM
UPDATE: Added windows drivers and directory operations (chdir, opendir, etc). I'm using scons to build, so I'm not sure how well that works on windows.

--
Hi..

I wrote a small library to provide access to the console and filesystem of my computer to my wii app, I put together an example using wiiload. I think this should be a useful tool for development. I'd love to get some feedback from the dev community. Here's the download link:

[www.codenix.com]

I'm pasting the README file with more details below.

thanks!

--

RFD (Remote File descriptor) is a portable library that provides file i/o over
a remote connection.

My motivation was to be able to open files on my hard drive and print to a
console from my wii game without the need for elaborate samba or netcat setups.

The operations supported are open, read, write, close and (limited) stat. Also
chdir, getcwd, opendir, readdir and closedir for directories.

This package contains an example using a modified wiiload that starts a server,
and a wii program that connects to the server, opens a file and prints it to the
console of the running wiiload.

Build requirements:

- scons
- devkitppc, etc

How to build:

run "scons ", where targets can be:

wiiload (on linux)
wiiload.exe (on windows or linux using mingw)
template.elf (the wii demo)

For example, "scons wiiload.exe template.elf" will give you wiiload.exe and
template.elf

How to run:

For wiiload, set the WIILOAD env var with the IP of your wii. Also you need to
set the env variable 'WIILOAD_RFD_HOST' with the IP of your computer (it has to
be accessible from the wii).
Then, use wiiload to launch template.elf (eg "./wiiload template.elf")

The wii program should print some stuff to the wiiload console, list the current
directory contents, and open the 'SConstruct' file and print it.

TODO:

- Figure out the local IP of the host machine (so we don't need WIILOAD_RFD_HOST)
- Setup a device so we can use this with the fopen/printf/opendir API (don't know
how to do this)
- Maybe use one of the reserved file descriptors to talk to gdb, so we can debug
over the network?

Contact:

puntob@gmail.com



Edited 1 time(s). Last edit at 07/17/2009 07:50AM by punto.
Re: remote file descriptors [Updated: now with windows driver]
July 27, 2009 10:18PM
I will test it!
Why don't you make a library?




Thiago
Re: remote file descriptors [Updated: now with windows driver]
July 30, 2009 03:20PM
I tested yesterday and it is working as expected!

It would be nice to have it as libs win32/linux/wii so we could just include it!
What do you think?

Thanks!
Re: remote file descriptors [Updated: now with windows driver]
August 02, 2009 11:16AM
Quote
thiagolr
I tested yesterday and it is working as expected!

It would be nice to have it as libs win32/linux/wii so we could just include it!
What do you think?

Thanks!

thanks for the feedback.. yeah, that's probably the way to go, I just didn't get the time to package it properly yet. Since I'm compiling my own wiiload to use it, I just included the sources on my project. The wii client should probably be integrated with the fopen/fread/etc API too..

I was just wondering if there'd be interest from de development community (as an alternative to whatever we're using now to avoid loading all the assets on the wii before testing something).
Re: remote file descriptors [Updated: now with windows driver]
August 07, 2009 04:02PM
What is the RFD license? GPL? LGPL?
Re: remote file descriptors [Updated: now with windows driver]
August 07, 2009 09:18PM
MIT License (friendlier with wii development, since there's no dynamic linker..)

I added a notice to the readme file.
Re: remote file descriptors [Updated: now with windows driver]
August 16, 2009 07:04PM
punto,

I was having a problem that the server was only able to receive a few connections/disconnections and then it was entering an infinite loop on rfd_server_run.

I added the following lines of code in rfd_server.c -> rfd_server_run:
case RFD_SHUTDOWN: {

rfd_server_shutdown(p_server);
return 1;

} break;

And also in rfd_net_winsock.c -> tcp_read
if (read == 0) {

// orderly shutdown
buf[0] = RFD_SHUTDOWN;
tcp_shutdown(p_ro);
return total_read;
};


I'm not sure if this is the ideal fix, but it worked for me!
Sorry, only registered users may post in this forum.

Click here to login