You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ad...@apache.org on 2016/02/20 03:52:09 UTC
[6/9] incubator-mynewt-site git commit: added pages for the Core OS
functions
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/shelltest/shelltest.md
----------------------------------------------------------------------
diff --git a/docs/modules/shelltest/shelltest.md b/docs/modules/shelltest/shelltest.md
deleted file mode 100644
index 45535b5..0000000
--- a/docs/modules/shelltest/shelltest.md
+++ /dev/null
@@ -1,92 +0,0 @@
-# Console
-
-
-The console is an operating system window where users interact with system programs of the operating system or a console application by entering text input (typically from a keyboard) and reading text output (typically on the computer terminal or monitor). The text written on the console brings some information and is a sequence of characters sent by the OS or programs running on the OS.
-
-Support is currently available for console access via the serial port on the hardware board.
-
-
-## Description
-
-In the Mynewt OS, the console library comes in two versions:
-
-* full - containing the full implementation
-* stub - containing stubs for the API
-
-Both of these have `egg.yml` file which states that they provide the `console` API. If an egg uses this API, it should list `console` as a requirement.
-For example, the shell egg is defined by the following egg.yml file:
-```no-highlight
- egg.name: libs/shell
- egg.vers: 0.1
- egg.deps:
- - libs/os
- - libs/util
- egg.reqs:
- - console
- egg.identities:
- - SHELL
-```
-The project .yml file decides which version of the console egg should be included.
-If project requires the full console capability it lists dependency `libs/console/full` in its egg.yml file.
-On the other hand, a project may not have a physical console (e.g. a UART port to connect a terminal to) but may have a dependency on an egg that has console capability. In that case you would use a console stub. Another example would be the bootloader project where we want to keep the size of the image small. It includes the `libs/os` egg that can print out messages on a console (e.g. if there is a hard fault) and the `libs/util` egg that uses full console (but only if SHELL is present to provide a CLI). However, we do not want to use any console I/O capability in this particular bootloader project to keep the size small. We simply use the console stub instead and the egg.yml file for the project boot egg looks like the following:
-```no-highlight
- project.name: boot
- project.identities: bootloader
- project.eggs:
- - libs/os
- - libs/bootutil
- - libs/nffs
- - libs/console/stub
- - libs/util
-```
-
-Console has 2 modes for transmit; blocking and non-blocking mode. Usually the non-blocking mode is the active one; the output buffer is drained by getting TX completion interrupts from hardware, and more data is added based on these interrupts.
-Blocking mode is used when we don't want TX completion interrupts. This is used when system crashes, and we still want to output info related to that crash.
-
-## Data structures
-
-
-Console interaction is intrinsically composed of two unidirectional systems. The console implementation uses two ring buffers containing input (receive) and output (transmit) characters, respectively. Read and write operations on the console_ring structure are managed by labeling the read location indicator the `cr_tail` and the write location indicator the `cr_head`. The console ring length is variable and is specified as the `cr_size` member of the data structure. `cr_buf` is the pointer to the actual array of data contained.
-
-
-```no-highlight
-struct console_ring {
- 32 uint8_t cr_head;
- 33 uint8_t cr_tail;
- 34 uint8_t cr_size;
- 35 uint8_t _pad;
- 36 uint8_t *cr_buf;
- 37 }
-```
-
-
-```no-highlight
-struct console_tty {
- 40 struct console_ring ct_tx;
- 41 uint8_t ct_tx_buf[CONSOLE_TX_BUF_SZ]; /* must be after console_ring */
- 42 struct console_ring ct_rx;
- 43 uint8_t ct_rx_buf[CONSOLE_RX_BUF_SZ]; /* must be after console_ring */
- 44 console_rx_cb ct_rx_cb; /* callback that input is ready */
- 45 console_write_char ct_write_char;
- 46 } console_tty
-```
-
-## List of Functions
-The functions available in shelltest are:
-
-* [imgmgr_module_init](imgmgr_module_init.md)
-* [imgr_boot_read](imgr_boot_read.md)
-* [imgr_boot_write](imgr_boot_write.md)
-* [imgr_file_download](imgr_file_download.md)
-* [imgr_file_upload](imgr_file_upload.md)
-* [imgr_list](imgr_list.md)
-* [imgr_noop](imgr_noop.md)
-* [imgr_read_file](imgr_read_file.md)
-* [imgr_read_main](imgr_read_main.md)
-* [imgr_read_test](imgr_read_test.md)
-* [imgr_read_ver](imgr_read_ver.md)
-* [imgr_upload](imgr_upload.md)
-* [imgr_ver_jsonstr](imgr_ver_jsonstr.md)
-* [imgr_ver_parse](imgr_ver_parse.md)
-* [imgr_ver_str](imgr_ver_str.md)
-* [imgr_write_file](imgr_write_file.md)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/testutil.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/testutil.md b/docs/modules/testutil/testutil.md
deleted file mode 100644
index 821f64b..0000000
--- a/docs/modules/testutil/testutil.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# testutil
-
-
-Insert synopsis here
-
-
-## Description
-
-Describe module here, special features, how pieces fit together etc.
-
-## Data structures
-
-Replace this with the list of data structures used, why, any neat features
-
-## List of Functions
-
-<Comments such as these instructions are placed within angle brackets. List all the functions here. Note how the anchors work. You put the text you want to show up as a link within [] and the relevant #heading within (). Note that the header has to have at least 2 words for the anchor to work - that's how it is. "no-highlight" disables syntax highlighting. You can enable it for a particular language by specifying what the language is instead of "no-highlight". Be warned that this highlighting or no-highlighting specification may not show up nicely on Mou.>
-
-The functions available in testutil are:
-
-* [tu_case_abort](tu_case_abort.md)
-* [tu_case_append_assert_msg](tu_case_append_assert_msg.md)
-* [tu_case_append_buf](tu_case_append_buf.md)
-* [tu_case_append_file_info](tu_case_append_file_info.md)
-* [tu_case_append_manual_pass_msg](tu_case_append_manual_pass_msg.md)
-* [tu_case_complete](tu_case_complete.md)
-* [tu_case_fail_assert](tu_case_fail_assert.md)
-* [tu_case_init](tu_case_init.md)
-* [tu_case_pass_manual](tu_case_pass_manual.md)
-* [tu_case_set_name](tu_case_set_name.md)
-* [tu_case_vappend_buf](tu_case_vappend_buf.md)
-* [tu_case_write_fail_buf](tu_case_write_fail_buf.md)
-* [tu_case_write_pass_auto](tu_case_write_pass_auto.md)
-* [tu_case_write_pass_buf](tu_case_write_pass_buf.md)
-* [tu_init](tu_init.md)
-* [tu_restart](tu_restart.md)
-* [tu_suite_init](tu_suite_init.md)
-* [tu_suite_set_name](tu_suite_set_name.md)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_abort.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_abort.md b/docs/modules/testutil/tu_case_abort.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_append_assert_msg.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_append_assert_msg.md b/docs/modules/testutil/tu_case_append_assert_msg.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_append_buf.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_append_buf.md b/docs/modules/testutil/tu_case_append_buf.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_append_file_info.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_append_file_info.md b/docs/modules/testutil/tu_case_append_file_info.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_append_manual_pass_msg.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_append_manual_pass_msg.md b/docs/modules/testutil/tu_case_append_manual_pass_msg.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_complete.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_complete.md b/docs/modules/testutil/tu_case_complete.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_fail_assert.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_fail_assert.md b/docs/modules/testutil/tu_case_fail_assert.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_init.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_init.md b/docs/modules/testutil/tu_case_init.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_pass_manual.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_pass_manual.md b/docs/modules/testutil/tu_case_pass_manual.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_set_name.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_set_name.md b/docs/modules/testutil/tu_case_set_name.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_vappend_buf.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_vappend_buf.md b/docs/modules/testutil/tu_case_vappend_buf.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_write_fail_buf.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_write_fail_buf.md b/docs/modules/testutil/tu_case_write_fail_buf.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_write_pass_auto.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_write_pass_auto.md b/docs/modules/testutil/tu_case_write_pass_auto.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_case_write_pass_buf.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_case_write_pass_buf.md b/docs/modules/testutil/tu_case_write_pass_buf.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_init.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_init.md b/docs/modules/testutil/tu_init.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_restart.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_restart.md b/docs/modules/testutil/tu_restart.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_suite_init.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_suite_init.md b/docs/modules/testutil/tu_suite_init.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/modules/testutil/tu_suite_set_name.md
----------------------------------------------------------------------
diff --git a/docs/modules/testutil/tu_suite_set_name.md b/docs/modules/testutil/tu_suite_set_name.md
deleted file mode 100644
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/newt/packaging/dist.md
----------------------------------------------------------------------
diff --git a/docs/newt/packaging/dist.md b/docs/newt/packaging/dist.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/callout.md
----------------------------------------------------------------------
diff --git a/docs/os/callout.md b/docs/os/callout.md
deleted file mode 100644
index cc7bbc6..0000000
--- a/docs/os/callout.md
+++ /dev/null
@@ -1,261 +0,0 @@
-# Callout
-
-Callouts are MyNewt OS timers.
-
-## Description
-
-Callout is a way of setting up an OS timer. When the timer fires, it is delivered as an event to task's event queue.
-
-User would initialize their callout structure using *os_callout_init()*, or *os_callout_func_init()* and then arm it with *os_callout_reset()*.
-
-If user wants to cancel the timer before it expires, they can either use *os_callout_reset()* to arm it for later expiry, or stop it altogether by calling *os_callout_stop()*.
-
-There are 2 different options for data structure to use. First is *struct os_callout*, which is a bare-bones version. You would initialize this with *os_callout_init()*.
-
-Second option is *struct os_callout_func*. This you can use if you expect to have multiple different types of timers in your task, running concurrently. The structure contains a function pointer, and you would call that function from your task's event processing loop.
-
-Time unit when arming the timer is OS ticks. This rate of this ticker depends on the platform this is running on. You should use OS define *OS_TICKS_PER_SEC* to convert wallclock time to OS ticks.
-
-Callout timer fires out just once. For periodic timer type of operation you need to rearm it once it fires.
-
-## Data structures
-
-```no-highlight
-struct os_callout {
- struct os_event c_ev;
- struct os_eventq *c_evq;
- uint32_t c_ticks;
- TAILQ_ENTRY(os_callout) c_next;
-};
-```
-
-| Element | Description |
-|---------|-------------|
-| c_ev | Event structure of this callout |
-| c_evq | Event queue where this callout is placed on timer expiry |
-| c_ticks | OS tick amount when timer fires |
-| c_next | Linkage to other unexpired callouts |
-
-```no-highlight
-struct os_callout_func {
- struct os_callout cf_c;
- os_callout_func_t cf_func;
- void *cf_arg;
-};
-```
-
-| Element | Description |
-|---------|-------------|
-| cf_c | struct os_callout. See above |
-| cf_func | Function pointer which should be called by event queue processing |
-| cf_arg | Generic void * argument to that function |
-
-## List of Functions
-
-
-The functions available in this OS feature are:
-
-* [os_callout_init](#os_callout_init)
-* [os_callout_func_init](#os_callout_func_init)
-* [os_callout_stop](#os_callout_stop)
-* [os_callout_reset](#os_callout_reset)
-* [os_callout_queued](#os_callout_queued)
-
-## Function Reference
-
-------------------
-
-## <font color="#F2853F" style="font-size:24pt">os_callout_init </font>
-
-```no-highlight
-void os_callout_init(struct os_callout *c, struct os_eventq *evq, void *ev_arg)
-```
-
-Initializes *struct os_callout*. Event type will be set to *OS_EVENT_T_TIMER*.
-
-
-#### Arguments
-
-| Arguments | Description |
-|-----------|-------------|
-| c | Pointer to os_callout to initialize |
-| evq | Event queue where this gets delivered to |
-| ev_arg | Generic argument which is filled in for the event |
-
-#### Returned values
-
-N/A
-
-#### Notes
-
-Be careful not to call this if the callout is armed, because that will mess up the list of pending callouts.
-Or if the timer has already fired, it will mess up the event queue where the callout was delivered to.
-
-#### Example
-
-<Add text to set up the context for the example here>
-
-```no-highlight
-struct os_eventq my_evq;
-struct os_callout my_callouts[8];
-
- for (i = 0; i < 8; i++) {
- os_callout_init(&my_callouts[i], &my_evq, (void *)i);
- }
-```
-
----------------------
-
-## <font color="#F2853F" style="font-size:24pt"> os_callout_func_init </font>
-
-```no-highlight
-void os_callout_func_init(struct os_callout_func *cf, struct os_eventq *evq, os_callout_func_t timo_func, void *ev_arg)
-```
-
-Initializes the given *struct os_callout_func*. Data structure is filled in with elements given as argument.
-
-
-#### Arguments
-
-| Arguments | Description |
-|-----------|-------------|
-| cf | Pointer to os_callout_func being initialized |
-| evq | Event queue where this gets delivered to |
-| timo_func | Timeout function. Event processing should call this |
-| ev_arg | Generic argument for the event |
-
-#### Returned values
-
-N/A
-
-#### Notes
-
-The same notes as with *os_callout_init()*.
-
-#### Example
-
-<Add text to set up the context for the example here>
-
-```no-highlight
-struct os_callout_func g_native_cputimer;
-struct os_eventq g_native_cputime_evq;
-void native_cputimer_cb(void *arg);
-
- /* Initialize the callout function */
- os_callout_func_init(&g_native_cputimer,
- &g_native_cputime_evq,
- native_cputimer_cb,
- NULL);
-
-```
-
-
----------------------
-
-## <font color="#F2853F" style="font-size:24pt"> os_callout_stop </font>
-
-```no-highlight
-void os_callout_stop(struct os_callout *c)
-```
-
-Disarms a timer.
-
-
-#### Arguments
-
-| Arguments | Description |
-|-----------|-------------|
-| c | Pointer to os_callout being stopped |
-
-
-#### Returned values
-
-N/A
-
-#### Notes
-
-
-
-#### Example
-
-<Add text to set up the context for the example here>
-
-```no-highlight
-struct os_callout_func g_native_cputimer;
-
- os_callout_stop(&g_native_cputimer.cf_c);
-```
-
-
----------------------
-
-## <font color="#F2853F" style="font-size:24pt"> os_callout_reset </font>
-
-```no-highlight
-void os_callout_reset(struct os_callout *c, int32_t timo)
-```
-
-Resets the callout to happen *timo* in OS ticks.
-
-
-#### Arguments
-
-| Arguments | Description |
-|-----------|-------------|
-| c | Pointer to os_callout being reset |
-| timo | OS ticks the timer is being set to |
-
-
-#### Returned values
-
-N/A
-
-#### Notes
-
-
-
-#### Example
-
-<Add text to set up the context for the example here>
-
-```no-highlight
- /* Re-start the timer (run every 50 msecs) */
- os_callout_reset(&g_bletest_timer.cf_c, OS_TICKS_PER_SEC / 20);
-```
-
----------------------
-
-## <font color="#F2853F" style="font-size:24pt">os_callout_queued</font>
-
-```no-highlight
-int os_callout_queued(struct os_callout *c)
-```
-
-Tells whether the callout has been armed or not.
-
-
-#### Arguments
-
-| Arguments | Description |
-|-----------|-------------|
-| c | Pointer to callout being checked |
-
-#### Returned values
-
-0: timer is not armed
-non-zero: timer is armed
-
-#### Notes
-
-
-
-#### Example
-
-<Add text to set up the context for the example here>
-
-```no-highlight
-<Insert the code snippet here>
-```
-
----------------------
-
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/context_switch.md
----------------------------------------------------------------------
diff --git a/docs/os/context_switch.md b/docs/os/context_switch.md
deleted file mode 100644
index f4c4276..0000000
--- a/docs/os/context_switch.md
+++ /dev/null
@@ -1,141 +0,0 @@
-# Scheduler/Context Switching
-
-
-Insert synopsis here
-
-
-## Description
-
-Describe scheduler here
-
-## Data structures
-
-Replace this with the list of data structures used, why, any neat features
-
-## List of Functions
-
-<Comments such as these instructions are placed within angle brackets. List all the functions here. Note how the anchors work. You put the text you want to show up as a link within [] and the relevant #heading within (). Note that the header has to have at least 2 words for the anchor to work - that's how it is. "no-highlight" disables syntax highlighting. You can enable it for a particular language by specifying what the language is instead of "no-highlight". Be warned that this highlighting or no-highlighting specification may not show up nicely on Mou.>
-
-The functions available in the scheduler are:
-
-* [os_sched_insert](#os_sched_insert)
-* [os_sched_walk](#os_sched_walk)
-* add the rest
-
-
-## Function Reference
-
-------------------
-
-### <font color="#F2853F" style="font-size:24pt"> os_sched_insert</font>
-
-```no-highlight
- os_error_t
- os_sched_insert(struct os_task *t)
-```
-
-<Insert short description>
-
-
-#### Arguments
-
-| Arguments | Description |
-|-----------|-------------|
-| xx | explain argument xx |
-| yy | explain argument yy |
-
-#### Returned values
-
-List any values returned.
-Error codes?
-
-#### Notes
-
-Any special feature/special benefit that we want to tout.
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).
-
-#### Example
-
-<Add text to set up the context for the example here>
-
-```no-highlight
-<Insert the code snippet here>
-```
-
----------------------
-
-### <font color="#F2853F" style="font-size:24pt"> os_sched_walk</font>
-
-```no-highlight
-<Insert function callout here >
-```
-
-<Insert short description>
-
-
-#### Arguments
-
-| Arguments | Description |
-|-----------|-------------|
-| xx | explain argument xx |
-| yy | explain argument yy |
-
-#### Returned values
-
-List any values returned.
-Error codes?
-
-#### Notes
-
-Any special feature/special benefit that we want to tout.
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).
-
-#### Example
-
-<Add text to set up the context for the example here>
-
-```no-highlight
-<Insert the code snippet here>
-```
-
----------------------
-
-### <font color="#F2853F" style="font-size:24pt"> next_one </font>
-
-```no-highlight
-<Insert function callout here >
-```
-
-<Insert short description>
-
-
-#### Arguments
-
-| Arguments | Description |
-|-----------|-------------|
-| xx | explain argument xx |
-| yy | explain argument yy |
-
-#### Returned values
-
-List any values returned.
-Error codes?
-
-#### Notes
-
-Any special feature/special benefit that we want to tout.
-Does it need to be used with some other specific functions?
-Any caveats to be careful about (e.g. high memory requirements).
-
-#### Example
-
-<Add text to set up the context for the example here>
-
-```no-highlight
-<Insert the code snippet here>
-```
-
----------------------
-
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/callout/callout.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/callout/callout.md b/docs/os/core_os/callout/callout.md
new file mode 100644
index 0000000..2facdfa
--- /dev/null
+++ b/docs/os/core_os/callout/callout.md
@@ -0,0 +1,62 @@
+# Callout
+
+Callouts are MyNewt OS timers.
+
+## Description
+
+Callout is a way of setting up an OS timer. When the timer fires, it is delivered as an event to task's event queue.
+
+User would initialize their callout structure using *os_callout_init()*, or *os_callout_func_init()* and then arm it with *os_callout_reset()*.
+
+If user wants to cancel the timer before it expires, they can either use *os_callout_reset()* to arm it for later expiry, or stop it altogether by calling *os_callout_stop()*.
+
+There are 2 different options for data structure to use. First is *struct os_callout*, which is a bare-bones version. You would initialize this with *os_callout_init()*.
+
+Second option is *struct os_callout_func*. This you can use if you expect to have multiple different types of timers in your task, running concurrently. The structure contains a function pointer, and you would call that function from your task's event processing loop.
+
+Time unit when arming the timer is OS ticks. This rate of this ticker depends on the platform this is running on. You should use OS define *OS_TICKS_PER_SEC* to convert wallclock time to OS ticks.
+
+Callout timer fires out just once. For periodic timer type of operation you need to rearm it once it fires.
+
+## Data structures
+
+```no-highlight
+struct os_callout {
+ struct os_event c_ev;
+ struct os_eventq *c_evq;
+ uint32_t c_ticks;
+ TAILQ_ENTRY(os_callout) c_next;
+};
+```
+
+| Element | Description |
+|---------|-------------|
+| c_ev | Event structure of this callout |
+| c_evq | Event queue where this callout is placed on timer expiry |
+| c_ticks | OS tick amount when timer fires |
+| c_next | Linkage to other unexpired callouts |
+
+```no-highlight
+struct os_callout_func {
+ struct os_callout cf_c;
+ os_callout_func_t cf_func;
+ void *cf_arg;
+};
+```
+
+| Element | Description |
+|---------|-------------|
+| cf_c | struct os_callout. See above |
+| cf_func | Function pointer which should be called by event queue processing |
+| cf_arg | Generic void * argument to that function |
+
+## List of Functions
+
+The functions available in callout are:
+
+* [os_callout_func_init](os_callout_func_init)
+* [os_callout_init](os_callout_init)
+* [os_callout_queued](os_callout_queued)
+* [os_callout_reset](os_callout_reset)
+* [os_callout_stop](os_callout_stop)
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/callout/os_callout_func_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/callout/os_callout_func_init.md b/docs/os/core_os/callout/os_callout_func_init.md
new file mode 100644
index 0000000..a80092a
--- /dev/null
+++ b/docs/os/core_os/callout/os_callout_func_init.md
@@ -0,0 +1,45 @@
+## <font color="#F2853F" style="font-size:24pt"> os_callout_func_init </font>
+
+```no-highlight
+void os_callout_func_init(struct os_callout_func *cf, struct os_eventq *evq, os_callout_func_t timo_func, void *ev_arg)
+```
+
+Initializes the given *struct os_callout_func*. Data structure is filled in with elements given as argument.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| cf | Pointer to os_callout_func being initialized |
+| evq | Event queue where this gets delivered to |
+| timo_func | Timeout function. Event processing should call this |
+| ev_arg | Generic argument for the event |
+
+#### Returned values
+
+N/A
+
+#### Notes
+
+The same notes as with *os_callout_init()*.
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+struct os_callout_func g_native_cputimer;
+struct os_eventq g_native_cputime_evq;
+void native_cputimer_cb(void *arg);
+
+ /* Initialize the callout function */
+ os_callout_func_init(&g_native_cputimer,
+ &g_native_cputime_evq,
+ native_cputimer_cb,
+ NULL);
+
+```
+
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/callout/os_callout_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/callout/os_callout_init.md b/docs/os/core_os/callout/os_callout_init.md
new file mode 100644
index 0000000..920f398
--- /dev/null
+++ b/docs/os/core_os/callout/os_callout_init.md
@@ -0,0 +1,40 @@
+## <font color="#F2853F" style="font-size:24pt">os_callout_init </font>
+
+```no-highlight
+void os_callout_init(struct os_callout *c, struct os_eventq *evq, void *ev_arg)
+```
+
+Initializes *struct os_callout*. Event type will be set to *OS_EVENT_T_TIMER*.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| c | Pointer to os_callout to initialize |
+| evq | Event queue where this gets delivered to |
+| ev_arg | Generic argument which is filled in for the event |
+
+#### Returned values
+
+N/A
+
+#### Notes
+
+Be careful not to call this if the callout is armed, because that will mess up the list of pending callouts.
+Or if the timer has already fired, it will mess up the event queue where the callout was delivered to.
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+struct os_eventq my_evq;
+struct os_callout my_callouts[8];
+
+ for (i = 0; i < 8; i++) {
+ os_callout_init(&my_callouts[i], &my_evq, (void *)i);
+ }
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/callout/os_callout_queued.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/callout/os_callout_queued.md b/docs/os/core_os/callout/os_callout_queued.md
new file mode 100644
index 0000000..02fbf6c
--- /dev/null
+++ b/docs/os/core_os/callout/os_callout_queued.md
@@ -0,0 +1,34 @@
+## <font color="#F2853F" style="font-size:24pt">os_callout_queued</font>
+
+```no-highlight
+int os_callout_queued(struct os_callout *c)
+```
+
+Tells whether the callout has been armed or not.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| c | Pointer to callout being checked |
+
+#### Returned values
+
+0: timer is not armed
+non-zero: timer is armed
+
+#### Notes
+
+
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+<Insert the code snippet here>
+```
+
+---------------------
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/callout/os_callout_reset.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/callout/os_callout_reset.md b/docs/os/core_os/callout/os_callout_reset.md
new file mode 100644
index 0000000..645abf0
--- /dev/null
+++ b/docs/os/core_os/callout/os_callout_reset.md
@@ -0,0 +1,35 @@
+## <font color="#F2853F" style="font-size:24pt"> os_callout_reset </font>
+
+```no-highlight
+void os_callout_reset(struct os_callout *c, int32_t timo)
+```
+
+Resets the callout to happen *timo* in OS ticks.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| c | Pointer to os_callout being reset |
+| timo | OS ticks the timer is being set to |
+
+
+#### Returned values
+
+N/A
+
+#### Notes
+
+
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+ /* Re-start the timer (run every 50 msecs) */
+ os_callout_reset(&g_bletest_timer.cf_c, OS_TICKS_PER_SEC / 20);
+```
+
+---------------------
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/callout/os_callout_stop.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/callout/os_callout_stop.md b/docs/os/core_os/callout/os_callout_stop.md
new file mode 100644
index 0000000..c1a681c
--- /dev/null
+++ b/docs/os/core_os/callout/os_callout_stop.md
@@ -0,0 +1,36 @@
+## <font color="#F2853F" style="font-size:24pt"> os_callout_stop </font>
+
+```no-highlight
+void os_callout_stop(struct os_callout *c)
+```
+
+Disarms a timer.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| c | Pointer to os_callout being stopped |
+
+
+#### Returned values
+
+N/A
+
+#### Notes
+
+
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+struct os_callout_func g_native_cputimer;
+
+ os_callout_stop(&g_native_cputimer.cf_c);
+```
+
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/context_switch.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/context_switch.md b/docs/os/core_os/context_switch/context_switch.md
new file mode 100644
index 0000000..9cb8297
--- /dev/null
+++ b/docs/os/core_os/context_switch/context_switch.md
@@ -0,0 +1,29 @@
+# Scheduler/Context Switching
+
+
+Insert synopsis here
+
+
+## Description
+
+Describe scheduler here
+
+## Data structures
+
+Replace this with the list of data structures used, why, any neat features
+
+## List of Functions
+
+
+The functions available in context_switch are:
+
+* [os_sched](os_sched.md)
+* [os_sched_ctx_sw_hook](os_sched_ctx_sw_hook.md)
+* [os_sched_get_current_task](os_sched_get_current_task.md)
+* [os_sched_insert](os_sched_insert.md)
+* [os_sched_next_task](os_sched_next_task.md)
+* [os_sched_os_timer_exp](os_sched_os_timer_exp.md)
+* [os_sched_resort](os_sched_resort.md)
+* [os_sched_set_current_task](os_sched_set_current_task.md)
+* [os_sched_sleep](os_sched_sleep.md)
+* [os_sched_wakeup](os_sched_wakeup.md)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched.md b/docs/os/core_os/context_switch/os_sched.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched_ctx_sw_hook.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched_ctx_sw_hook.md b/docs/os/core_os/context_switch/os_sched_ctx_sw_hook.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched_get_current_task.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched_get_current_task.md b/docs/os/core_os/context_switch/os_sched_get_current_task.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched_insert.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched_insert.md b/docs/os/core_os/context_switch/os_sched_insert.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched_next_task.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched_next_task.md b/docs/os/core_os/context_switch/os_sched_next_task.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched_os_timer_exp.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched_os_timer_exp.md b/docs/os/core_os/context_switch/os_sched_os_timer_exp.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched_resort.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched_resort.md b/docs/os/core_os/context_switch/os_sched_resort.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched_set_current_task.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched_set_current_task.md b/docs/os/core_os/context_switch/os_sched_set_current_task.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched_sleep.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched_sleep.md b/docs/os/core_os/context_switch/os_sched_sleep.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/context_switch/os_sched_wakeup.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/context_switch/os_sched_wakeup.md b/docs/os/core_os/context_switch/os_sched_wakeup.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/event_queue/event_queue.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/event_queue/event_queue.md b/docs/os/core_os/event_queue/event_queue.md
new file mode 100644
index 0000000..9469326
--- /dev/null
+++ b/docs/os/core_os/event_queue/event_queue.md
@@ -0,0 +1,66 @@
+# Event Queues
+
+
+Event queue is a way of serializing events arring to a task. This makes it easy to queue processing to happen inside task's context. This would be done either from an interrupt handler, or from another task.
+
+Events arrive in a form of a data structure *struct os_event*.
+
+## Description
+
+Events are in form of a data structure *struct os_event*, and they are queued to data structure *struct os_eventq*.
+
+Queue must be initialized before trying to add events to it. This is done using *os_eventq_init()*.
+
+Common way of using event queues is to have a task loop while calling *os_eventq_get()*, waiting for work to do.
+Other tasks (or interrupts) then call *os_eventq_put()* to wake it up. Once event has been queued task waiting on that queue is woken up, and will get a pointer to queued event structure.
+Processing task would then act according to event type.
+
+When *os_event* is queued, it should not be freed until processing task is done with it.
+
+It is assumed that there is only one task consuming events from an event queue. Only one task should be sleeping on a particular *os_eventq* at a time.
+
+Note that os_callout subsystem assumes that event queue is used as the wakeup mechanism.
+
+## Data structures
+
+```no-highlight
+struct os_event {
+ uint8_t ev_queued;
+ uint8_t ev_type;
+ void *ev_arg;
+ STAILQ_ENTRY(os_event) ev_next;
+};
+```
+
+| Element | Description |
+|---------|-------------|
+| ev_queued | Internal field, which tells whether event is linked into an *os_eventq* already |
+| ev_type | Type of an event. This should be unique, as it should be used by processing task to figure out what the event means |
+| ev_arg | Can be used further as input to task processing this event |
+| ev_next | Linkage attaching this event to an event queue |
+
+
+```no-highlight
+struct os_eventq {
+ struct os_task *evq_task;
+ STAILQ_HEAD(, os_event) evq_list;
+};
+```
+
+
+| Element | Description |
+|---------|-------------|
+| evq_task | Pointer to task if there is task sleeping on *os_eventq_get()* |
+| evq_list | Queue head for list of events in this queue |
+
+## List of Functions
+
+
+The functions available in event queue feature are:
+
+* [os_eventq_get](os_eventq_get)
+* [os_eventq_init](os_eventq_init)
+* [os_eventq_put](os_eventq_put)
+* [os_eventq_put2](os_eventq_put2)
+* [os_eventq_remove](os_eventq_remove)
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/event_queue/os_eventq_get.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/event_queue/os_eventq_get.md b/docs/os/core_os/event_queue/os_eventq_get.md
new file mode 100644
index 0000000..1c1e3eb
--- /dev/null
+++ b/docs/os/core_os/event_queue/os_eventq_get.md
@@ -0,0 +1,40 @@
+## <font color="#F2853F" style="font-size:24pt"> os_eventq_get</font>
+
+```no-highlight
+void
+os_eventq_get(struct os_eventq *evq)
+```
+
+Fetches the first event from a queue. Task will sleep until something gets queued.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| evq | Queue to wait on |
+
+
+#### Returned values
+
+Will return with a pointer to first *struct event* which is in the queue.
+
+#### Notes
+
+
+#### Example
+
+Main loop of an example task.
+
+```no-highlight
+ while (1) {
+ ev = os_eventq_get(&task1_evq);
+ assert(ev);
+ if (ev->ev_type == CONS_EV_TYPE) {
+ /* XXX do stuff */
+ }
+ }
+
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/event_queue/os_eventq_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/event_queue/os_eventq_init.md b/docs/os/core_os/event_queue/os_eventq_init.md
new file mode 100644
index 0000000..2cfd2a5
--- /dev/null
+++ b/docs/os/core_os/event_queue/os_eventq_init.md
@@ -0,0 +1,45 @@
+## <font color="F2853F" style="font-size:24pt"> os_eventq_init</font>
+
+```no-highlight
+ void
+ os_eventq_init(struct os_eventq *evq)
+```
+
+Initializes *struct os_eventq*, making it ready for use.
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| evq | Pointer to event queue getting initialized |
+
+#### Returned values
+
+None
+
+#### Notes
+
+Usually done at subsystem init time; before OS has been started, and before interrupts generating events have been enabled.
+
+
+#### Example
+
+<Add text to set up the context for the example here>
+This initializes event queue used by newtmgr task.
+
+
+```no-highlight
+struct os_eventq g_nmgr_evq;
+
+int
+nmgr_task_init(uint8_t prio, os_stack_t *stack_ptr, uint16_t stack_len)
+{
+ /* variable declarations here */
+
+ os_eventq_init(&g_nmgr_evq);
+
+ /* initialization continues here */
+}
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/event_queue/os_eventq_put.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/event_queue/os_eventq_put.md b/docs/os/core_os/event_queue/os_eventq_put.md
new file mode 100644
index 0000000..aad5826
--- /dev/null
+++ b/docs/os/core_os/event_queue/os_eventq_put.md
@@ -0,0 +1,49 @@
+## <font color="#F2853F" style="font-size:24pt"> os_eventq_put</font>
+
+```no-highlight
+void
+os_eventq_put(struct os_eventq *evq, struct os_event *ev)
+```
+
+Queues an event to tail of the event queue.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| evq | Queue where event is being placed |
+| ev | Event which is being queued |
+
+
+#### Returned values
+
+N/A
+
+#### Notes
+
+Functionality is of *os_eventq_put2()*, but this is to be called from a task context only.
+
+#### Example
+
+<Add text to set up the context for the example here>
+This is used to pass info about an event to a task handling it.
+
+```no-highlight
+ /* Get an event structure off the queue */
+ ev = (struct os_event *)os_memblock_get(&g_hci_os_event_pool);
+ if (!ev) {
+ err = os_memblock_put(&g_hci_cmd_pool, hci_ev);
+ assert(err == OS_OK);
+ return -1;
+ }
+
+ /* Fill out the event and post to Link Layer */
+ ev->ev_queued = 0;
+ ev->ev_type = BLE_HOST_HCI_EVENT_CTLR_EVENT;
+ ev->ev_arg = hci_ev;
+ os_eventq_put(&ble_hs_evq, ev);
+
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/event_queue/os_eventq_put2.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/event_queue/os_eventq_put2.md b/docs/os/core_os/event_queue/os_eventq_put2.md
new file mode 100644
index 0000000..6894ebd
--- /dev/null
+++ b/docs/os/core_os/event_queue/os_eventq_put2.md
@@ -0,0 +1,41 @@
+## <font color="#F2853F" style="font-size:24pt"> os_eventq_put2</font>
+
+```no-highlight
+void
+os_eventq_put2(struct os_eventq *evq, struct os_event *ev, int isr)
+```
+
+Queues an event to tail of the event queue.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| evq | Queue where event is being placed |
+| ev | Event which is being queued |
+| isr | Tells whether call is being made from within interrupt handler or not |
+
+#### Returned values
+
+N/A
+
+#### Notes
+
+If the event has already been queued, nothing happens. Including event's relative position within the queue itself.
+
+This can be called either from interrupt handler (in which case *isr* should be set to 1), or from another task context (in which case *isr should be set as 0).
+
+#### Example
+
+This wakes up the task waiting on task1_evq, which processes console input (console input comes from UART, and is passed in in interrupt context).
+
+```no-highlight
+static void
+my_cons_input(int full_line)
+{
+ os_eventq_put2(&task1_evq, &cons_ev, 1);
+}
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/event_queue/os_eventq_remove.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/event_queue/os_eventq_remove.md b/docs/os/core_os/event_queue/os_eventq_remove.md
new file mode 100644
index 0000000..08583e7
--- /dev/null
+++ b/docs/os/core_os/event_queue/os_eventq_remove.md
@@ -0,0 +1,36 @@
+## <font color="#F2853F" style="font-size:24pt"> os_eventq_remove</font>
+
+```no-highlight
+void
+os_eventq_remove(struct os_eventq *evq, struct os_event *ev)
+```
+
+Removes an event which has been placed in a queue.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| evq | Queue where event is being removed from |
+| ev | Event which is being removed |
+
+
+#### Returned values
+
+N/A
+
+#### Notes
+
+
+#### Example
+
+<Add text to set up the context for the example here>
+This is from os_callout_stop(). User wants to stop a callout from getting passed to a task. If the event has already been queued, then remove it before it is seen.
+
+```no-highlight
+ if (c->c_evq) {
+ os_eventq_remove(c->c_evq, &c->c_ev);
+ }
+```
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/heap/heap.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/heap/heap.md b/docs/os/core_os/heap/heap.md
new file mode 100644
index 0000000..5599d71
--- /dev/null
+++ b/docs/os/core_os/heap/heap.md
@@ -0,0 +1,25 @@
+# Heap
+
+
+API for doing dynamic memory allocation.
+
+
+## Description
+
+This provides malloc()/free() functionality with locking. The shared resource heap needs to be protected from concurrent access when OS has been started. *os_malloc()* function grabs a mutex before calling *malloc()*.
+
+## Data structures
+
+N/A
+
+## List of Functions
+
+
+The functions available in heap are:
+
+* [os_free](os_free)
+* [os_malloc](os_malloc)
+* [os_realloc](os_realloc)
+
+
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/heap/os_free.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/heap/os_free.md b/docs/os/core_os/heap/os_free.md
new file mode 100644
index 0000000..e13be51
--- /dev/null
+++ b/docs/os/core_os/heap/os_free.md
@@ -0,0 +1,32 @@
+## <font color="F2853F" style="font-size:24pt">os_free</font>
+
+```no-highlight
+void os_free(void *mem)
+```
+
+Frees previously allocated memory back to the heap.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| mem | Pointer to memory being released |
+
+#### Returned values
+
+N/A
+
+#### Notes
+
+Calls C-library *free()* behind the covers.
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+ os_free(info);
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/heap/os_malloc.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/heap/os_malloc.md b/docs/os/core_os/heap/os_malloc.md
new file mode 100644
index 0000000..296fd00
--- /dev/null
+++ b/docs/os/core_os/heap/os_malloc.md
@@ -0,0 +1,39 @@
+## <font color="F2853F" style="font-size:24pt"> os_malloc</font>
+
+```no-highlight
+void *os_malloc(size_t size)
+```
+
+Allocates *size* number of bytes from heap and returns a pointer to it.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| size | Number of bytes to allocate |
+
+#### Returned values
+
+<ptr>: pointer to memory allocated from heap.
+NULL: not enough memory available.
+
+#### Notes
+
+*os_malloc()* calls *malloc()*, which is provided by C-library. The heap must be set up during platform initialization.
+Depending on which C-library you use, you might have to do the heap setup differently. Most often *malloc()* implementation will maintain a list of allocated and then freed memory blocks. If user asks for memory which cannot be satisfied from free list, they'll call platform's *sbrk()*, which then tries to grow the heap.
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+ info = (struct os_task_info *) os_malloc(
+ sizeof(struct os_task_info) * tcount);
+ if (!info) {
+ rc = -1;
+ goto err;
+ }
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/heap/os_realloc.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/heap/os_realloc.md b/docs/os/core_os/heap/os_realloc.md
new file mode 100644
index 0000000..809d9cf
--- /dev/null
+++ b/docs/os/core_os/heap/os_realloc.md
@@ -0,0 +1,33 @@
+## <font color="F2853F" style="font-size:24pt">os_realloc</font>
+
+```no-highlight
+void *os_realloc(void *ptr, size_t size)
+```
+
+Tries to resize previously allocated memory block, and returns pointer to resized memory.
+ptr can be NULL, in which case the call is similar to calling *os_malloc()*.
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| ptr | Pointer to previously allocated memory |
+| size | New size to adjust the memory block to |
+
+#### Returned values
+
+NULL: size adjustment was not successful. <br>
+ptr: pointer to new start of memory block
+
+#### Notes
+
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+<Insert the code snippet here>
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/_os_mbuf_copypkthdr.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/_os_mbuf_copypkthdr.md b/docs/os/core_os/mbuf/_os_mbuf_copypkthdr.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/_os_msys_find_pool.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/_os_msys_find_pool.md b/docs/os/core_os/mbuf/_os_msys_find_pool.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/mbuf.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/mbuf.md b/docs/os/core_os/mbuf/mbuf.md
new file mode 100644
index 0000000..976f425
--- /dev/null
+++ b/docs/os/core_os/mbuf/mbuf.md
@@ -0,0 +1,43 @@
+# Mbufs
+
+
+Insert synopsis here
+
+
+## Description
+
+Describe OS feature here
+
+## Data structures
+
+Replace this with the list of data structures used, why, any neat features
+
+## List of Functions
+
+The functions available in mbuf are:
+
+* [_os_mbuf_copypkthdr](_os_mbuf_copypkthdr.md)
+* [_os_msys_find_pool](_os_msys_find_pool.md)
+* [os_mbuf_adj](os_mbuf_adj.md)
+* [os_mbuf_append](os_mbuf_append.md)
+* [os_mbuf_concat](os_mbuf_concat.md)
+* [os_mbuf_copydata](os_mbuf_copydata.md)
+* [os_mbuf_copyinto](os_mbuf_copyinto.md)
+* [os_mbuf_dup](os_mbuf_dup.md)
+* [os_mbuf_extend](os_mbuf_extend.md)
+* [os_mbuf_free](os_mbuf_free.md)
+* [os_mbuf_free_chain](os_mbuf_free_chain.md)
+* [os_mbuf_get](os_mbuf_get.md)
+* [os_mbuf_get_pkthdr](os_mbuf_get_pkthdr.md)
+* [os_mbuf_memcmp](os_mbuf_memcmp.md)
+* [os_mbuf_off](os_mbuf_off.md)
+* [os_mbuf_pool_init](os_mbuf_pool_init.md)
+* [os_mbuf_prepend](os_mbuf_prepend.md)
+* [os_mbuf_pullup](os_mbuf_pullup.md)
+* [os_mqueue_get](os_mqueue_get.md)
+* [os_mqueue_init](os_mqueue_init.md)
+* [os_mqueue_put](os_mqueue_put.md)
+* [os_msys_get](os_msys_get.md)
+* [os_msys_get_pkthdr](os_msys_get_pkthdr.md)
+* [os_msys_register](os_msys_register.md)
+* [os_msys_reset](os_msys_reset.md)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_adj.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_adj.md b/docs/os/core_os/mbuf/os_mbuf_adj.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_append.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_append.md b/docs/os/core_os/mbuf/os_mbuf_append.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_concat.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_concat.md b/docs/os/core_os/mbuf/os_mbuf_concat.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_copydata.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_copydata.md b/docs/os/core_os/mbuf/os_mbuf_copydata.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_copyinto.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_copyinto.md b/docs/os/core_os/mbuf/os_mbuf_copyinto.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_dup.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_dup.md b/docs/os/core_os/mbuf/os_mbuf_dup.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_extend.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_extend.md b/docs/os/core_os/mbuf/os_mbuf_extend.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_free.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_free.md b/docs/os/core_os/mbuf/os_mbuf_free.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_free_chain.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_free_chain.md b/docs/os/core_os/mbuf/os_mbuf_free_chain.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_get.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_get.md b/docs/os/core_os/mbuf/os_mbuf_get.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_get_pkthdr.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_get_pkthdr.md b/docs/os/core_os/mbuf/os_mbuf_get_pkthdr.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_memcmp.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_memcmp.md b/docs/os/core_os/mbuf/os_mbuf_memcmp.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_off.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_off.md b/docs/os/core_os/mbuf/os_mbuf_off.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_pool_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_pool_init.md b/docs/os/core_os/mbuf/os_mbuf_pool_init.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_prepend.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_prepend.md b/docs/os/core_os/mbuf/os_mbuf_prepend.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mbuf_pullup.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mbuf_pullup.md b/docs/os/core_os/mbuf/os_mbuf_pullup.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mqueue_get.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mqueue_get.md b/docs/os/core_os/mbuf/os_mqueue_get.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mqueue_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mqueue_init.md b/docs/os/core_os/mbuf/os_mqueue_init.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_mqueue_put.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_mqueue_put.md b/docs/os/core_os/mbuf/os_mqueue_put.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_msys_get.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_msys_get.md b/docs/os/core_os/mbuf/os_msys_get.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_msys_get_pkthdr.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_msys_get_pkthdr.md b/docs/os/core_os/mbuf/os_msys_get_pkthdr.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_msys_register.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_msys_register.md b/docs/os/core_os/mbuf/os_msys_register.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mbuf/os_msys_reset.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mbuf/os_msys_reset.md b/docs/os/core_os/mbuf/os_msys_reset.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/memory_pool/OS_MEMPOOL_BYTES.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/memory_pool/OS_MEMPOOL_BYTES.md b/docs/os/core_os/memory_pool/OS_MEMPOOL_BYTES.md
new file mode 100644
index 0000000..b08fdea
--- /dev/null
+++ b/docs/os/core_os/memory_pool/OS_MEMPOOL_BYTES.md
@@ -0,0 +1,40 @@
+## <font color="#F2853F" style="font-size:24pt">OS_MEMPOOL_BYTES</font>
+
+```no-highlight
+OS_MEMPOOL_BYTES(n,blksize)
+```
+
+Calculates how many bytes of memory is used by *n* number of elements, when individual element size is *blksize* bytes.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| n | Number of elements |
+| blksize | Size of an element is number of bytes |
+
+#### Returned values
+
+List any values returned.
+Error codes?
+
+#### Notes
+
+
+#### Example
+
+Here we allocate memory to be used as a pool.
+
+```no-highlight
+void *nffs_file_mem;
+
+nffs_file_mem = malloc(
+ OS_MEMPOOL_BYTES(nffs_config.nc_num_files, sizeof (struct nffs_file)));
+ if (nffs_file_mem == NULL) {
+ return FS_ENOMEM;
+ }
+```
+
+---------------------
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/memory_pool/memory_pool.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/memory_pool/memory_pool.md b/docs/os/core_os/memory_pool/memory_pool.md
new file mode 100644
index 0000000..25d0554
--- /dev/null
+++ b/docs/os/core_os/memory_pool/memory_pool.md
@@ -0,0 +1,42 @@
+# Memory Pools
+
+
+Memory can be pre-allocated to a pool of fixed size elements.
+
+
+## Description
+
+Sometimes it's useful to have several memory blocks of same size preallocated for specific use. E.g. you want to limit the amount of memory used for it, or you want to make sure that there is memory available when you ask for it.
+
+This can be done using a memory pool. You allocate memory either statically or from heap, and then designate that memory to be used as storage for fixed size elements.
+
+Pool will be initialized by calling *os_mempool_init()*. Element can be allocated from it with *os_mempool_get()*, and released back with *os_mempool_put()*.
+
+## Data structures
+
+```no-highlight
+struct os_mempool {
+ int mp_block_size;
+ int mp_num_blocks;
+ int mp_num_free;
+ SLIST_HEAD(,os_memblock);
+ char *name;
+};
+```
+| Element | Description |
+|-----------|-------------|
+| mp_block_size | Size of the memory blocks, in bytes |
+| mp_num_blocks | Number of memory blocks in the pool |
+| mp_num_free | Number of free blocks left |
+| name | Name for the memory block |
+
+## List of Functions
+
+The functions available in mem_pool are:
+
+* [os_memblock_get](os_memblock_get)
+* [os_mempool_init](os_mempool_init)
+* [os_memblock_put](os_memblock_put)
+* [OS_MEMPOOL_BYTES](OS_MEMPOOL_BYTES)
+
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/memory_pool/os_memblock_get.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/memory_pool/os_memblock_get.md b/docs/os/core_os/memory_pool/os_memblock_get.md
new file mode 100644
index 0000000..81ed839
--- /dev/null
+++ b/docs/os/core_os/memory_pool/os_memblock_get.md
@@ -0,0 +1,38 @@
+## <font color="#F2853F" style="font-size:24pt"> os_memblock_get</font>
+
+```no-highlight
+void *os_memblock_get(struct os_mempool *mp)
+```
+
+Allocate an element from the memory pool. If succesful, you'll get a pointer to allocated element. If there are no elements available, you'll get NULL as response.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| mp | Pool where element is getting allocated from |
+
+#### Returned values
+
+NULL: no elements available.
+<pointer>: pointer to allocated element.
+
+#### Notes
+
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+ struct nffs_file *file;
+
+ file = os_memblock_get(&nffs_file_pool);
+ if (file != NULL) {
+ memset(file, 0, sizeof *file);
+ }
+
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/memory_pool/os_memblock_put.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/memory_pool/os_memblock_put.md b/docs/os/core_os/memory_pool/os_memblock_put.md
new file mode 100644
index 0000000..a790cab
--- /dev/null
+++ b/docs/os/core_os/memory_pool/os_memblock_put.md
@@ -0,0 +1,39 @@
+## <font color="#F2853F" style="font-size:24pt">os_memblock_put</font>
+
+```no-highlight
+os_error_t os_memblock_put(struct os_mempool *mp, void *block_addr)
+```
+
+Releases previously allocated element back to the pool.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| mp | Pointer to memory pool where element is put |
+| block_addr | Pointer to element getting freed |
+
+#### Returned values
+
+OS_OK: operation was a success:
+OS_INVALID_PARAM: If either mp or block_addr were NULL.
+
+#### Notes
+
+
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+ if (file != NULL) {
+ rc = os_memblock_put(&nffs_file_pool, file);
+ if (rc != 0) {
+ return FS_EOS;
+ }
+ }
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/memory_pool/os_mempool_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/memory_pool/os_mempool_init.md b/docs/os/core_os/memory_pool/os_mempool_init.md
new file mode 100644
index 0000000..33a7f66
--- /dev/null
+++ b/docs/os/core_os/memory_pool/os_mempool_init.md
@@ -0,0 +1,49 @@
+## <font color="F2853F" style="font-size:24pt"> os_mempool_init</font>
+
+```no-highlight
+os_error_t os_mempool_init(struct os_mempool *mp, int blocks, int block_size, void *membuf, char *name)
+```
+
+Initializes the memory pool. Memory pointed by *membuf* is taken and *blocks* number of elements of size *block_size* are added to the pool. *name* is optional, and names the memory pool.
+
+It is assumed that the amount of memory pointed by *membuf* has at least *OS_MEMPOOL_BYTES(blocks, block_size)* number of bytes.
+
+*name* is not copied, so caller should make sure that the memory does not get reused.
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| mp | Memory pool being initialized |
+| blocks | Number of elements in the pool |
+| block_size | Size of an individual element in pool |
+| membuf | Backing store for the memory pool elements |
+| name | Name of the memory pool |
+
+#### Returned values
+
+OS_OK: operation was successful.
+OS_INVALID_PARAM: invalid parameters. Block count or block size was negative, or membuf or mp was NULL.
+OS_MEM_NOT_ALIGNED: membuf has to be aligned to 4 byte boundary.
+
+#### Notes
+
+Note that os_mempool_init() does not allocate backing storage. *membuf* has to be allocated by the caller.
+
+It's recommended that you use *OS_MEMPOOL_BYTES()* to figure out how much memory to allocate for the pool.
+
+#### Example
+
+<Add text to set up the context for the example here>
+
+```no-highlight
+ rc = os_mempool_init(&nffs_file_pool, nffs_config.nc_num_files,
+ sizeof (struct nffs_file), nffs_file_mem,
+ "nffs_file_pool");
+ if (rc != 0) {
+ return FS_EOS;
+ }
+
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mutex/mutex.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mutex/mutex.md b/docs/os/core_os/mutex/mutex.md
new file mode 100644
index 0000000..08b9487
--- /dev/null
+++ b/docs/os/core_os/mutex/mutex.md
@@ -0,0 +1,48 @@
+# Mutex
+
+
+Mutex is short for "mutual exclusion"; a mutex provides mutually exclusive access to a shared resource. A mutex provides *priority inheritance* in order to prevent *priority inversion*. Priority inversion occurs when a higher priority task is waiting on a resource owned by a lower priority task. Using a mutex, the lower priority task will inherit the highest priority of any task waiting on the mutex.
+
+
+## Description
+
+The first order of business when using a mutex is to declare the mutex globally. The mutex needs to be initialized before it is used (see the examples). It is generally a good idea to initialize the mutex before tasks start running in order to avoid a task possibly using the mutex before it is initialized.
+
+When a task wants exclusive access to a shared resource it needs to obtain the mutex by calling *os_mutex_pend*. If the mutex is currently owned by a different task (a lower priority task), the requesting task will be put to sleep and the owners priority will be elevated to the priority of the requesting task. Note that multiple tasks can request ownership and the current owner is elevated to the highest priority of any task waitin on the mutex. When the task is done using the shared resource, it needs to release the mutex by called *os_mutex_release*. There needs to be one release per call to pend. Note that nested calls to *os_mutex_pend* are allowed but there needs to be one release per pend.
+
+The following example will illustrate how priority inheritance works. In this example, the task number is the same as its priority. Remember that the lower the number, the higher the priority (i.e. priority 0 is higher priority than priority 1). Suppose that task 5 gets ownership of a mutex but is preempted by task 4. Task 4 attempts to gain ownership of the mutex but cannot as it is owned by task 5. Task 4 is put to sleep and task 5 is temporarily raised to priority 4. Before task 5 can release the mutex, task 3 runs and attempts to acquire the mutex. At this point, both task 3 and task 4 are waiting on the mutex (sleeping). Task 5 now runs at priority 3 (the highest priority of all the tasks waiting on the mutex). When task 5 finally releases the mutex it will be preempted as two higher priority tasks are waiting for it.
+
+Note that when multiple tasks are waiting on a mutex owned by another task, once the mutex is released the highest priority task waiting on the mutex is run.
+
+## Data structures
+
+```no-highlight
+struct os_mutex
+{
+ SLIST_HEAD(, os_task) mu_head;
+ uint8_t _pad;
+ uint8_t mu_prio;
+ uint16_t mu_level;
+ struct os_task *mu_owner;
+};
+```
+
+| Element | Description |
+|-----------|-------------|
+| mu_head | Queue head for list of tasks waiting on mutex |
+| _pad | Padding |
+| mu_prio | Default priority of owner of mutex. Used to reset priority of task when mutex released |
+| mu_level | Call nesting level (for nested calls) |
+| mu_owner | Pointer to task structure which owns mutex |
+
+## List of Functions
+
+<List all the functions here. Note how the anchors work. You put the text you want to show up as a link within [] and the relevant #heading within (). Note that the words of the heading need to be connected with a dash for the anchor to work. Hence the word "function" and the function name is connected with a dash, not underscore! And the header has to have at least 2 words for the anchor to work - that's how it is.>
+
+The functions available in this OS feature are:
+
+* [os_mutex_delete](os_mutex_delete)
+* [os_mutex_init](os_mutex_init)
+* [os_mutex_pend](os_mutex_pend)
+* [os_mutex_release](os_mutex_release)
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mutex/os_mutex_delete.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mutex/os_mutex_delete.md b/docs/os/core_os/mutex/os_mutex_delete.md
new file mode 100644
index 0000000..29155b6
--- /dev/null
+++ b/docs/os/core_os/mutex/os_mutex_delete.md
@@ -0,0 +1,33 @@
+## <font color="#F2853F" style="font-size:24pt">os_mutex_delete </font>
+
+```no-highlight
+os_error_t os_mutex_pend(struct os_mutex *mu)
+```
+
+Delete a mutex
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| *mu | Pointer to mutex |
+
+#### Returned values
+
+OS_INVALID_PARM: returned when *mu is NULL on entry.
+
+OS_OK: mutex initialized successfully.
+
+OS_NOT_STARTED: Attempt to release a mutex before the os has been started.
+
+#### Example
+
+```no-highlight
+struct os_mutex g_mutex1;
+os_error_t err;
+
+err = os_mutex_delete(&g_mutex1);
+assert(err == OS_OK);
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mutex/os_mutex_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mutex/os_mutex_init.md b/docs/os/core_os/mutex/os_mutex_init.md
new file mode 100644
index 0000000..3bd248e
--- /dev/null
+++ b/docs/os/core_os/mutex/os_mutex_init.md
@@ -0,0 +1,39 @@
+## <font color="#F2853F" style="font-size:24pt">os_mutex_init</font>
+
+```no-highlight
+os_error_t os_mutex_init(struct os_mutex *mu)
+```
+
+Initialize the mutex. Must be called before the mutex can be used.
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| *mu| Pointer to mutex |
+
+#### Returned values
+
+OS_INVALID_PARM: returned when *mu is NULL on entry.
+
+OS_OK: mutex initialized successfully.
+
+#### Notes
+
+<Any special feature/special benefit that we want to tout.
+Does it need to be used with some other specific functions?
+Any caveats to be careful about (e.g. high memory requirements).>
+
+#### Example
+
+
+```no-highlight
+struct os_mutex g_mutex1;
+os_error_t err;
+
+err = os_mutex_init(&g_mutex1);
+assert(err == OS_OK);
+```
+
+---------------------
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mutex/os_mutex_pend.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mutex/os_mutex_pend.md b/docs/os/core_os/mutex/os_mutex_pend.md
new file mode 100644
index 0000000..d325cd0
--- /dev/null
+++ b/docs/os/core_os/mutex/os_mutex_pend.md
@@ -0,0 +1,49 @@
+## <font color="#F2853F" style="font-size:24pt">os_mutex_pend </font>
+
+```no-highlight
+os_error_t os_mutex_pend(struct os_mutex *mu, uint32_t timeout)
+```
+
+Acquire ownership of a mutex.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| *mu | Pointer to mutex |
+| timeout | Timeout, in os ticks. A value of 0 means no timeout. A value of 0xFFFFFFFF means to wait forever. |
+
+#### Returned values
+
+OS_INVALID_PARM: returned when *mu is NULL on entry.
+
+OS_OK: mutex was successfully acquired.
+
+OS_TIMEOUT: the mutex was not available within the timeout specified.
+
+OS_NOT_STARTED: Attempt to release a mutex before the os has been started.
+
+
+#### Notes
+
+If the mutex is owned by another task and the timeout is 0 the function returns immediately with the error code OS_TIMEOUT. The calling task *does not* own the mutex when this occurs.
+
+#### Example
+
+
+
+```no-highlight
+struct os_mutex g_mutex1;
+os_error_t err;
+
+err = os_mutex_pend(&g_mutex1, 0);
+assert(err == OS_OK);
+
+/* Perform operations requiring exclusive access */
+
+err = os_mutex_release(&g_mutex1);
+assert(err == OS_OK);
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mutex/os_mutex_release.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mutex/os_mutex_release.md b/docs/os/core_os/mutex/os_mutex_release.md
new file mode 100644
index 0000000..23c126e
--- /dev/null
+++ b/docs/os/core_os/mutex/os_mutex_release.md
@@ -0,0 +1,42 @@
+## <font color="#F2853F" style="font-size:24pt">os_mutex_release</font>
+
+```no-highlight
+os_error_t os_mutex_release(struct os_mutex *mu)
+```
+
+Release ownership of a mutex
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| *mu| Pointer to mutex |
+
+#### Returned values
+OS_INVALID_PARM: returned when *mu is NULL on entry.
+
+OS_OK: mutex initialized successfully.
+
+OS_BAD_MUTEX: The mutex was not owned by the task attempting to release it.
+
+OS_NOT_STARTED: Attempt to release a mutex before the os has been started.
+
+
+#### Example
+
+
+```no-highlight
+struct os_mutex g_mutex1;
+os_error_t err;
+
+err = os_mutex_pend(&g_mutex1, 0);
+assert(err == OS_OK);
+
+/* Perform operations requiring exclusive access */
+
+err = os_mutex_release(&g_mutex1);
+assert(err == OS_OK);
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/mynewt_os.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/mynewt_os.md b/docs/os/core_os/mynewt_os.md
new file mode 100644
index 0000000..52b7c53
--- /dev/null
+++ b/docs/os/core_os/mynewt_os.md
@@ -0,0 +1,44 @@
+# Mynewt OS
+
+Insert introduction here
+
+## Real-Time Kernel <Modify as you Wish>
+
+ Description
+
+## Real-Time OS <Modify as you Wish>
+
+ Description
+
+
+## Insert topic of your choice
+
+ Description
+
+## Features
+
+<Insert basic feature descriptions, how the various pieces fit together etc., what's special in Mynewt OS>
+
+* [Scheduler/context switching](context_switch/context_switch.md)
+* [Time](time/time.md)
+* [Tasks](task/task.md)
+* [Event queues/callouts](event_queue/event_queue.md)
+* [Semaphores](semaphore/semaphore.md)
+* [Mutexes](mutex/mutex.md)
+* [Memory pools](memory_pool/memory_pool.md)
+* [Heap](heap/heap.md)
+* [Mbufs](mbuf/mbuf.md)
+* [Sanity](sanity/sanity.md)
+* [Porting OS to other platforms](port_os.md)
+
+## OS Functions
+
+
+The functions available at the OS level are:
+
+* [os_idle_task](os_idle_task.md)
+* [os_init](os_init.md)
+* [os_init_idle_task](os_init_idle_task.md)
+* [os_start](os_start.md)
+* [os_started](os_started.md)
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/os_idle_task.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/os_idle_task.md b/docs/os/core_os/os_idle_task.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/os_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/os_init.md b/docs/os/core_os/os_init.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/os_init_idle_task.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/os_init_idle_task.md b/docs/os/core_os/os_init_idle_task.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/os_start.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/os_start.md b/docs/os/core_os/os_start.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/os_started.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/os_started.md b/docs/os/core_os/os_started.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/port_os.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/port_os.md b/docs/os/core_os/port_os.md
new file mode 100644
index 0000000..1331dde
--- /dev/null
+++ b/docs/os/core_os/port_os.md
@@ -0,0 +1,12 @@
+# Porting Mynewt OS
+
+
+This chapter describes how to adapt Newt OS to different processors. Adapting μC/OS-III to a microprocessor or a microcontroller is called porting.
+
+
+## Description
+
+
+## Insert sections as you wish
+
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/sanity/os_sanity_check_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/sanity/os_sanity_check_init.md b/docs/os/core_os/sanity/os_sanity_check_init.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/sanity/os_sanity_check_list_lock.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/sanity/os_sanity_check_list_lock.md b/docs/os/core_os/sanity/os_sanity_check_list_lock.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/sanity/os_sanity_check_list_unlock.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/sanity/os_sanity_check_list_unlock.md b/docs/os/core_os/sanity/os_sanity_check_list_unlock.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/sanity/os_sanity_check_register.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/sanity/os_sanity_check_register.md b/docs/os/core_os/sanity/os_sanity_check_register.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/sanity/os_sanity_check_reset.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/sanity/os_sanity_check_reset.md b/docs/os/core_os/sanity/os_sanity_check_reset.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/sanity/os_sanity_task_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/sanity/os_sanity_task_init.md b/docs/os/core_os/sanity/os_sanity_task_init.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/sanity/os_sanity_task_loop.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/sanity/os_sanity_task_loop.md b/docs/os/core_os/sanity/os_sanity_task_loop.md
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/sanity/sanity.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/sanity/sanity.md b/docs/os/core_os/sanity/sanity.md
new file mode 100644
index 0000000..1e8b6c2
--- /dev/null
+++ b/docs/os/core_os/sanity/sanity.md
@@ -0,0 +1,25 @@
+# Sanity
+
+
+Insert synopsis here
+
+
+## Description
+
+Describe OS feature here
+
+## Data structures
+
+Replace this with the list of data structures used, why, any neat features
+
+## List of Functions
+
+The functions available in sanity are:
+
+* [os_sanity_check_init](os_sanity_check_init.md)
+* [os_sanity_check_list_lock](os_sanity_check_list_lock.md)
+* [os_sanity_check_list_unlock](os_sanity_check_list_unlock.md)
+* [os_sanity_check_register](os_sanity_check_register.md)
+* [os_sanity_check_reset](os_sanity_check_reset.md)
+* [os_sanity_task_init](os_sanity_task_init.md)
+* [os_sanity_task_loop](os_sanity_task_loop.md)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/semaphore/os_sem_delete.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/semaphore/os_sem_delete.md b/docs/os/core_os/semaphore/os_sem_delete.md
new file mode 100644
index 0000000..26a340d
--- /dev/null
+++ b/docs/os/core_os/semaphore/os_sem_delete.md
@@ -0,0 +1,37 @@
+## <font color="#F2853F" style="font-size:24pt"> os_sem_delete </font>
+
+```no-highlight
+os_error_t os_sem_delete(struct os_sem *sem)
+```
+
+Delete a semaphore
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| *sem | Pointer to semaphore |
+
+#### Returned values
+
+OS_INVALID_PARM: returned when *sem is NULL on entry.
+
+OS_OK: semaphore deleted successfully.
+
+OS_NOT_STARTED: Attempt to release a semaphore before os started.
+
+#### Notes
+
+Care must be taken when deleting a semaphore as deleting a semaphore used by other tasks could causes unexpected/unwanted behavior.
+
+#### Example
+
+```no-highlight
+struct os_sem g_os_sem;
+os_error_t err;
+
+err = os_sem_delete(&g_os_sem);
+assert(err == OS_OK);
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/semaphore/os_sem_init.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/semaphore/os_sem_init.md b/docs/os/core_os/semaphore/os_sem_init.md
new file mode 100644
index 0000000..b586120
--- /dev/null
+++ b/docs/os/core_os/semaphore/os_sem_init.md
@@ -0,0 +1,41 @@
+## <font color="F2853F" style="font-size:24pt"> os_sem_init</font>
+
+```no-highlight
+os_error_t os_sem_init(struct os_sem *sem, uint16_t tokens)
+```
+
+Initialize a semaphore with a given number of tokens. Should be called before the semaphore is used.
+
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| *sem | Pointer to semaphore |
+| tokens | Initial number of tokens allocated to semaphore |
+
+#### Returned values
+
+OS_INVALID_PARM: returned when *sem is NULL on entry.
+
+OS_OK: semaphore initialized successfully.
+
+#### Notes
+
+<Any special feature/special benefit that we want to tout.
+Does it need to be used with some other specific functions?
+Any caveats to be careful about (e.g. high memory requirements).>
+
+#### Example
+
+The following example shows how to initialize a semaphore used for exclusive access.
+
+```no-highlight
+struct os_mutex g_os_sem;
+os_error_t err;
+
+err = os_sem_init(&g_os_sem, 1);
+assert(err == OS_OK);
+```
+
+---------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9b0bc2e0/docs/os/core_os/semaphore/os_sem_pend.md
----------------------------------------------------------------------
diff --git a/docs/os/core_os/semaphore/os_sem_pend.md b/docs/os/core_os/semaphore/os_sem_pend.md
new file mode 100644
index 0000000..df64bcd
--- /dev/null
+++ b/docs/os/core_os/semaphore/os_sem_pend.md
@@ -0,0 +1,46 @@
+## <font color="#F2853F" style="font-size:24pt"> os_sem_pend </font>
+
+```no-highlight
+os_error_t os_sem_pend(struct os_sem *sem, uint32_t timeout)
+```
+
+Wait for a semaphore for a given amount of time.
+
+#### Arguments
+
+| Arguments | Description |
+|-----------|-------------|
+| *sem | Pointer to semaphore |
+| timeout | Amount of time, in os ticks, to wait for semaphore. A value of 0 means no wait. A value of 0xFFFFFFFF means wait forever. |
+
+#### Returned values
+
+OS_INVALID_PARM: returned when *sem is NULL on entry.
+
+OS_OK: semaphore acquired successfully.
+
+OS_TIMEOUT: the semaphore was not available within the timeout specified.
+
+OS_NOT_STARTED: Attempt to release a semaphore before os started.
+
+#### Notes
+
+If a timeout of 0 is used and the function returns OS_TIMEOUT, the semaphore was not available and was not acquired. No release of the semaphore should occur and the calling task does not own the semaphore.
+
+#### Example
+
+```no-highlight
+struct os_sem g_os_sem;
+os_error_t err;
+
+err = os_sem_pend(&g_os_sem, OS_TIMEOUT_NEVER);
+assert(err == OS_OK);
+
+/* Perform operations requiring semaphore lock */
+
+err = os_sem_release(&g_os_sem);
+assert(err == OS_OK);
+
+```
+
+---------------------