PS2 Hardware in Linux HOWTOs - Docs

Summary |  Forums |  Bugs |  Tasks |  Docs |  News | 

View Documentation | Submit new documentation

HOWTO remote compile with MSVS 6.0

HOWTO compile and run from MS Visual Studio

HOWTO compile and run from MS Visual Studio

Tutorial v1.0- written Nov 27 2003 by misterJ


This tutorial explains the key elements needed to create an easy-to use remote compilation system from Windows to ps2linux. For the fans of MSVS (myself included), it is easier to use than running a telnet window and typing commands to the ps2 every time you want your program to run. In fact, that entire process now becomes automated! I decided to write this tutorial after (finally) setting up this system on my computer/ps2 at home. Microsoft Visual Studio v6.0 is what I use for this. The system is set up so all source code saved on a ps2 can be edited in this IDE, then with only 1 keystroke can be built and run on the ps2 over a network. (not to be confused with cross compiling).

This assumes you already have a working samba system for the file access, and that basic Telnet services are functional as well. Also, I use PuTTY as a Telnet and SSH client to send commands to the ps2. You can download PuTTY from here. If the basics are missing, there is plenty of material regarding setting up samba, telnet, etc. on the ps2linux website. In fact, nearly all of this info is taken from different messages in forums!


First of all, the sshd daemon on the ps2 must run for ssh to work. This simple little step has nearly everything to do with this system working.

To install it, insert linux CD # 2, install all the rpms that start with openssh. Editors note: This step is unnecessary if you installed "Everything" when you first installed Ps2Linux.

As root, run the command:

rpm –Uvh openssh*.rpm

This is a list of services that start when ps2linux boots up. Enable sshd.

Next, if you want to login with ssh as root (I've heard its a bad idea, but I do it anyway )

open /etc/ssh/sshd_config. change 'PermitRootLogin' to yes

then reboot for all the changes to take effect.


At this point, you should be able to start up putty.exe and begin a telnet and an ssh session. However we need to be able to run the commands make and (program to run) within a single command line. In the putty package, the program plink will do just that, but it must be called from a command line in a console window. To find the program, the PATH environment variable must be changed to get rid of the "bad command" message.

In WindowsXP, open up the control panel, open up the system panel, advanced tab, and click environment variables. Edit the PATH variable- append the file path to the putty programs somewhere in the variable value. ex- "C:\Documents and Settings\john\My Documents\crossc\putty"

Now to start a SSH session with plink in a console window, just mess around with the arguments like this-

plink -ssh -l (username) -pw (password) [user@](hostname) (command)

the values i entered:

plink -ssh -l root -pw (mypassword) ps2linux cube

by providing the password in the command, there is no need to input the password and hit enter again. On my ps2, cube is a simple visual sample that will run if the command succeeds. If the commands are remotely executed after running this, its all good!


The last thing to do is create the tool in MSVS to run the ssh command and assign it a keystroke. In MSVS, go Tools->Customize

In the tools tab, add a new tool. The command will be set to plink, the arguments are like shown above, but for the actual commands to execute on the ps2, make them useful like "cd projectdir;make;program name". Then switch to the keyboard tab, set the category to tools, and find which user tool number the new tool is (mine was 2). Assign a keystroke, and close out.

One more thing... you will have to edit your own makefile on the ps2. Another thing is that the tool will have to be changed for each different program you make (change directory to go to, and program to execute).

Voila! Edit your source code files with samba, then hit the key you assigned earlier, and your sample will build and run on the PS2! Note that you will need 2 displays however, a PC and a TV should work OK. Whats cool is that your program output will be redirected to the IDE output window! However, the only downside is that MSVS can be used to create and manage huge programs, but the ps2 isn't overly a fast compilation tool. Compiling on the PC (known as cross-compiling, and is much faster) may be something to write about in the future.

This is just a preliminary doc- I may have left a step out or not elaborated enough. Any suggestions or criticism are appreciated!