【发布时间】:2016-07-19 06:23:33
【问题描述】:
我正在尝试在 u-boot(版本:u-boot-2010.03-rc3)上为 QEMU(版本:qemu-2.5.0)上的 ARM 运行 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");
}
`
【问题讨论】:
-
如果您尝试运行标准的 hello world 示例独立应用程序会发生什么?