我试图在QEMU(ver:qemu-2.5.0)上为ARM运行u-boot(ver:u-boot-2010.03-rc3)上的hello world程序
到目前为止,我已经创建了
-Hello_World.bin
-HelloWorld.uimg使用mkimage
- 然后将Hello_World和U-Boot二进制文件组合成一个图像并获得flash_hello.bin
现在,当我运行以下命令时,
./arm-softmmu/qemu-system-arm -M versatilepb -m 128M -serial stdio -kernel flash_hello.bin
QEMU弹出窗口是空白的,当我输入带有内核映像地址的bootm命令时
我在屏幕上获得了以下输出。谁能帮我这个。提前谢谢。
U-Boot 2010.03-rc3 (Mar 30 2016 - 19:35:25) DRAM: 0 kB Flash: 64 MB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: SMC91111-0 VersatilePB # bootm 0x24E10 ## Booting kernel from Legacy Image at 00024e10 ... Image Name: Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 140 Bytes = 0.1 kB Load Address: 00100000 Entry Point: 00100000 Loading Kernel Image ... OK OK Starting kernel ... C� �������� <= This is the output instead of hello world
Helloworld.c的内容:
volatile unsigned int * const UART0DR = (unsigned int *)0x101f1000;
void print_uart0(const char *s) {
while(*s != '\0') { /* Loop until end of string */
*UART0DR = (unsigned int)(*s); /* Transmit char */
s++; /* Next char */
}
}
void c_entry() {
print_uart0("Hello world!\n");
}
`