Beispiel #1
0
int main(int argc, char *argv[])
{
    int randomReps = RANDOM_ACCESS_MAX_REPS;

    srand(time(NULL));

    output = fopen("results.csv", "w");
    cdrom_init(&cd);

    cdrom_open(&cd, "/dev/sr0");

    if(strcmp(argv[1], "speed") == 0)
    {
        speedTest(NULL);
    }
    else if(strcmp(argv[1], "random") == 0)
    {
        randomReps = atoi(argv[2]);

        if(randomReps <= RANDOM_ACCESS_MAX_REPS)
        {
            if(randomReps > 20)
            {
                randomAccessTest(randomReps, FALSE);
            }
            else
            {
                randomAccessTest(randomReps, TRUE);
            }
        }
        else
        {
            g_print("Too Many Reps\n");
        }
    }
    else if(strcmp(argv[1], "seek") == 0)
    {
        seekTest();
    }
    else
    {
        g_print("Usage: eaa (speed|random count)\n");
    }

    fclose(output);
    cdrom_close(&cd);

    return 0;
}
Beispiel #2
0
/* Initialize the file system */
int iso_init() {
	int i;

	/* Initialize the CD-ROM */
	if (cdrom_init() < 0)
		return -1;

	/* Reset fd's */
	memset(fh, 0, sizeof(fh));
	
	/* Mark the first as active so we can have an error FD of zero */
	fh[0].first_extent = -1;
	
	/* Allocate cache block space */
	for (i=0; i<NUM_CACHE_BLOCKS; i++) {
		cache[i] = cache_block_phys + i;
		cache[i]->sector = -1;
	}

	return 0;
}
Beispiel #3
0
int hardware_periph_init() {
	/* Init sound */
	spu_init();
	spu_dma_init();

	/* Init CD-ROM.. NOTE: NO GD-ROM SUPPORT. ONLY CDs/CDRs. */
	cdrom_init();

	/* Setup maple bus */
	maple_init();

	/* Init video */
	vid_init(DEFAULT_VID_MODE, DEFAULT_PIXEL_MODE);

	/* Setup network (this won't do anything unless we enable netcore) */
	bba_init();
	la_init();

	initted = 2;

	return 0;
}
Beispiel #4
0
int main(int argc,char *argv[]) {
  cdrom_init();
  devfs_mainloop();
  cdrom_destroy();
  return 0;
}