Exemple #1
0
static int add_cmdline_param(char *cmdline, uint64_t addr, char *cmdstr,
				char *byte)
{
	int cmdline_size, cmdlen, len, align = 1024;
	char str[COMMAND_LINE_SIZE], *ptr;

	/* Passing in =xxxK / =xxxM format. Saves space required in cmdline.*/
	switch (byte[0]) {
		case 'K':
			if (addr%align)
				return -1;
			addr = addr/align;
			break;
		case 'M':
			addr = addr/(align *align);
			break;
	}
	ptr = str;
	strcpy(str, cmdstr);
	ptr += strlen(str);
	ultoa(addr, ptr);
	strcat(str, byte);
	len = strlen(str);
	cmdlen = strlen(cmdline) + len;
	cmdline_size = (kernel_version() < KERNEL_VERSION(3, 15, 0) ?
			512 : COMMAND_LINE_SIZE);
	if (cmdlen > (cmdline_size - 1))
		die("Command line overflow\n");
	strcat(cmdline, str);
	dbgprintf("Command line after adding elfcorehdr: %s\n", cmdline);
	return 0;
}
Exemple #2
0
void harness_boot(void)
{
	int err;

	printf("******** Booting "MACHINE" ********\n");

	/* these is a set of requirements of the interrupt system for
	 * the factory function to work correctly
	 */
	err = interrupt_init(7, intStack, sizeof(intStack), interrupt_trigger_mode_high_level, 0);
	assert(0 == err);
	interrupt_enable_global();

#if 1 == __CORE__
{
        extern void c1_timer_initialize(void);
        printf("******** Initializing ST20-C1 timer ********\n");
        c1_timer_initialize();
}
#endif

        /* setup the instruction cache (on most devices we expect
         * cache_config_instruction() to fail so we ignore return code
         */
        cache_config_instruction((void*) 0x80000000, (void*) 0x7fffffff,
                                 cache_config_enable);
        err = cache_enable_instruction();
        assert(0 == err);

        /* cache the whole of memory - harness_initialize is responsible
	 * for disabling the cache for shared memory
	 */
        err = cache_config_data((void*) 0x80000000, (void*) 0x7fffffff,
                                cache_config_enable);
        assert(0 == err);

	/* initialize any board specific components and register transports */
	harness_initialize();

	/* we can not safely enable the data cache */
        err = cache_enable_data();
        assert(0 == err);

#ifdef __STRPC__
#ifdef ENABLE_RPC_SERVER
        rpcServerInit();
#else
	EMBX(Init());
#endif
        err = rpcStubsInit(NULL);
        assert(0 == err);
#else
        EMBX(Init());
#endif
	errno = 0;

	printf("******** "MACHINE" booted OS21 %s ********\n", kernel_version());
}
Exemple #3
0
void demo_init(void)
{
	uint32_t ver;
	uint32_t total;
	uint32_t used;
	ver = kernel_version();
	debug("\r\nklite version:%d.%d.%d\r\n",(ver>>24)&0xFF,(ver>>16)&0xFF,ver&0xFFFF);
	kthread_create(demo_main,0,0);
	kthread_create(demo_main,0,0);
	kmem_info(&total,&used);
	debug("memory usage: %d/%d byte\r\n",used,total);
}
Exemple #4
0
std::string BuildInfo::version_header() const
{
  std::ostringstream out;

  out << "Release      : " << release_version() << "\n";
  out << "Kernel       : " << kernel_version()  << "\n";
  out << "Build System : " << build_tool()    << "\n";
  out << "Build Type   : " << build_type()      << "\n";
  out << "Build OS     : " << os_long_name() << " [" << os_bits() << "bits]\n";
  out << "Build CPU    : " << build_processor() << "\n";

  return out.str();
}
Exemple #5
0
/*==============================================================================
 * - banner()
 *
 * - print logo
 */
void banner (void)
{
    char *logo[] =
    {
"\n",
"                                 ]]]]",
"                               ]]]]",
"                              ]]]",
"                             ]]]",
"                            ]]]",
"                           ]]]",
"                          ]]]",
"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]",
"                        ]]]",
"            ]]]]]]     ]]]             ]]]",
"          ]]]     ]]] ]]]]              ]]]",
"        ]]]          ]]]]]      ]]]      ]]",
"        ]]]         ]]] ]]     ]] ]]     ]]",
"        ]]]        ]]]  ]]]   ]]  ]]    ]]",
"          ]]]    ]]]     ]]] ]]    ]]  ]]",
"            ]]]]]]        ]]]]      ]]]]         (TM)",
"\n"
    };
    int ix;

    for (ix = 0; ix < (int)N_ELEMENTS(logo); ix++)
        serial_printf (" %s\n", logo [ix]);

    serial_printf (" %s%s %s\n",
            "]]]]]]]]]]]]]]]]]]]]]] ", "DfewOS", "1.0.0");
    serial_printf (" %s%s\n",
            "]]]]]]]]]]]]]]]]]]]    KERNEL: ", kernel_version ());
    serial_printf (" %s\n",
            "]]]]]]]]]]]]]]]]       Copyright D few, Inc., 1988-2011");

    serial_printf ("\n");
}
Exemple #6
0
main()
{
	mach_port_t 	bootstrap_port;
	int	 	i;
	struct test_dir *td, **tds;
	int 		all;
	kern_return_t 	kr;
	boolean_t 	found;
	int 		argc = 0;
	char 		**argv;


	MACH_CALL(task_get_special_port, (mach_task_self(),
                                       TASK_BOOTSTRAP_PORT,
                                       &bootstrap_port));
	MACH_CALL(bootstrap_ports, (bootstrap_port,
					&privileged_host_port,
					&master_device_port,
					&root_ledger_wired,
					&root_ledger_paged,
					&security_port));

	MACH_FUNC(host_port, mach_host_self, ());

	standalone = is_standalone();

	threads_init();
	console_init();
	_printf_init();
	exception_init();

	printf("\n\n");
	version();
	kernel_version();
	if (standalone)
		printf("Standalone mode\n\n");

	vm_opt = 1;
	print_vm_stats();
	printf("\n");
	get_thread_sched_attr(mach_thread_self(),
			    (policy_state_t) 0,
			    TRUE);
	printf("\n");
	while(1) {
		mach_setjmp(&sa_jmp_buf);
		reset_options();
                /* synthetic benchmarks are not the default type */
                synthetic_fn = NULL;
		reset_more();
		if (!(argc = read_cmd(&argv, "mpts> ")))
			continue;
		for (i = 1; i < argc; i++)
			is_gen_opt(argc, argv, &i, 0, 0);
		if (!strcmp(argv[0],"on")) {
		  	shift_args(&argc, argv);
			if (remote_node(argc, argv)) {
				shift_args(&argc, argv);
			} else {
				interruptible_cmd(usage, 0, 0);
				continue;
			}
		} 
		if (!strcmp(argv[0],"more")) {
			shift_args(&argc, argv);
		} else
			disable_more();
		all = strcmp(argv[0],"*") ? 0 : 1;
		for (found = FALSE, tds = test_dirs; *tds && !found; tds++)
		    for (td = *tds; td->name && !found; td++)
			if ((all && td->is_a_test) 
			    || !strcmp(argv[0],td->name)) {
				if (td->is_a_test)
					printf("_______________________________________________________________________________\n");
			  	argv[0] = td->name;
				if (td->is_a_test)
					interruptible_cmd(td->func,
							  argc,
							  argv);
				else
					(*td->func) (argc, argv);
				if (!all)
					found = TRUE;
			}
		if ((!all) && (!found)) {
                    if (find_proc(argv[0]))
                        /* run synthetic benchmark if we have a proc name */
                        interruptible_cmd(synthetic,argc,argv);
                    else
			interruptible_cmd(usage, 0, 0);
		}
	}
	printf("done\n");
}
Exemple #7
0
/* initialization */
void cweb_init(void)
{
	sys_info.pages = 0;
	sys_info.kern_ver = kernel_version();
}