Hello World example from example-v2 not working with QEMU
Saeed Ehteshamifar
salpha.2004 at gmail.com
Fri Aug 26 13:56:02 UTC 2016
Hi
I could run your application:
*$ qemu-system-i386 -kernel o-optimize/hello.exe -append
"--console=/dev/com1" -serial stdio*
i386: isr=0 irr=1
*** MODIFIED HELLO WORLD TEST ***
Hello Sambeet!How are You?
*** END OF MODIFIED HELLO WORLD TEST ***
FATAL ERROR - Executive shutdown! Any key to reboot...
I compiled it with the following Makefile:
#
# RTEMS_MAKEFILE_PATH is typically set in an environment variable
#
PGM=${ARCH}/hello.exe
# optional managers required
MANAGERS=all
# C source names
CSRCS = init.c
COBJS = $(CSRCS:%.c=${ARCH}/%.o)
include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(PROJECT_ROOT)/make/leaf.cfg
OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)
all: ${ARCH} $(PGM)
$(PGM): $(OBJS)
$(make-exe)
Alternatively, the following compile-command also worked:
$ i386-rtems4.12-gcc --pipe
-B/home/saeed/rtems/b-pc386/i386-rtems4.12/pc386/lib/ -specs bsp_specs
-qrtems -Wall -O2 -g -ffunction-sections -fdata-sections
-mtune=i386 -Wl,--gc-sections -Wl,-Ttext,0x00100000 -mtune=i386 -o
hello.exe init.c
On Fri, Aug 26, 2016 at 7:22 AM, Sambeet Panigrahi <sambeet161616 at gmail.com>
wrote:
> Hi
> I made the following changes to the commands in https://devel.rtems.org/
> wiki/Building/Grub for GRUB2
>
> set default="0"
> set timeout=10
> serial --unit=0 --speed=9600
> terminal serial
>
> menuentry "RTEMS Hello" {
> set root='hd1,msdos1'
> multiboot (hd1,msdos1)/examples/hello.exe --console=/dev/com1
> --printk=/dev/com1
> }
>
> And my qemu.sh file looks like
>
> #!/bin/bash
> qemu-system-i386 -m 128 -boot b -hda rtems-boot.img -hdb fat:. -serial
> stdio -no-reboot
>
> But the problem stays the same.The examples-v2/hello/hello_world_c/test.c
> file still does not compile whereas the one from pc386 bsp testsuite
> compiles.That's why I think there's something wrong with my code.
>
> The source code is:
>
> /*
> * 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 */
>
> And I compile it using this command.I don't understand where I am going
> wrong as this produces the executable.
>
> /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
>
>
>
> _______________________________________________
> 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/20160826/818694cb/attachment-0002.html>
More information about the users
mailing list