예제 #1
0
/* Works in user mode */
void arm_main(void)
{
	char line[ARM_MAX_CMD_STR_SIZE];

	arm_irq = 0;
  txBuffer.index = 0;
	lights[0] = 500;
	lights[1] = 500;

	/* Setup board specific linux default cmdline */
	arm_board_linux_default_cmdline(cmdline, sizeof(cmdline));

	arm_puts(arm_board_name());
	arm_puts("Trampoline Firmware from trampoline git\n");

	arm_board_init();

	// arm_puts("Starting OS ...\n\n");
	// StartOS(OSDEFAULTAPPMODE);

	while(1) {
		arm_puts("trampoline# ");

		arm_gets(line, ARM_MAX_CMD_STR_SIZE, '\n');

		arm_exec(line);
	}
}
예제 #2
0
파일: arm_main.c 프로젝트: CoryXie/xvisor
void arm_cmd_autoexec(int argc, char **argv)
{
	static int lock = 0;
	int len;
	/* commands to execute are stored in NOR flash */
	char *ptr = (char *)(arm_board_flash_addr() + 0xFF000);
	char buffer[4096];

	if (argc != 1) {
		arm_puts ("autoexec: no parameters required\n");
		return;
	}

	/* autoexec is not recursive */
	if (lock) {
		arm_puts("ignoring autoexec calling autoexec\n");
		return;
	}

	lock = 1;

	if ((len = arm_strlen(ptr))) {
		int pos = 0;

		/* copy commands from NOR flash */
		arm_strcpy(buffer, ptr);

		/* now we process them */
		while (pos < len) {
			ptr = &buffer[pos];

			/* We need to separate the commands */
			while ((buffer[pos] != '\r') &&
				(buffer[pos] != '\n') &&
				(buffer[pos] != 0)) {
				pos++;
			}
			buffer[pos] = '\0';
			pos++;

			/* print the command */
			arm_puts("autoexec(");
			arm_puts(ptr);
			arm_puts(")\n");
			/* execute it */
			arm_exec(ptr);
		}

	}

	lock = 0;

	return;
}
예제 #3
0
파일: arm_main.c 프로젝트: CoryXie/xvisor
/* Works in user mode */
void arm_main(void)
{
	char line[ARM_MAX_CMD_STR_SIZE];

	/* Setup board specific linux default cmdline */
	arm_board_linux_default_cmdline(linux_cmdline, 
					sizeof(linux_cmdline));

	arm_puts(arm_board_name());
	arm_puts(" Basic Firmware\n\n");

	arm_board_init();

	while(1) {
		arm_puts("basic# ");

		arm_gets(line, ARM_MAX_CMD_STR_SIZE, '\n');

		arm_exec(line);
	}
}