1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/cpu/native
2013-10-25 04:07:32 -07:00
..
include normalize stack defines 2013-10-25 11:40:33 +02:00
net initialize processing field in nativenet tap 2013-10-13 21:23:12 +02:00
rtc add rtc_time implementation for native 2013-10-25 11:53:45 +02:00
atomic_cpu.c fixed coding conventions (mostly by astyle) 2013-06-21 03:52:57 +02:00
hwtimer_cpu.c add time delta to hwtimer 2013-10-25 12:11:54 +02:00
irq_cpu.c implement graceful shutdown in native 2013-10-23 23:16:45 +02:00
lpm_cpu.c Fix some clang warnings in native 2013-08-30 17:03:34 +02:00
Makefile make Makefiles proof for spaces in $PATH 2013-10-09 15:28:53 +02:00
native_cpu.c valgrind support 2013-10-09 15:20:59 +02:00
README improve native README 2013-10-24 12:58:28 +02:00
startup.c fix unused startup parameter warnings 2013-08-21 15:13:09 +02:00
tapsetup-osx.sh native cc1100x_ng network 2013-08-15 14:05:26 +02:00
tapsetup.sh make tapsetup.sh more verbose 2013-08-29 16:16:47 +02:00
tramp.S fix signal handler context switch 2013-10-18 14:23:58 +02:00

VALGRIND SUPPORT
================

If you want to use valgrind, you should recompile native with either
HAVE_VALGRIND_H or HAVE_VALGRIND_VALGRIND_H depending on the location
of the valgrind header (i.e. <valgrind.h> or <valgrind/valgrind.h>)
like this:

    CFLAGS="-DHAVE_VALGRIND_VALGRIND_H" make

That way native can tell valgrind about RIOTs stacks and prevent
valgrind from reporting lots of false positives.

Usage:
Simply pass the ordinary command to valgrind like this:

    valgrind ./bin/RIOT.elf tap0

This will yield some information whenever valgrind detects an invalid
memory access.

In order to debug the program when this occurs you can pass the
--db-attach parameter to valgrind like this:

    valgrind --db-attach=yes ./bin/RIOT.elf tap0

Now, you will be asked whether you would like to attach the running
process to gdb whenever a problem occurs.

In order for this to work under Linux 3.4 or newer, you might need to
disable the ptrace access restrictions:
As root call:

    echo 0 > /proc/sys/kernel/yama/ptrace_scope


NETWORK SUPPORT
===============

If you compile RIOT for the native cpu and include the native_net
module, you need to specify a network interface like this:

    ./bin/default-native.elf tap0


SETTING UP A TAP NETWORK
========================

There is a shellscript in RIOT/cpu/native called tapsetup.sh which you
can use to create a network of tap interfaces.

Usage:
To create a bridge and two (or count at your option) tap interfaces:

    ./tapsetup.sh create [count]

To delete the bridge and all tap interfaces:

    ./tapsetup.sh delete


OSX TAP NETWORKING
==================

For tun/tap networking in OSX you will need:
http://tuntaposx.sourceforge.net/

For OSX there is a seperate script called tapsetup-osx.sh.
Run it, (it instructs you to start the RIOT instances).
In contrast to linux you will need to run 'tapsetup-osx.sh delete'
after killing your instances and rerun 'tapsetup-osx.sh create' before
restarting.
Packet delivery under OSX only works with user assistance at the
moment. run 'kill -SIGIO <RIOT process ID>' to deliver a packet to a
specific RIOT instance.