source: rtems/bsps/powerpc/motorola_powerpc/README.qemu

Last change on this file was eb36d11, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 25, 2018 at 1:06:08 PM

bsps: Move documentation, etc. files to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 5.1 KB
Line 
1The 'qemuprep'/'qemuprep-altivec' BSPs are variants of
2'motorola_powerpc' that can run under QEMU. They are *not*
3binary compatible with other variants of 'motorola_powerpc'
4(nor with each other).
5
6Most significant differences to real hardware:
7 - no OpenPIC, just a 8259 PIC (even though qemu implements an openpic
8   at least to some extent it is not configured into the prep platform
9   as of qemu-0.14.1).
10 - no VME (absense of the VME controller is detected by the BSP)
11 - the only network chip supported by both, qemu and vanilla RTEMS
12   is the ISA NE2000 controller. Note that the default interrupt line
13   settings used by RTEMS and QEMU differ: RTEMS uses 5 and QEMU 9.
14   This can be addressed by passing a RTEMS commandline option
15   --ne2k-irq=9.
16   Other controllers (i8559, e1000, pcnet) implemented by qemu can
17   also be used but require unbundled RTEMS drivers (libbsdport).
18   Note that the bundled 'if_fxp' has not been ported to PPC and works
19   on x86 only.
20 - unlike a real motorola board you can run qemu emulating a 7400 CPU
21   which features altivec. I.e., you can use this BSP (altivec-enabled
22   variant) to test altivec-enabled code.
23
24Compatibility: qemu had quite a few bugs related to the PREP platform.
25Version 0.12.4, for example, required patches. 0.14.1 seems to have
26fixed the show-stoppers. Hence, you *need* at least qemu-0.14.1 for
27this BSP; it should work without the need for patching QEMU.
28
29BIOS: qemu requires you to use a BIOS. The one that came with qemu
300.12.4 didn't work for me so I created a minimal dummy that provides
31enough functionality for the RTEMS bootloader to work.
32
33BSP Variants:
34You can compile the BSP for either a 604 CPU or a 7400 (altivec-enabled).
35Note that you cannot run the altivec-enabled BSP variant on a CPU w/o
36altivec/SIMD hardware. The non-altivec variant is called 'qemuprep'
37and the altivec-enabled one 'qemuprep-altivec'. Hence, you can
38configure RTEMS:
39
40604/non-altivec variant only:
41  configure --target=powerpc-rtems --enable-rtemsbsp=qemuprep
427400/altivec variant only:
43  configure --target=powerpc-rtems --enable-rtemsbsp=qemuprep-altivec
44both variants:
45  configure --target=powerpc-rtems --enable-rtemsbsp='qemuprep qemuprep-altivec'
46
47Building QEMU:
48In case you have no pre-built qemu-0.14.1 you can
49compile it yourself:
50
51cd qemu-0.14.1
52configure --target-list=ppc-softmmu
53make
54
55Running QEMU:
56A number of command-line options are important (BTW: make sure
57you run the PPC/PREP emulator and not a natively installed i386/PC
58emulating 'qemu')
59
60-M prep         --- select machine type: prep
61-cpu 604        --- select 604 CPU for non-altivec variant
62-cpu 7400       --- select 7400 CPU for altivec variant
63
64              NOTE: the 7455 and 7457 emulations are buggy as of
65              qemu-0.14.1 and they won't work.
66
67-bios <rtems-install-prefix>/powerpc-rtems/qemuprep/qemu_fakerom.bin
68-bios <rtems-install-prefix>/powerpc-rtems/qemuprep-altivec/qemu_fakerom.bin
69                --- select proprietary dummy 'BIOS'
70
71-nographic      --- redirect serial/IO to console where qemu is run
72
73-kernel <path>  --- path to your RTEMS executable (.ralf file, e.g., 'hello.ralf')
74-no-reboot      --- terminate after one run
75-append <arg>   --- RTEMS kernel comand line (use e.g., to modify
76                    ne2000 driver interrupt line)
77
78Networking:
79(We assume your RTEMS application is correctly configured and
80built for networking using the ne2k adapter [other adapters
81can be used with unbundled/libbsdport drivers])
82
83I use networking with a 'tap' interface on the host machine
84and can then communicate with the emulated target in any
85desired way.  The Ethernet address specified in the RTEMS network interface
86configuration and the Qemu command line must match, otherwise uni-cast frames
87are not received.  It is best to use a NULL pointer in the RTEMS network
88interface configuration for the Ethernet address, so that the default from Qemu
89is used.  Make sure that your firewall settings allow communication between
90different Qemu instances and your host.
91
92On (linux) host:
93
94# create a 'permanent' tap device that can be used by myself
95# (as non-root user).
96sudo tunctl -u `id -u`
97# configure tap0 interface
98sudo ifconfig tap0 10.1.1.1 netmask 255.255.255.0 up
99# provide a suitable dhcpd config file (for the emulated
100# platform to boot: IP address etc.
101#
102# execute dhcp on host
103sudo dhcpd -d tap0
104
105Start emulated prep platform:
106
107ppc-softmmu/qemu-system-ppc                               \
108    -M prep                                               \
109    -cpu 7400                                             \
110    -bios  <rtems-prefix>/powerpc-rtems/qemuprep-altivec/lib/qemu_fakerom.bin \
111    -kernel <my_path>/my_app.ralf                         \
112        -append --ne2k-irq=9                                  \
113    -nographic                                            \
114    -no-reboot                                            \
115    -net nic,model=ne2k_isa                               \
116    -net tap,vlan=0,ifname=tap0,script=no,downscript=no
117
118Again: if you use the non-altivec BSP variant, use -cpu 604
119and if you use the altivec-enabled variant then you MUST use
120-cpu 7400.
121
122Have fun.
123
124Till Straumann, 2011/07/18
Note: See TracBrowser for help on using the repository browser.