Hello world example not working on QEMU
Saeed Ehteshamifar
salpha.2004 at gmail.com
Mon Aug 22 16:32:53 UTC 2016
>
> QEMU doesn't show any error, just the blank screen, so I am not able to
> figure out what,s wrong with my code,can somebody help?
Nothing is wrong with your code. As Joel said, kernel arguments format
changed. So I guess for your own version of hello (from examples-v2), if
you invoke qemu with *-append "--console=com1" *rather than *-append
"--console=/dev/com1"*, it would work.
Have you configured RTEMS with USE_COM1_AS_CONSOLE=1 ?
On Sun, Aug 21, 2016 at 8:31 AM, Sambeet Panigrahi <sambeet161616 at gmail.com>
wrote:
> Hi,
> I followed the https://devel.rtems.org/wiki/Developer/Simulators/QEMU
> simulate RTEMS for i386. I used the hello world example from examples-v2
> repository. The source code is directly taken from RTEMS C user guide.
>
> /*
> * Classic API Hello World
> */
>
> #include <rtems.h> //Contains the RTEMS datatypes
> #include <stdlib.h>//Standard C library
> #include <stdio.h>//Standard C input ouput library
>
> rtems_task Init(
> rtems_task_argument ignored
> )
> {
> printf( "\n\n*** MODIFIED HELLO WORLD TEST ***\n" );
> printf( "Hello Sambeet!How are You?\n" );
> printf( "*** END OF MODIFIED HELLO WORLD TEST ***\n" );
> exit( 0 );
> }
>
> /* configuration information */
>
> #include <bsp.h>
>
> /* NOTICE: the clock driver is explicitly disabled */
> #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> #define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
>
> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
> #define CONFIGURE_MAXIMUM_TASKS 1
>
> #define CONFIGURE_INIT
> #include <rtems/confdefs.h>
> /* end of file */
>
> I compiled it using RTEMS GCC, the exact same commands as the makefile
> i.e.
>
> /home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/bin/i386-rtems4.11-gcc
> --pipe -B/home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/i386-rtems4.11/pc486/lib/
> -specs bsp_specs -qrtems -Wall -O2 -g -mtune=i486 -o
> o-optimize/test.exe test.c
>
> that was because makefile was showing some errors
>
> sambeet at Holmes ~/Documents/GitRepos/examples/
> examples-v2/hello/hello_world_c $ make
> i386-rtems4.11-gcc --pipe -B/home/sambeet/NewRockPort/x8
> 6/Install/rtems/4.11.0-rc3/i386-rtems4.11/pc486/lib/ -specs bsp_specs
> -qrtems -Wall -O2 -g -mtune=i486 -c -o o-optimize/test.o
> test.c
> /bin/bash: i386-rtems4.11-gcc: command not found
> make: *** [o-optimize/test.o] Error 127
>
> Now I generated the executable successfully but when I run it in QEMU.I
> get a blank screen.However when I try this which comes with i386
> testsuites, I get the output
>
> /*
> * COPYRIGHT (c) 1989-2012.
> * On-Line Applications Research Corporation (OAR).
> *
> * The license and distribution terms for this file may be
> * found in the file LICENSE in this distribution or at
> * http://www.rtems.org/license/LICENSE.
> */
>
> #ifdef HAVE_CONFIG_H
> #include "config.h"
> #endif
>
> #include <rtems/test.h>
>
> #include <bsp.h> /* for device driver prototypes */
>
> #include <stdio.h>
> #include <stdlib.h>
>
> /* forward declarations to avoid warnings */
> rtems_task Init(rtems_task_argument argument);
>
> const char rtems_test_name[] = "HELLO WORLD";
>
> rtems_task Init(
> rtems_task_argument ignored
> )
> {
> rtems_test_begin();
> printf( "Hello World\n" );
> rtems_test_end();
> exit( 0 );
> }
>
>
> /* NOTICE: the clock driver is explicitly disabled */
> #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
>
> #define CONFIGURE_MAXIMUM_TASKS 1
> #define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
>
> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
>
> #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
>
> #define CONFIGURE_INIT
> #include <rtems/confdefs.h>
>
> QEMU doesn't show any error, just the blank screen, so I am not able to
> figure out what,s wrong with my code,can somebody help?
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160822/cad950d8/attachment-0002.html>
More information about the users
mailing list