Hello World example from example-v2 not working with QEMU
Sambeet Panigrahi
sambeet161616 at gmail.com
Sat Aug 20 12:38:49 UTC 2016
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/
x86/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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160820/992b6c02/attachment.html>
More information about the users
mailing list