QEMU平台构建基于PowerPC单核SoC并运行DES程序_第1页
QEMU平台构建基于PowerPC单核SoC并运行DES程序_第2页
QEMU平台构建基于PowerPC单核SoC并运行DES程序_第3页
QEMU平台构建基于PowerPC单核SoC并运行DES程序_第4页
QEMU平台构建基于PowerPC单核SoC并运行DES程序_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、 qemu平台构建基于平台构建基于powerpc单核单核soc 并运行并运行des程序程序彭会成冯彦朝outlineppc405 boarddma and timermemory mapbootloader问题qemu仿真ppc405运行des程序boardppc405_uc.c文件(文件(qemu powerpc 405 embedded processors emulation)dma dma controllerdma结构体定义接口,功能没有实现timerppc405_uc.c 文件中有文件中有 general purpose timers该模块和该模块和dma一样定义了接口没有实现功能

2、。一样定义了接口没有实现功能。memory map * - powerpc 405ep cpu * - sdram (0 x00000000) * - flash (0 xfff80000) * - sram (0 xfff00000) * - nvram (0 xf0000000) * - fpga (0 xf0300000) * - gpt (general purpose timers) (0 xef600000) * - serial ports (0 xef600300) * - opb arbitrer (0 xef600600) * - iic controller(0 xef6

3、00500) * - gpio (0 xef600700)bootloaderram_addr_t ppc405_set_bootinfo (cpuppcstate *env, ppc4xx_bd_info_t *bd, uint32_t flags) cpustate *cs = cpu(ppc_env_get_cpu(env); ram_addr_t bdloc; int i, n; /* we put the bd structure at the top of memory */ if (bd-bi_memsize = 0 x01000000ul) bdloc = 0 x0100000

4、0ul - sizeof(struct ppc4xx_bd_info_t); else bdloc = bd-bi_memsize - sizeof(struct ppc4xx_bd_info_t); stl_be_phys(cs-as, bdloc + 0 x00, bd-bi_memstart); stl_be_phys(cs-as, bdloc + 0 x04, bd-bi_memsize); stl_be_phys(cs-as, bdloc + 0 x08, bd-bi_flashstart); stl_be_phys(cs-as, bdloc + 0 x0c, bd-bi_flash

5、size); stl_be_phys(cs-as, bdloc + 0 x10, bd-bi_flashoffset); stl_be_phys(cs-as, bdloc + 0 x14, bd-bi_sramstart); stl_be_phys(cs-as, bdloc + 0 x18, bd-bi_sramsize); stl_be_phys(cs-as, bdloc + 0 x1c, bd-bi_bootflags); stl_be_phys(cs-as, bdloc + 0 x20, bd-bi_ipaddr); for (i = 0; i as, bdloc + 0 x24 + i

6、, bd-bi_enetaddri); bootloader stw_be_phys(cs-as, bdloc + 0 x2a, bd-bi_ethspeed); stl_be_phys(cs-as, bdloc + 0 x2c, bd-bi_intfreq); stl_be_phys(cs-as, bdloc + 0 x30, bd-bi_busfreq); stl_be_phys(cs-as, bdloc + 0 x34, bd-bi_baudrate); for (i = 0; i as, bdloc + 0 x38 + i, bd-bi_s_versioni); for (i = 0;

7、 i as, bdloc + 0 x3c + i, bd-bi_r_versioni); stl_be_phys(cs-as, bdloc + 0 x5c, bd-bi_plb_busfreq); stl_be_phys(cs-as, bdloc + 0 x60, bd-bi_pci_busfreq); for (i = 0; i as, bdloc + 0 x64 + i, bd-bi_pci_enetaddri); n = 0 x6a; if (flags & 0 x00000001) for (i = 0; i as, bdloc + n+, bd-bi_pci_enetaddr2i);

8、 stl_be_phys(cs-as, bdloc + n, bd-bi_opbfreq); n += 4; for (i = 0; i as, bdloc + n, bd-bi_iic_fasti); n += 4; return bdloc;bootloader ppc405_boards.c文件中调用了文件中调用了ppc405_set_bootinfo函数函数 bdloc = ppc405_set_bootinfo(env, &bd, 0 x00000001); env-gpr3 = bdloc; kernel_base = kernel_load_addr; /* now we can

9、 load the kernel */ kernel_size = load_image_targphys(kernel_filename, kernel_base, ram_size - kernel_base); if (kernel_size 0) fprintf(stderr, qemu: could not load kernel %sn, kernel_filename); exit(1); printf(load kernel size %ld at target_fmt_lx, kernel_size, kernel_base); 运行des程序交叉编译器交叉编译器eldk-5

10、.1 在一种计算机环境中运行的编译程序,能编译出在另外一种环境下运行的代码在一种计算机环境中运行的编译程序,能编译出在另外一种环境下运行的代码,我们就称这种编译器支持交叉编译。这个编译过程就叫交叉编译,我们就称这种编译器支持交叉编译。这个编译过程就叫交叉编译。 例如在例如在x86 ubuntu操作系统下面使用操作系统下面使用eldk-5.1编译编译c文件,使可执行文件文件,使可执行文件在在ppc405下可执行。下可执行。 1.配置编译环境配置编译环境 source /opt/eldk-5.1/powerpc-4xx-softfloat/environment- setup-ppc405-linux 2.编译编译des.cpp文件文件 powerpc-linux-g+ -static -o des405 des.cpp 运行des程序socubuntu:$ qemu-ppc -cpu 405 des405 请输入明文请输入明文(8个字符个字符):12345678请输入密钥请输入密钥(8个字符个字符):abcdefgh产生的密文为产生的密文为:2进制形式:进制形式:1101000011010110110100011110100100100001

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论