samples: nano: add a true hello world sample
This sample just prints 'Hello World', Nothing else. Change-Id: I93af3fdc2de342e878bc038f937e7f1ad2231bd3 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
ba860ba8e9
commit
14050f1a3f
5 changed files with 78 additions and 0 deletions
5
samples/nanokernel/apps/hello_world/Makefile
Normal file
5
samples/nanokernel/apps/hello_world/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
KERNEL_TYPE = nano
|
||||
BOARD ?= qemu_x86
|
||||
CONF_FILE = prj.conf
|
||||
|
||||
include ${ZEPHYR_BASE}/Makefile.inc
|
32
samples/nanokernel/apps/hello_world/README.txt
Normal file
32
samples/nanokernel/apps/hello_world/README.txt
Normal file
|
@ -0,0 +1,32 @@
|
|||
Title: Synchronisation
|
||||
|
||||
Description:
|
||||
|
||||
A simple 'Hello World' application.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Building and Running Project:
|
||||
|
||||
This nanokernel 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!
|
1
samples/nanokernel/apps/hello_world/prj.conf
Normal file
1
samples/nanokernel/apps/hello_world/prj.conf
Normal file
|
@ -0,0 +1 @@
|
|||
# nothing yet
|
1
samples/nanokernel/apps/hello_world/src/Makefile
Normal file
1
samples/nanokernel/apps/hello_world/src/Makefile
Normal file
|
@ -0,0 +1 @@
|
|||
obj-y += main.o
|
39
samples/nanokernel/apps/hello_world/src/main.c
Normal file
39
samples/nanokernel/apps/hello_world/src/main.c
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* 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
|
||||
|
||||
|
||||
/*
|
||||
* @file
|
||||
* @brief Hello World demo
|
||||
* Nanokernel version of hello world demo
|
||||
*/
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
PRINT("Hello World!\n");
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue