int main() { uint8_t ret; init_stdout(); #ifdef VERBOSE print ("\r\nSREC Bootloader\r\n"); print ("Loading SREC image from flash @ address: "); putnum (FLASH_IMAGE_BASEADDR); print ("\r\n"); #endif flbuf = (uint8_t*)FLASH_IMAGE_BASEADDR; ret = load_exec (); /* If we reach here, we are in error */ #ifdef VERBOSE if (ret > LD_SREC_LINE_ERROR) { print ("ERROR in SREC line: "); putnum (srec_line); print (errors[ret]); } else { print ("ERROR: "); print (errors[ret]); } #endif return ret; }
void kernel_main(void) { //Initialize process manager, setup timers, get threading up and running // Enumerate and initialize drivers // Load UI elf from disk // Switch to usermode // Execute UI //Seed the rng with the timer value seed(GetTimerValue()); InterruptMan_Initialize(); SyscallMan_Initialize(); Syscall_Initialize(); DeviceManager_Initialize(); //smp_unlock_cores(); SetupPreemption(); target_device_setup(); UID cpid = 0; if(CreateProcess(ROOT_PID, 0, &cpid) != ProcessErrors_None) HaltProcessor(); load_exec(cpid, "userboot.bin"); while(1) WakeReadyThreads(); }
void cmd_exec(){ // Execs a config file. load_exec(parse_words[1]); }
int execv(const char *path, char const **argv) { void *image; image = load_exec(path); return execiv(image, msize(image), argv); }
int main() { SYSACE_FILE *srec_file; char file_name[20]; char *p; uint8_t ret; int choice, bytes, total_bytes; /* Set a well-known "return to loader" vector*/ set_ret_to_loader_vec(); /* Initialize RS232_Uart_1 - Set baudrate and number of stop bits */ XUartNs550_SetBaud(XPAR_RS232_UART_1_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, 9600); XUartNs550_SetLineControlReg(XPAR_RS232_UART_1_BASEADDR, XUN_LCR_8_DATA_BITS); print("\n\r********************************************************"); print("\n\r********************************************************"); print("\n\r** Xilinx Virtex-6 FPGA ML605 Evaluation Kit **"); print("\n\r********************************************************"); print("\n\r********************************************************\r\n"); do { print("Choose Feature to Test:\r\n"); print("1: UART Test\r\n"); print("2: LED Test\r\n"); print("3: Timer Test\r\n"); print("4: FLASH Test\r\n"); print("5: IIC Test\r\n"); print("6: Ethernet Loopback Test\r\n"); print("7: Switch Test\r\n"); print("8: External Memory Test\r\n"); print("9: System Monitor Test\r\n"); print("A: PushButton Test\r\n"); print("B: LCD Test\r\n"); print("C: System ACE CF Test\r\n"); print("D: DVI/VGA Test\r\n"); choice = inbyte(); if (isalpha(choice)) { choice = toupper(choice); } } while (!isdigit(choice) && (choice < 'A' || choice > 'D')) ; xil_printf("%c\r\n", choice); sprintf(file_name, "bist\\%c.rec", choice); srec_file = sysace_fopen(file_name, "r"); if (srec_file == 0) { printf("\r\nUnable to open %s\r\n", file_name); return 1; } /* * Read the SRECORDS in the selected file into RAM. */ flbuf = (char*)(XPAR_DDR3_SDRAM_MPMC_BASEADDR + 0x100000); p = flbuf; total_bytes = 0; xil_printf("Reading SRECORDS from Compact Flash file %s:\r\n", file_name); do { bytes = sysace_fread(p, 1, 0x100000, srec_file); p += bytes; total_bytes += bytes; } while (bytes > 0); sysace_fclose(srec_file); xil_printf("\r\n%d bytes read from file. SRECORDS at: 0x%x\r\n", total_bytes, (unsigned)flbuf); ret = load_exec (); /* If we reach here, we are in error */ #ifdef VERBOSE if (ret > LD_SREC_LINE_ERROR) { print ("ERROR in SREC line: "); putnum (srec_line); print (errors[ret]); } else { print ("ERROR: "); print (errors[ret]); } #endif return ret; }
mrb_value mrb_load_nstring_cxt(mrb_state *mrb, const std::string & s, mrbc_context *c) { return load_exec(mrb, mrb_parse_nstring(mrb, s, c), c); }
mrb_value mrb_load_file_cxt(mrb_state *mrb, FILE *f, mrbc_context *c) { return load_exec(mrb, mrb_parse_file(mrb, f, c), c); }
int main() { uint8_t ret; int choice; //int bytes; //int total_bytes; /* Set a well-known "return to loader" vector*/ set_ret_to_loader_vec(); /* Initialize RS232_Uart_1 - Set baudrate and number of stop bits */ XUartNs550_SetBaud(XPAR_RS232_UART_1_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, 9600); XUartNs550_SetLineControlReg(XPAR_RS232_UART_1_BASEADDR, XUN_LCR_8_DATA_BITS); print("\n\r********************************************************"); print("\n\r********************************************************"); print("\n\r** Xilinx Virtex-6 FPGA ML605 Evaluation Kit **"); print("\n\r********************************************************"); print("\n\r********************************************************\r\n"); do { print("Choose Feature to Test:\r\n"); print("1: UART Test\r\n"); print("2: LED Test\r\n"); print("3: Timer Test\r\n"); print("4: FLASH Test\r\n"); print("5: IIC Test\r\n"); print("6: Ethernet Loopback Test\r\n"); print("7: Switch Test\r\n"); print("8: External Memory Test\r\n"); print("9: System Monitor Test\r\n"); print("A: PushButton Test\r\n"); print("B: LCD Test\r\n"); print("C: System ACE CF Test\r\n"); print("D: DVI/VGA Test\r\n"); choice = inbyte(); if (isalpha(choice)) { choice = toupper(choice); } } while (!isdigit(choice) && (choice < 'A' || choice > 'D')) ; xil_printf("%c\r\n", choice); if (choice < 'A') { choice -= '0'; } else { choice -= 'A'; choice += 10; } flbuf = (uint8_t*)(FLASH_IMAGE_BASEADDR + (choice * SECTOR_SIZE)); /* * Read the SRECORDS in the selected file into RAM. */ xil_printf("Reading SRECORDS from Linear BPI Flash at: 0x%x\r\n", (unsigned)flbuf); ret = load_exec (); /* If we reach here, we are in error */ #ifdef VERBOSE if (ret > LD_SREC_LINE_ERROR) { print ("ERROR in SREC line: "); putnum (srec_line); print (errors[ret]); } else { print ("ERROR: "); print (errors[ret]); } #endif return ret; }