Esempio n. 1
0
static int ethLoadModules(void) {
	LOG("ETHSUPPORT LoadModules\n");

	if(!ethModulesLoaded) {
		ethModulesLoaded = 1;

		sysInitDev9();

		if (sysLoadModuleBuffer(&netman_irx, size_netman_irx, 0, NULL) >= 0) {
			NetManInit();

			sysLoadModuleBuffer(&smsutils_irx, size_smsutils_irx, 0, NULL);
			if (sysLoadModuleBuffer(&smap_irx, size_smap_irx, 0, NULL) >= 0) {
				//Before the network stack is loaded, attempt to set the link settings in order to avoid needing double-initialization of the IF.
				//But do not fail here because there is currently no way to re-start initialization.
				ethApplyNetIFConfig();

				if (sysLoadModuleBuffer(&ps2ip_irx, size_ps2ip_irx, 0, NULL) >= 0) {
					sysLoadModuleBuffer(&ps2ips_irx, size_ps2ips_irx, 0, NULL);
					sysLoadModuleBuffer(&httpclient_irx, size_httpclient_irx, 0, NULL);
					ps2ip_init();
					HttpInit();

					LOG("ETHSUPPORT Modules loaded\n");
					return 0;
				}
			}
		}

		gNetworkStartup = ERROR_ETH_MODULE_NETIF_FAILURE;
		return -1;
	}

	return 0;
}
Esempio n. 2
0
int main(int argc, char *argv[])
{
    SifInitRpc(0);

    SifLoadModule("host:ps2ips.irx", 0, NULL);

    if(ps2ip_init() < 0) {
        printf("ERROR: ps2ip_init falied!\n");
        SleepThread();
    }

    serverThread();
    return 0;
}
Esempio n. 3
0
int main()
{
    int whichdrawbuf = 0;
    int s;
    char *buffer;
	int i;
	int size;
	int rc;
	int fd;
    // Initialise RPC system.

    sif_rpc_init(0);
    
    // Setup the Video.

    DmaReset();
    initGraph(3);
    SetVideoMode();
    //install_VRstart_handler();

    // Setup the double buffers.

   // SetDrawFrameBuffer(1);
   // SetDrawFrameBuffer(0);
   // SetCrtFrameBuffer(1);

    // Load the modules!

    loadModules();


    // Loaded the modules.. now try ps2ip now..
    if(ps2ip_init()<0)
	{
		printf("ERROR: ps2ip_init failed2");
		k_SleepThread();
	}
	//put here your file path 
    fd=fio_open("ps2vfs:\\primer\\segun\\mio.txt",O_RDONLY);
	if (fd>0)
	{
		printf("file id kernel is %d \n");
		size=fio_lseek(fd,0,SEEK_END);
		i=fio_lseek(fd,0,SEEK_SET);
		buffer=(char *)malloc(sizeof(char)*size);
		i=fio_read(fd,buffer,size);
		
		printf("receive size:  %d \n",i);
		printf("receive: buffer= %s \n",buffer);
		fio_close(fd);
			
	}
           
	
	

	
	
	while ( 1 )
	{
        //WaitForNextVRstart(1);

        //ClearVRcount();
        //SetCrtFrameBuffer(whichdrawbuf);
        //whichdrawbuf ^= 1;
        //SetDrawFrameBuffer(whichdrawbuf);
//        scr_printf( "t" );
    } 

    // We shouldn't get here.. but just in case.

    k_SleepThread();

}