示例#1
0
文件: spu.c 项目: Corbachu/KallistiOS
int main(int argc, char **argv) {
    file_t f;
    int len;

    /* Open the S3M file from the romdisk */
    f = fs_open("/rd/cyboman.s3m", O_RDONLY);

    /* Get its length */
    len = fs_total(f);

    /* mmap() the file space; note that this ONLY works on rom file
       systems for now; this may change later */
    song = fs_mmap(f);

    /* Start a song playing */
    copy_s3m(song, len);

    /* Close the file */
    fs_close(f);

    /* Wait for start */
    wait_start();

    return 0;
}
示例#2
0
int main(int argc, char **argv) {
	file_t f;
	void *subelf;

	/* Print a hello */
	printf("\n\nHello world from the exec.elf process\n");

	/* Map the sub-elf */
	f = fs_open("/rd/sub.bin", O_RDONLY);
	assert( f );
	subelf = fs_mmap(f);
	assert( subelf );

	/* Tell exec to replace us */
	printf("sub.bin mapped at %08x, jumping to it!\n\n\n", subelf);
	arch_exec(subelf, fs_total(f));

	/* Shouldn't get here */
	assert_msg( false, "exec call failed" );

	return 0;
}