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:
parent
14050f1a3f
commit
3eecc42bd4
6 changed files with 77 additions and 0 deletions
6
samples/microkernel/apps/hello_world/Makefile
Normal file
6
samples/microkernel/apps/hello_world/Makefile
Normal file
|
@ -0,0 +1,6 @@
|
|||
MDEF_FILE = prj.mdef
|
||||
KERNEL_TYPE = micro
|
||||
BOARD ?= qemu_x86
|
||||
CONF_FILE = prj.conf
|
||||
|
||||
include ${ZEPHYR_BASE}/Makefile.inc
|
33
samples/microkernel/apps/hello_world/README.txt
Normal file
33
samples/microkernel/apps/hello_world/README.txt
Normal 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!
|
2
samples/microkernel/apps/hello_world/prj.conf
Normal file
2
samples/microkernel/apps/hello_world/prj.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Use standard security profile. (=> no need for a random number generator)
|
||||
CONFIG_STDOUT_CONSOLE=y
|
5
samples/microkernel/apps/hello_world/prj.mdef
Normal file
5
samples/microkernel/apps/hello_world/prj.mdef
Normal file
|
@ -0,0 +1,5 @@
|
|||
% Application : Hello demo
|
||||
|
||||
% TASK NAME PRIO ENTRY STACK GROUPS
|
||||
% ==================================
|
||||
TASK TASKA 7 main 2048 [EXE]
|
1
samples/microkernel/apps/hello_world/src/Makefile
Normal file
1
samples/microkernel/apps/hello_world/src/Makefile
Normal file
|
@ -0,0 +1 @@
|
|||
obj-y = main.o
|
30
samples/microkernel/apps/hello_world/src/main.c
Normal file
30
samples/microkernel/apps/hello_world/src/main.c
Normal 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");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue