Rtems-test with qemu integration for pc386

Krzysztof Mięsowicz krzysztof.miesowicz at gmail.com
Wed Jun 25 19:56:57 UTC 2014


Hi again and sorry for spam. Soon after writing mail to you I found the
solution (at least I think so :-D ).

I created rtems-boot.img using script from
http://www.rtems.org/wiki/index.php/Building_Grub .
I wrote grub.cfg with following lines:

serial --unit=0 --speed=115200
set root='hd1,msdos1'
terminal_output serial; terminal_input serial;

to redirect terminal output and input to serial. Then, I am able to run
arbitrary executable using following command (example for ticker):

qemu-system-i386 -m 128 -boot b -hda $HOME/qemu/hd/rtems-boot.img -hdb
fat:$HOME/qemu/hd -serial stdio -no-reboot -nographic -monitor null
--exec-trace ticker.exe.cov -kernel
/home/rtems/development/rtems/src/b-pc386/i386-rtems4.11/c/pc386/testsuites/samples/ticker/ticker.exe
-append "--console=com1;boot"

This simply boots executable specified as -kernel argument and appends
--console=com1;boot to grub multiboot specification. This results in
following output:

*** BEGIN OF TEST CLOCK TICK ***
TA1  - rtems_clock_get_tod - 09:00:00   12/31/1988
TA2  - rtems_clock_get_tod - 09:00:00   12/31/1988
TA3  - rtems_clock_get_tod - 09:00:00   12/31/1988
TA1  - rtems_clock_get_tod - 09:00:05   12/31/1988
TA2  - rtems_clock_get_tod - 09:00:10   12/31/1988
TA1  - rtems_clock_get_tod - 09:00:10   12/31/1988
TA3  - rtems_clock_get_tod - 09:00:15   12/31/1988
TA1  - rtems_clock_get_tod - 09:00:15   12/31/1988
TA2  - rtems_clock_get_tod - 09:00:20   12/31/1988
TA1  - rtems_clock_get_tod - 09:00:20   12/31/1988
TA1  - rtems_clock_get_tod - 09:00:25   12/31/1988
TA3  - rtems_clock_get_tod - 09:00:30   12/31/1988
TA1  - rtems_clock_get_tod - 09:00:30   12/31/1988
TA2  - rtems_clock_get_tod - 09:00:30   12/31/1988
*** END OF TEST CLOCK TICK ***

Additionaly, ticker.exe.cov is created. I think this is really good
soultion to use in coverage analysis within rtems-test. The question is
where rtems-boot.img and grub.cfg should be placed?



2014-06-25 21:11 GMT+02:00 Krzysztof Mięsowicz <
krzysztof.miesowicz at gmail.com>:

> Hi,
>
> I am currently working on rtems-test integration with qemu (especially
> couverture-qemu) for pc386 BSP. Up to now pc386 used two approaches:
>
> 1. It used pc386_fda floppy image which boots test.exe from the same
> directory
>
> tree:
> qemu/
>     hd/
>         pc386_fda
>         test.exe
>     install/
>        binaries of qemu
>
> command to run hello.exe:
> cp ${PATH_TO_SAMPLES}/hello/hello.exe ${QEMUDIR}/hd/test.exe
> qemu-system-i386 -m 256 -serial stdio -no-reboot -boot a -fda
> $HOME/qemu/pc386_fda -hda fat:$HOME/qemu/hd
>
> 2. pc386 rtems executables can be run on qemu using rtems-boot.img and
> rtems-grub.cfg. rtems-grub.cfg is specified within rtems-boot.img grub.cfg
> file as configfile - grub searches for it in specified location. So
> rtems-grub.cfg must contain grub configuration to boot proper executable.
> It may contain a lot of menu entries, but it may also look like this below:
>
> # start of rtems-grub.cfg file
> serial --unit=0 --speed=115200
> set root=(hd0,1)
> multiboot (hd0,1)/hello/hello.exe --console=com1
> boot
> # end of rtems-grub.cfg file
>
> tree:
> qemu/
>     hd/
>         rtems-boot.img
>         rtems-grub.cfg
>
> Then, using following command I can run executable specified in
> rtems-grub.cfg file:
> qemu-system-i386 -boot a -fda $HOME/qemu/hd/rtems-boot.img -hda
> fat:$HOME/development/rtems/src/b-pc386/i386-rtems4.11/c/pc386/testsuites/samples
> -hdb fat:$HOME/qemu/hd -monitor null -serial stdio --no-reboot -nographic
>
> Knowing these two approaches I wonder what should be best approach to use
> with rtems-test. I think that second approach is more suitable, however
> there should be some module which would prepare rtems-grub.cfg file for
> every test.
>
> Or maybe there exist some way to not writing this rtems-grub.cfg file, but
> instead specifying script which would be then passed to grub terminal. From
> what I see gdb is working in such way, where BSPs has specified gdb_script
> which is then passed to gdb.
>
> I hope you will give me advice how should it be done.
>
> Regards,
> Krzysztof Miesowicz
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140625/394fd88f/attachment-0002.html>


More information about the devel mailing list