samples: micro: add a true hello world sample

Change-Id: I01707428ac49c3c35b2c8bcc625a21d88cf6eb33
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2015-12-18 09:54:07 -05:00
commit 3eecc42bd4
6 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,6 @@
MDEF_FILE = prj.mdef
KERNEL_TYPE = micro
BOARD ?= qemu_x86
CONF_FILE = prj.conf
include ${ZEPHYR_BASE}/Makefile.inc

View file

@ -0,0 +1,33 @@
Title: Synchronisation
Description:
A simple Hello World example using the microkernel.
--------------------------------------------------------------------------------
Building and Running Project:
This microkernel project outputs to the console. It can be built and executed
on QEMU as follows:
make qemu
--------------------------------------------------------------------------------
Troubleshooting:
Problems caused by out-dated project information can be addressed by
issuing one of the following commands then rebuilding the project:
make clean # discard results of previous builds
# but keep existing configuration info
or
make pristine # discard results of previous builds
# and restore pre-defined configuration info
--------------------------------------------------------------------------------
Sample Output:
Hello World!

View file

@ -0,0 +1,2 @@
# Use standard security profile. (=> no need for a random number generator)
CONFIG_STDOUT_CONSOLE=y

View file

@ -0,0 +1,5 @@
% Application : Hello demo
% TASK NAME PRIO ENTRY STACK GROUPS
% ==================================
TASK TASKA 7 main 2048 [EXE]

View file

@ -0,0 +1 @@
obj-y = main.o

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2012-2014 Wind River Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <zephyr.h>
#if defined(CONFIG_STDOUT_CONSOLE)
#include <stdio.h>
#define PRINT printf
#else
#include <misc/printk.h>
#define PRINT printk
#endif
void main(void)
{
PRINT("Hello World!\n");
}