You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/09/29 01:34:56 UTC

[49/49] incubator-mynewt-core git commit: directory re-org

directory re-org


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/6a7432f4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/6a7432f4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/6a7432f4

Branch: refs/heads/develop
Commit: 6a7432f493900f8adad0fe9416b65d477fc5b316
Parents: 797b341
Author: Sterling Hughes <st...@apache.org>
Authored: Wed Sep 28 16:34:02 2016 -0700
Committer: Sterling Hughes <st...@apache.org>
Committed: Wed Sep 28 18:32:22 2016 -0700

----------------------------------------------------------------------
 apps/blecent/pkg.yml                            |    6 +-
 apps/blehci/pkg.yml                             |    6 +-
 apps/bleprph/pkg.yml                            |    6 +-
 apps/bletest/pkg.yml                            |    6 +-
 apps/bletiny/pkg.yml                            |    6 +-
 apps/bleuart/pkg.yml                            |    8 +-
 apps/blinky/pkg.yml                             |    6 +-
 apps/boot/pkg.yml                               |   10 +-
 apps/ffs2native/pkg.yml                         |    4 +-
 apps/luatest/pkg.yml                            |   31 -
 apps/luatest/src/main.c                         |   75 -
 apps/ocf_sample/pkg.yml                         |    6 +-
 apps/sblinky/pkg.yml                            |   36 -
 apps/sblinky/src/main.c                         |  599 ------
 apps/slinky/pkg.yml                             |   12 +-
 apps/splitty/pkg.yml                            |   10 +-
 apps/test/pkg.yml                               |   10 +-
 .../include/boot_serial/boot_serial.h           |   33 +
 boot/boot_serial/pkg.yml                        |   36 +
 boot/boot_serial/src/boot_serial.c              |  403 ++++
 boot/boot_serial/src/boot_serial_priv.h         |   61 +
 boot/boot_serial/test/pkg.yml                   |   33 +
 boot/boot_serial/test/src/boot_test.c           |  231 +++
 boot/bootutil/design.txt                        |  413 ++++
 boot/bootutil/include/bootutil/bootutil_misc.h  |   28 +
 boot/bootutil/include/bootutil/bootutil_test.h  |   25 +
 boot/bootutil/include/bootutil/image.h          |   89 +
 boot/bootutil/include/bootutil/loader.h         |   84 +
 boot/bootutil/include/bootutil/sign_key.h       |   33 +
 boot/bootutil/pkg.yml                           |   41 +
 boot/bootutil/signed_images.md                  |   91 +
 boot/bootutil/src/bootutil_misc.c               |  319 ++++
 boot/bootutil/src/bootutil_priv.h               |   75 +
 boot/bootutil/src/image_ec.c                    |  121 ++
 boot/bootutil/src/image_rsa.c                   |  144 ++
 boot/bootutil/src/image_validate.c              |  198 ++
 boot/bootutil/src/loader.c                      |  652 +++++++
 boot/bootutil/test/pkg.yml                      |   30 +
 boot/bootutil/test/src/boot_test.c              | 1169 ++++++++++++
 boot/split/README.md                            |   63 +
 boot/split/include/split/split.h                |   57 +
 boot/split/include/split/split_priv.h           |   30 +
 boot/split/pkg.yml                              |   30 +
 boot/split/src/split.c                          |   77 +
 boot/split/src/split_config.c                   |   95 +
 boot/split/src/split_netmgr.c                   |  149 ++
 .../include/adc_stm32f4/adc_stm32f4.h           |   62 -
 drivers/adc/adc_stm32f4/pkg.yml                 |   34 -
 drivers/adc/adc_stm32f4/src/adc_stm32f4.c       |  735 --------
 encoding/base64/include/base64/base64.h         |   32 +
 encoding/base64/include/base64/hex.h            |   25 +
 encoding/base64/pkg.yml                         |   26 +
 encoding/base64/src/base64.c                    |  181 ++
 encoding/base64/src/hex.c                       |  101 +
 encoding/base64/test/pkg.yml                    |   30 +
 encoding/base64/test/src/encoding_test.c        |   46 +
 encoding/base64/test/src/encoding_test_priv.h   |   25 +
 encoding/base64/test/src/hex_test.c             |  125 ++
 encoding/crc/include/crc/base64.h               |   32 +
 encoding/crc/include/crc/crc16.h                |   36 +
 encoding/crc/include/crc/crc8.h                 |   32 +
 encoding/crc/include/crc/hex.h                  |   25 +
 encoding/crc/pkg.yml                            |   28 +
 encoding/crc/src/crc16.c                        |   83 +
 encoding/crc/src/crc8.c                         |   74 +
 encoding/crc/test/pkg.yml                       |   30 +
 encoding/crc/test/src/encoding_test.c           |   46 +
 encoding/crc/test/src/encoding_test_priv.h      |   25 +
 encoding/crc/test/src/hex_test.c                |  125 ++
 encoding/json/MSJSON_COPYING                    |   28 +
 encoding/json/include/json/json.h               |  245 +++
 encoding/json/pkg.yml                           |   26 +
 encoding/json/src/json_decode.c                 |  670 +++++++
 encoding/json/src/json_encode.c                 |  248 +++
 encoding/json/test/pkg.yml                      |   30 +
 encoding/json/test/src/test_json.c              |   43 +
 encoding/json/test/src/test_json.h              |   27 +
 encoding/json/test/src/test_json_simple.c       |  360 ++++
 encoding/tinycbor/include/tinycbor/assert_p.h   |   29 +
 encoding/tinycbor/include/tinycbor/cbor.h       |  479 +++++
 .../tinycbor/include/tinycbor/cborconstants_p.h |   52 +
 encoding/tinycbor/include/tinycbor/cborjson.h   |   62 +
 .../include/tinycbor/compilersupport_p.h        |  218 +++
 .../include/tinycbor/extract_number_p.h         |   78 +
 .../tinycbor/include/tinycbor/math_support_p.h  |   47 +
 encoding/tinycbor/pkg.yml                       |   26 +
 encoding/tinycbor/src/cborencoder.c             |  629 +++++++
 .../src/cborencoder_close_container_checked.c   |   82 +
 encoding/tinycbor/src/cborerrorstrings.c        |  165 ++
 encoding/tinycbor/src/cborparser.c              | 1293 +++++++++++++
 encoding/tinycbor/src/cborparser_dup_string.c   |  113 ++
 encoding/tinycbor/src/cborpretty.c              |  470 +++++
 encoding/tinycbor/src/cbortojson.c              |  686 +++++++
 encoding/tinycbor/src/open_memstream.c          |  117 ++
 fs/fcb/README.md                                |   58 +
 fs/fcb/include/fcb/fcb.h                        |  134 ++
 fs/fcb/pkg.yml                                  |   29 +
 fs/fcb/src/fcb.c                                |  258 +++
 fs/fcb/src/fcb_append.c                         |  143 ++
 fs/fcb/src/fcb_elem_info.c                      |  101 +
 fs/fcb/src/fcb_getnext.c                        |  132 ++
 fs/fcb/src/fcb_priv.h                           |   57 +
 fs/fcb/src/fcb_rotate.c                         |   56 +
 fs/fcb/src/fcb_walk.c                           |   53 +
 fs/fcb/test/pkg.yml                             |   30 +
 fs/fcb/test/src/fcb_test.c                      |  672 +++++++
 fs/nffs/pkg.yml                                 |    5 +-
 fs/nffs/src/nffs_priv.h                         |    4 +-
 fs/nffs/test/pkg.yml                            |    4 +-
 hw/bsp/arduino_primo_nrf52/pkg.yml              |    2 +-
 hw/bsp/bmd300eval/pkg.yml                       |    2 +-
 hw/bsp/nrf51-arduino_101/pkg.yml                |    2 +-
 hw/bsp/nrf51-blenano/pkg.yml                    |    2 +-
 hw/bsp/nrf51dk-16kbram/pkg.yml                  |    2 +-
 hw/bsp/nrf51dk/pkg.yml                          |    2 +-
 hw/bsp/nrf52dk/pkg.yml                          |    2 +-
 hw/bsp/nrf52pdk/pkg.yml                         |    2 +-
 hw/bsp/nucleo-f401re/pkg.yml                    |    2 +-
 hw/bsp/olimex_stm32-e407_devboard/pkg.yml       |    2 +-
 hw/bsp/stm32f4discovery/pkg.yml                 |    2 +-
 hw/cmsis-core/pkg.yml                           |   27 +
 hw/cmsis-core/src/cmsis_nvic.c                  |   73 +
 hw/cmsis-core/src/ext/core_ca9.h                |  271 +++
 hw/cmsis-core/src/ext/core_caFunc.h             | 1161 ++++++++++++
 hw/cmsis-core/src/ext/core_caInstr.h            |   45 +
 hw/cmsis-core/src/ext/core_ca_mmu.h             |  848 +++++++++
 hw/cmsis-core/src/ext/core_cm0.h                |  682 +++++++
 hw/cmsis-core/src/ext/core_cm0plus.h            |  793 ++++++++
 hw/cmsis-core/src/ext/core_cm3.h                | 1627 ++++++++++++++++
 hw/cmsis-core/src/ext/core_cm4.h                | 1772 ++++++++++++++++++
 hw/cmsis-core/src/ext/core_cm4_simd.h           |  673 +++++++
 hw/cmsis-core/src/ext/core_cmFunc.h             |  636 +++++++
 hw/cmsis-core/src/ext/core_cmInstr.h            |  688 +++++++
 .../include/adc_stm32f4/adc_stm32f4.h           |   62 +
 hw/drivers/adc/adc_stm32f4/pkg.yml              |   34 +
 hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c    |  735 ++++++++
 hw/hal/pkg.yml                                  |    2 +-
 hw/mcu/nordic/nrf51xxx/pkg.yml                  |    2 +-
 hw/mcu/nordic/nrf52xxx/pkg.yml                  |    2 +-
 hw/mcu/nordic/pkg.yml                           |    2 +-
 hw/mcu/stm/stm32f4xx/pkg.yml                    |    2 +-
 hw/mcu/stm/stm32f4xx/src/hal_watchdog.c         |    2 +-
 .../os/include/os/arch/cortex_m0/os/os_arch.h   |   74 +
 .../os/include/os/arch/cortex_m4/os/os_arch.h   |   75 +
 kernel/os/include/os/arch/sim/os/os_arch.h      |   74 +
 kernel/os/include/os/endian.h                   |   92 +
 kernel/os/include/os/os.h                       |  101 +
 kernel/os/include/os/os_callout.h               |   60 +
 kernel/os/include/os/os_cfg.h                   |   25 +
 kernel/os/include/os/os_dev.h                   |  114 ++
 kernel/os/include/os/os_eventq.h                |   51 +
 kernel/os/include/os/os_heap.h                  |   30 +
 kernel/os/include/os/os_malloc.h                |   34 +
 kernel/os/include/os/os_mbuf.h                  |  297 +++
 kernel/os/include/os/os_mempool.h               |   94 +
 kernel/os/include/os/os_mutex.h                 |   59 +
 kernel/os/include/os/os_sanity.h                |   56 +
 kernel/os/include/os/os_sched.h                 |   37 +
 kernel/os/include/os/os_sem.h                   |   52 +
 kernel/os/include/os/os_task.h                  |  114 ++
 kernel/os/include/os/os_test.h                  |   25 +
 kernel/os/include/os/os_time.h                  |  111 ++
 kernel/os/include/os/queue.h                    |  514 +++++
 kernel/os/pkg.yml                               |   84 +
 kernel/os/src/arch/cortex_m0/m0/HAL_CM0.s       |  277 +++
 kernel/os/src/arch/cortex_m0/m0/SVC_Table.s     |   56 +
 kernel/os/src/arch/cortex_m0/os_arch_arm.c      |  333 ++++
 kernel/os/src/arch/cortex_m0/os_fault.c         |  158 ++
 kernel/os/src/arch/cortex_m4/m4/HAL_CM4.s       |  224 +++
 kernel/os/src/arch/cortex_m4/m4/SVC_Table.s     |   56 +
 kernel/os/src/arch/cortex_m4/os_arch_arm.c      |  328 ++++
 kernel/os/src/arch/cortex_m4/os_fault.c         |  160 ++
 kernel/os/src/arch/sim/os_arch_sim.c            |  462 +++++
 kernel/os/src/arch/sim/os_arch_stack_frame.s    |  101 +
 kernel/os/src/arch/sim/os_fault.c               |   34 +
 kernel/os/src/os.c                              |  191 ++
 kernel/os/src/os_callout.c                      |  200 ++
 kernel/os/src/os_dev.c                          |  309 +++
 kernel/os/src/os_eventq.c                       |  235 +++
 kernel/os/src/os_heap.c                         |  106 ++
 kernel/os/src/os_mbuf.c                         | 1270 +++++++++++++
 kernel/os/src/os_mempool.c                      |  233 +++
 kernel/os/src/os_msys_init.c                    |  147 ++
 kernel/os/src/os_mutex.c                        |  236 +++
 kernel/os/src/os_priv.h                         |   38 +
 kernel/os/src/os_sanity.c                       |  238 +++
 kernel/os/src/os_sched.c                        |  330 ++++
 kernel/os/src/os_sem.c                          |  212 +++
 kernel/os/src/os_task.c                         |  216 +++
 kernel/os/src/os_time.c                         |  248 +++
 kernel/os/test/pkg.yml                          |   30 +
 .../test/src/arch/cortex_m4/os_test_arch_arm.c  |   27 +
 kernel/os/test/src/arch/sim/os_test_arch_sim.c  |   52 +
 kernel/os/test/src/callout_test.c               |  330 ++++
 kernel/os/test/src/eventq_test.c                |  416 ++++
 kernel/os/test/src/mbuf_test.c                  |  420 +++++
 kernel/os/test/src/mempool_test.c               |  227 +++
 kernel/os/test/src/mutex_test.c                 |  407 ++++
 kernel/os/test/src/os_test.c                    |   53 +
 kernel/os/test/src/os_test_priv.h               |   32 +
 kernel/os/test/src/sem_test.c                   |  401 ++++
 libc/baselibc/LICENSE                           |  133 ++
 libc/baselibc/Makefile                          |   46 +
 libc/baselibc/README.md                         |    6 +
 libc/baselibc/include/assert.h                  |   28 +
 libc/baselibc/include/ctype.h                   |   86 +
 libc/baselibc/include/inttypes.h                |  229 +++
 libc/baselibc/include/klibc/extern.h            |   16 +
 libc/baselibc/include/klibc/inline.h            |   12 +
 libc/baselibc/include/stdio.h                   |  124 ++
 libc/baselibc/include/stdlib.h                  |  101 +
 libc/baselibc/include/string.h                  |   59 +
 libc/baselibc/pkg.yml                           |   28 +
 libc/baselibc/src/asprintf.c                    |   30 +
 libc/baselibc/src/atoi.c                        |    3 +
 libc/baselibc/src/atol.c                        |    3 +
 libc/baselibc/src/atoll.c                       |    3 +
 .../baselibc_test/printf_tests.c.donotcompile   |   22 +
 .../src/baselibc_test/tests_glue.c.donotcompile |   33 +
 libc/baselibc/src/baselibc_test/unittests.h     |   36 +
 libc/baselibc/src/bsearch.c                     |   26 +
 libc/baselibc/src/bzero.c                       |    6 +
 libc/baselibc/src/calloc.c                      |   20 +
 libc/baselibc/src/fgets.c                       |   31 +
 libc/baselibc/src/inline.c                      |    5 +
 libc/baselibc/src/jrand48.c                     |   24 +
 libc/baselibc/src/lrand48.c                     |   13 +
 libc/baselibc/src/malloc.c                      |  274 +++
 libc/baselibc/src/malloc.h                      |   43 +
 libc/baselibc/src/memccpy.c                     |   23 +
 libc/baselibc/src/memchr.c                      |   19 +
 libc/baselibc/src/memcmp.c                      |   19 +
 libc/baselibc/src/memcpy.c                      |   29 +
 libc/baselibc/src/memfile.c                     |   33 +
 libc/baselibc/src/memmem.c                      |   52 +
 libc/baselibc/src/memmove.c                     |   36 +
 libc/baselibc/src/memrchr.c                     |   19 +
 libc/baselibc/src/memset.c                      |   30 +
 libc/baselibc/src/memswap.c                     |   24 +
 libc/baselibc/src/mrand48.c                     |   13 +
 libc/baselibc/src/mynewt.c                      |   47 +
 libc/baselibc/src/nrand48.c                     |   11 +
 libc/baselibc/src/qsort.c                       |   46 +
 libc/baselibc/src/realloc.c                     |   50 +
 libc/baselibc/src/sprintf.c                     |   18 +
 libc/baselibc/src/srand48.c                     |   15 +
 libc/baselibc/src/sscanf.c                      |   17 +
 libc/baselibc/src/strcasecmp.c                  |   24 +
 libc/baselibc/src/strcat.c                      |   11 +
 libc/baselibc/src/strchr.c                      |   17 +
 libc/baselibc/src/strcmp.c                      |   21 +
 libc/baselibc/src/strcpy.c                      |   20 +
 libc/baselibc/src/strcspn.c                     |   51 +
 libc/baselibc/src/strdup.c                      |   17 +
 libc/baselibc/src/strlcat.c                     |   30 +
 libc/baselibc/src/strlcpy.c                     |   26 +
 libc/baselibc/src/strlen.c                      |   13 +
 libc/baselibc/src/strncasecmp.c                 |   24 +
 libc/baselibc/src/strncat.c                     |   21 +
 libc/baselibc/src/strncmp.c                     |   21 +
 libc/baselibc/src/strncpy.c                     |   24 +
 libc/baselibc/src/strndup.c                     |   19 +
 libc/baselibc/src/strnlen.c                     |   18 +
 libc/baselibc/src/strntoimax.c                  |   13 +
 libc/baselibc/src/strntoumax.c                  |   77 +
 libc/baselibc/src/strpbrk.c                     |   55 +
 libc/baselibc/src/strrchr.c                     |   19 +
 libc/baselibc/src/strsep.c                      |   21 +
 libc/baselibc/src/strspn.c                      |   56 +
 libc/baselibc/src/strstr.c                      |   11 +
 libc/baselibc/src/strtoimax.c                   |    3 +
 libc/baselibc/src/strtok.c                      |   12 +
 libc/baselibc/src/strtok_r.c                    |   13 +
 libc/baselibc/src/strtol.c                      |    3 +
 libc/baselibc/src/strtoll.c                     |    3 +
 libc/baselibc/src/strtoul.c                     |    3 +
 libc/baselibc/src/strtoull.c                    |    3 +
 libc/baselibc/src/strtoumax.c                   |    3 +
 libc/baselibc/src/templates/atox.c.template     |   14 +
 libc/baselibc/src/templates/strtox.c.template   |   14 +
 libc/baselibc/src/tinyprintf.c                  |  362 ++++
 libc/baselibc/src/vasprintf.c                   |   25 +
 libc/baselibc/src/vprintf.c                     |   11 +
 libc/baselibc/src/vsprintf.c                    |   11 +
 libc/baselibc/src/vsscanf.c                     |  400 ++++
 libs/baselibc/LICENSE                           |  133 --
 libs/baselibc/Makefile                          |   46 -
 libs/baselibc/README.md                         |    6 -
 libs/baselibc/include/assert.h                  |   28 -
 libs/baselibc/include/ctype.h                   |   86 -
 libs/baselibc/include/inttypes.h                |  229 ---
 libs/baselibc/include/klibc/extern.h            |   16 -
 libs/baselibc/include/klibc/inline.h            |   12 -
 libs/baselibc/include/stdio.h                   |  124 --
 libs/baselibc/include/stdlib.h                  |  101 -
 libs/baselibc/include/string.h                  |   59 -
 libs/baselibc/pkg.yml                           |   28 -
 libs/baselibc/src/asprintf.c                    |   30 -
 libs/baselibc/src/atoi.c                        |    3 -
 libs/baselibc/src/atol.c                        |    3 -
 libs/baselibc/src/atoll.c                       |    3 -
 .../baselibc_test/printf_tests.c.donotcompile   |   22 -
 .../src/baselibc_test/tests_glue.c.donotcompile |   33 -
 libs/baselibc/src/baselibc_test/unittests.h     |   36 -
 libs/baselibc/src/bsearch.c                     |   26 -
 libs/baselibc/src/bzero.c                       |    6 -
 libs/baselibc/src/calloc.c                      |   20 -
 libs/baselibc/src/fgets.c                       |   31 -
 libs/baselibc/src/inline.c                      |    5 -
 libs/baselibc/src/jrand48.c                     |   24 -
 libs/baselibc/src/lrand48.c                     |   13 -
 libs/baselibc/src/malloc.c                      |  274 ---
 libs/baselibc/src/malloc.h                      |   43 -
 libs/baselibc/src/memccpy.c                     |   23 -
 libs/baselibc/src/memchr.c                      |   19 -
 libs/baselibc/src/memcmp.c                      |   19 -
 libs/baselibc/src/memcpy.c                      |   29 -
 libs/baselibc/src/memfile.c                     |   33 -
 libs/baselibc/src/memmem.c                      |   52 -
 libs/baselibc/src/memmove.c                     |   36 -
 libs/baselibc/src/memrchr.c                     |   19 -
 libs/baselibc/src/memset.c                      |   30 -
 libs/baselibc/src/memswap.c                     |   24 -
 libs/baselibc/src/mrand48.c                     |   13 -
 libs/baselibc/src/mynewt.c                      |   47 -
 libs/baselibc/src/nrand48.c                     |   11 -
 libs/baselibc/src/qsort.c                       |   46 -
 libs/baselibc/src/realloc.c                     |   50 -
 libs/baselibc/src/sprintf.c                     |   18 -
 libs/baselibc/src/srand48.c                     |   15 -
 libs/baselibc/src/sscanf.c                      |   17 -
 libs/baselibc/src/strcasecmp.c                  |   24 -
 libs/baselibc/src/strcat.c                      |   11 -
 libs/baselibc/src/strchr.c                      |   17 -
 libs/baselibc/src/strcmp.c                      |   21 -
 libs/baselibc/src/strcpy.c                      |   20 -
 libs/baselibc/src/strcspn.c                     |   51 -
 libs/baselibc/src/strdup.c                      |   17 -
 libs/baselibc/src/strlcat.c                     |   30 -
 libs/baselibc/src/strlcpy.c                     |   26 -
 libs/baselibc/src/strlen.c                      |   13 -
 libs/baselibc/src/strncasecmp.c                 |   24 -
 libs/baselibc/src/strncat.c                     |   21 -
 libs/baselibc/src/strncmp.c                     |   21 -
 libs/baselibc/src/strncpy.c                     |   24 -
 libs/baselibc/src/strndup.c                     |   19 -
 libs/baselibc/src/strnlen.c                     |   18 -
 libs/baselibc/src/strntoimax.c                  |   13 -
 libs/baselibc/src/strntoumax.c                  |   77 -
 libs/baselibc/src/strpbrk.c                     |   55 -
 libs/baselibc/src/strrchr.c                     |   19 -
 libs/baselibc/src/strsep.c                      |   21 -
 libs/baselibc/src/strspn.c                      |   56 -
 libs/baselibc/src/strstr.c                      |   11 -
 libs/baselibc/src/strtoimax.c                   |    3 -
 libs/baselibc/src/strtok.c                      |   12 -
 libs/baselibc/src/strtok_r.c                    |   13 -
 libs/baselibc/src/strtol.c                      |    3 -
 libs/baselibc/src/strtoll.c                     |    3 -
 libs/baselibc/src/strtoul.c                     |    3 -
 libs/baselibc/src/strtoull.c                    |    3 -
 libs/baselibc/src/strtoumax.c                   |    3 -
 libs/baselibc/src/templates/atox.c.template     |   14 -
 libs/baselibc/src/templates/strtox.c.template   |   14 -
 libs/baselibc/src/tinyprintf.c                  |  362 ----
 libs/baselibc/src/vasprintf.c                   |   25 -
 libs/baselibc/src/vprintf.c                     |   11 -
 libs/baselibc/src/vsprintf.c                    |   11 -
 libs/baselibc/src/vsscanf.c                     |  400 ----
 libs/bleuart/include/bleuart/bleuart.h          |   34 -
 libs/bleuart/pkg.yml                            |   42 -
 libs/bleuart/src/bleuart.c                      |  201 --
 .../include/boot_serial/boot_serial.h           |   33 -
 libs/boot_serial/pkg.yml                        |   35 -
 libs/boot_serial/src/boot_serial.c              |  403 ----
 libs/boot_serial/src/boot_serial_priv.h         |   61 -
 libs/boot_serial/test/pkg.yml                   |   33 -
 libs/boot_serial/test/src/boot_test.c           |  231 ---
 libs/bootutil/design.txt                        |  413 ----
 libs/bootutil/include/bootutil/bootutil_misc.h  |   28 -
 libs/bootutil/include/bootutil/bootutil_test.h  |   25 -
 libs/bootutil/include/bootutil/image.h          |   89 -
 libs/bootutil/include/bootutil/loader.h         |   84 -
 libs/bootutil/include/bootutil/sign_key.h       |   33 -
 libs/bootutil/pkg.yml                           |   41 -
 libs/bootutil/signed_images.md                  |   91 -
 libs/bootutil/src/bootutil_misc.c               |  319 ----
 libs/bootutil/src/bootutil_priv.h               |   75 -
 libs/bootutil/src/image_ec.c                    |  121 --
 libs/bootutil/src/image_rsa.c                   |  144 --
 libs/bootutil/src/image_validate.c              |  198 --
 libs/bootutil/src/loader.c                      |  652 -------
 libs/bootutil/test/pkg.yml                      |   30 -
 libs/bootutil/test/src/boot_test.c              | 1169 ------------
 libs/cmsis-core/pkg.yml                         |   27 -
 libs/cmsis-core/src/cmsis_nvic.c                |   73 -
 libs/cmsis-core/src/ext/core_ca9.h              |  271 ---
 libs/cmsis-core/src/ext/core_caFunc.h           | 1161 ------------
 libs/cmsis-core/src/ext/core_caInstr.h          |   45 -
 libs/cmsis-core/src/ext/core_ca_mmu.h           |  848 ---------
 libs/cmsis-core/src/ext/core_cm0.h              |  682 -------
 libs/cmsis-core/src/ext/core_cm0plus.h          |  793 --------
 libs/cmsis-core/src/ext/core_cm3.h              | 1627 ----------------
 libs/cmsis-core/src/ext/core_cm4.h              | 1772 ------------------
 libs/cmsis-core/src/ext/core_cm4_simd.h         |  673 -------
 libs/cmsis-core/src/ext/core_cmFunc.h           |  636 -------
 libs/cmsis-core/src/ext/core_cmInstr.h          |  688 -------
 libs/console/README.md                          |   33 -
 libs/console/full/include/console/console.h     |   38 -
 libs/console/full/include/console/prompt.h      |   33 -
 libs/console/full/pkg.yml                       |   44 -
 libs/console/full/src/cons_fmt.c                |   77 -
 libs/console/full/src/cons_tty.c                |  561 ------
 libs/console/full/src/prompt.c                  |   49 -
 libs/console/stub/include/console/console.h     |   71 -
 libs/console/stub/include/console/prompt.h      |   35 -
 libs/console/stub/pkg.yml                       |   27 -
 libs/crash_test/include/crash_test/crash_test.h |   27 -
 libs/crash_test/pkg.yml                         |   42 -
 libs/crash_test/src/crash_cli.c                 |   49 -
 libs/crash_test/src/crash_nmgr.c                |   75 -
 libs/crash_test/src/crash_test.c                |   72 -
 libs/crash_test/src/crash_test_priv.h           |   31 -
 libs/elua/README.md                             |    7 -
 libs/elua/elua_base/LICENSE                     |   62 -
 libs/elua/elua_base/LICENSE.luarpc              |   32 -
 libs/elua/elua_base/include/elua_base/elua.h    |   27 -
 libs/elua/elua_base/pkg.yml                     |   50 -
 libs/elua/elua_base/src/lapi.c                  | 1161 ------------
 libs/elua/elua_base/src/lapi.h                  |   16 -
 libs/elua/elua_base/src/lauxlib.c               |  867 ---------
 libs/elua/elua_base/src/lauxlib.h               |  179 --
 libs/elua/elua_base/src/lbaselib.c              |  718 -------
 libs/elua/elua_base/src/lcode.c                 |  831 --------
 libs/elua/elua_base/src/lcode.h                 |   76 -
 libs/elua/elua_base/src/ldblib.c                |  397 ----
 libs/elua/elua_base/src/ldebug.c                |  649 -------
 libs/elua/elua_base/src/ldebug.h                |   33 -
 libs/elua/elua_base/src/ldo.c                   |  537 ------
 libs/elua/elua_base/src/ldo.h                   |   57 -
 libs/elua/elua_base/src/ldump.c                 |  321 ----
 libs/elua/elua_base/src/legc.c                  |   12 -
 libs/elua/elua_base/src/legc.h                  |   17 -
 libs/elua/elua_base/src/lfunc.c                 |  176 --
 libs/elua/elua_base/src/lfunc.h                 |   37 -
 libs/elua/elua_base/src/lgc.c                   |  743 --------
 libs/elua/elua_base/src/lgc.h                   |  136 --
 libs/elua/elua_base/src/linit.c                 |  154 --
 libs/elua/elua_base/src/liolib.c.donotcompile   |  619 ------
 libs/elua/elua_base/src/llex.c                  |  458 -----
 libs/elua/elua_base/src/llex.h                  |   81 -
 libs/elua/elua_base/src/llimits.h               |  128 --
 libs/elua/elua_base/src/lmathlib.c              |  395 ----
 libs/elua/elua_base/src/lmem.c                  |   86 -
 libs/elua/elua_base/src/lmem.h                  |   49 -
 libs/elua/elua_base/src/lmynewt.c               |   56 -
 libs/elua/elua_base/src/loadlib.c.donotcompile  |  684 -------
 libs/elua/elua_base/src/lobject.c               |  216 ---
 libs/elua/elua_base/src/lobject.h               |  557 ------
 libs/elua/elua_base/src/lopcodes.c              |  102 -
 libs/elua/elua_base/src/lopcodes.h              |  268 ---
 libs/elua/elua_base/src/loslib.c.donotcompile   |  247 ---
 libs/elua/elua_base/src/lparser.c               | 1345 -------------
 libs/elua/elua_base/src/lparser.h               |   82 -
 libs/elua/elua_base/src/lrodefs.h               |   34 -
 libs/elua/elua_base/src/lrotable.c              |  134 --
 libs/elua/elua_base/src/lrotable.h              |   77 -
 libs/elua/elua_base/src/lstate.c                |  258 ---
 libs/elua/elua_base/src/lstate.h                |  171 --
 libs/elua/elua_base/src/lstring.c               |  147 --
 libs/elua/elua_base/src/lstring.h               |   34 -
 libs/elua/elua_base/src/lstrlib.c               |  893 ---------
 libs/elua/elua_base/src/ltable.c                |  759 --------
 libs/elua/elua_base/src/ltable.h                |   44 -
 libs/elua/elua_base/src/ltablib.c               |  287 ---
 libs/elua/elua_base/src/ltm.c                   |   84 -
 libs/elua/elua_base/src/ltm.h                   |   54 -
 libs/elua/elua_base/src/lua.c                   |  420 -----
 libs/elua/elua_base/src/lua.h                   |  399 ----
 libs/elua/elua_base/src/luac.c.donotcompile     |  242 ---
 libs/elua/elua_base/src/luaconf.h               |  891 ---------
 libs/elua/elua_base/src/lualib.h                |   53 -
 libs/elua/elua_base/src/lundump.c               |  336 ----
 libs/elua/elua_base/src/lundump.h               |   60 -
 libs/elua/elua_base/src/lvm.c                   |  825 --------
 libs/elua/elua_base/src/lvm.h                   |   36 -
 libs/elua/elua_base/src/lzio.c                  |   85 -
 libs/elua/elua_base/src/lzio.h                  |   72 -
 libs/elua/elua_base/src/print.c.donotcompile    |  227 ---
 libs/flash_test/include/flash_test/flash_test.h |   27 -
 libs/flash_test/pkg.yml                         |   30 -
 libs/flash_test/src/flash_test/flash_test.c     |  155 --
 libs/imgmgr/pkg.yml                             |    6 +-
 libs/imgmgr/src/imgmgr.c                        |    2 +-
 libs/imgmgr/src/imgmgr_boot.c                   |    2 +-
 libs/imgmgr/src/imgmgr_cli.c                    |    2 +-
 libs/imgmgr/src/imgmgr_coredump.c               |    2 +-
 libs/imgmgr/src/imgmgr_fs.c                     |    2 +-
 libs/iotivity/pkg.yml                           |    8 +-
 libs/json/MSJSON_COPYING                        |   28 -
 libs/json/include/json/json.h                   |  245 ---
 libs/json/pkg.yml                               |   26 -
 libs/json/src/json_decode.c                     |  670 -------
 libs/json/src/json_encode.c                     |  248 ---
 libs/json/test/pkg.yml                          |   30 -
 libs/json/test/src/test_json.c                  |   43 -
 libs/json/test/src/test_json.h                  |   27 -
 libs/json/test/src/test_json_simple.c           |  360 ----
 libs/newtmgr/nmgr_os/pkg.yml                    |    6 +-
 libs/newtmgr/pkg.yml                            |    6 +-
 libs/newtmgr/transport/ble/pkg.yml              |    2 +-
 libs/newtmgr_oic/pkg.yml                        |    8 +-
 libs/os/include/os/arch/cortex_m0/os/os_arch.h  |   74 -
 libs/os/include/os/arch/cortex_m4/os/os_arch.h  |   75 -
 libs/os/include/os/arch/sim/os/os_arch.h        |   74 -
 libs/os/include/os/endian.h                     |   92 -
 libs/os/include/os/os.h                         |  101 -
 libs/os/include/os/os_callout.h                 |   60 -
 libs/os/include/os/os_cfg.h                     |   25 -
 libs/os/include/os/os_dev.h                     |  114 --
 libs/os/include/os/os_eventq.h                  |   51 -
 libs/os/include/os/os_heap.h                    |   30 -
 libs/os/include/os/os_malloc.h                  |   34 -
 libs/os/include/os/os_mbuf.h                    |  297 ---
 libs/os/include/os/os_mempool.h                 |   94 -
 libs/os/include/os/os_mutex.h                   |   59 -
 libs/os/include/os/os_sanity.h                  |   56 -
 libs/os/include/os/os_sched.h                   |   37 -
 libs/os/include/os/os_sem.h                     |   52 -
 libs/os/include/os/os_task.h                    |  114 --
 libs/os/include/os/os_test.h                    |   25 -
 libs/os/include/os/os_time.h                    |  111 --
 libs/os/include/os/queue.h                      |  514 -----
 libs/os/pkg.yml                                 |   84 -
 libs/os/src/arch/cortex_m0/m0/HAL_CM0.s         |  277 ---
 libs/os/src/arch/cortex_m0/m0/SVC_Table.s       |   56 -
 libs/os/src/arch/cortex_m0/os_arch_arm.c        |  333 ----
 libs/os/src/arch/cortex_m0/os_fault.c           |  158 --
 libs/os/src/arch/cortex_m4/m4/HAL_CM4.s         |  224 ---
 libs/os/src/arch/cortex_m4/m4/SVC_Table.s       |   56 -
 libs/os/src/arch/cortex_m4/os_arch_arm.c        |  328 ----
 libs/os/src/arch/cortex_m4/os_fault.c           |  160 --
 libs/os/src/arch/sim/os_arch_sim.c              |  462 -----
 libs/os/src/arch/sim/os_arch_stack_frame.s      |  101 -
 libs/os/src/arch/sim/os_fault.c                 |   34 -
 libs/os/src/os.c                                |  191 --
 libs/os/src/os_callout.c                        |  200 --
 libs/os/src/os_dev.c                            |  309 ---
 libs/os/src/os_eventq.c                         |  235 ---
 libs/os/src/os_heap.c                           |  106 --
 libs/os/src/os_mbuf.c                           | 1270 -------------
 libs/os/src/os_mempool.c                        |  233 ---
 libs/os/src/os_msys_init.c                      |  147 --
 libs/os/src/os_mutex.c                          |  236 ---
 libs/os/src/os_priv.h                           |   38 -
 libs/os/src/os_sanity.c                         |  238 ---
 libs/os/src/os_sched.c                          |  330 ----
 libs/os/src/os_sem.c                            |  212 ---
 libs/os/src/os_task.c                           |  216 ---
 libs/os/src/os_time.c                           |  248 ---
 libs/os/test/pkg.yml                            |   30 -
 .../test/src/arch/cortex_m4/os_test_arch_arm.c  |   27 -
 libs/os/test/src/arch/sim/os_test_arch_sim.c    |   52 -
 libs/os/test/src/callout_test.c                 |  330 ----
 libs/os/test/src/eventq_test.c                  |  416 ----
 libs/os/test/src/mbuf_test.c                    |  420 -----
 libs/os/test/src/mempool_test.c                 |  227 ---
 libs/os/test/src/mutex_test.c                   |  407 ----
 libs/os/test/src/os_test.c                      |   53 -
 libs/os/test/src/os_test_priv.h                 |   32 -
 libs/os/test/src/sem_test.c                     |  401 ----
 libs/shell/include/shell/shell.h                |   48 -
 libs/shell/include/shell/shell_prompt.h         |   25 -
 libs/shell/pkg.yml                              |   48 -
 libs/shell/src/shell.c                          |  579 ------
 libs/shell/src/shell_os.c                       |  156 --
 libs/shell/src/shell_priv.h                     |   27 -
 libs/shell/src/shell_prompt.c                   |   69 -
 libs/split/README.md                            |   63 -
 libs/split/include/split/split.h                |   57 -
 libs/split/include/split/split_priv.h           |   30 -
 libs/split/pkg.yml                              |   30 -
 libs/split/src/split.c                          |   77 -
 libs/split/src/split_config.c                   |   95 -
 libs/split/src/split_netmgr.c                   |  149 --
 libs/testreport/include/testreport/testreport.h |   34 -
 libs/testreport/pkg.yml                         |   30 -
 libs/testreport/src/arch/cortex_m4/io.c         |   91 -
 libs/testreport/src/arch/sim/io.c               |  140 --
 libs/testreport/src/results.c                   |  190 --
 libs/testreport/src/testreport.c                |  131 --
 libs/testreport/src/testreport_priv.h           |   48 -
 libs/testutil/design.txt                        |  476 -----
 libs/testutil/include/testutil/testutil.h       |  174 --
 libs/testutil/pkg.yml                           |   30 -
 .../src/arch/cortex_m4/testutil_arch_arm.c      |   27 -
 libs/testutil/src/arch/sim/testutil_arch_sim.c  |   30 -
 libs/testutil/src/arch/sim/tu_args.c            |   23 -
 libs/testutil/src/case.c                        |  255 ---
 libs/testutil/src/suite.c                       |   67 -
 libs/testutil/src/testutil.c                    |   50 -
 libs/testutil/src/testutil_priv.h               |   34 -
 libs/tinycbor/include/tinycbor/assert_p.h       |   29 -
 libs/tinycbor/include/tinycbor/cbor.h           |  479 -----
 .../tinycbor/include/tinycbor/cborconstants_p.h |   52 -
 libs/tinycbor/include/tinycbor/cborjson.h       |   62 -
 .../include/tinycbor/compilersupport_p.h        |  218 ---
 .../include/tinycbor/extract_number_p.h         |   78 -
 libs/tinycbor/include/tinycbor/math_support_p.h |   47 -
 libs/tinycbor/pkg.yml                           |   26 -
 libs/tinycbor/src/cborencoder.c                 |  629 -------
 .../src/cborencoder_close_container_checked.c   |   82 -
 libs/tinycbor/src/cborerrorstrings.c            |  165 --
 libs/tinycbor/src/cborparser.c                  | 1293 -------------
 libs/tinycbor/src/cborparser_dup_string.c       |  113 --
 libs/tinycbor/src/cborpretty.c                  |  470 -----
 libs/tinycbor/src/cbortojson.c                  |  686 -------
 libs/tinycbor/src/open_memstream.c              |  117 --
 libs/util/include/util/base64.h                 |   32 -
 libs/util/include/util/crc16.h                  |   36 -
 libs/util/include/util/crc8.h                   |   32 -
 libs/util/include/util/hex.h                    |   25 -
 libs/util/include/util/tpq.h                    |   67 -
 libs/util/pkg.yml                               |    2 +-
 libs/util/src/base64.c                          |  181 --
 libs/util/src/crc16.c                           |   83 -
 libs/util/src/crc8.c                            |   74 -
 libs/util/src/hex.c                             |  101 -
 libs/util/src/tpq.c                             |   88 -
 net/ip/inet_def_service/pkg.yml                 |    4 +-
 .../include/mn_socket/arch/sim/native_sock.h    |   25 +
 net/ip/mn_socket/include/mn_socket/mn_socket.h  |  218 +++
 .../mn_socket/include/mn_socket/mn_socket_ops.h |   85 +
 net/ip/mn_socket/pkg.yml                        |   30 +
 net/ip/mn_socket/src/arch/sim/native_itf.c      |  212 +++
 net/ip/mn_socket/src/arch/sim/native_sock.c     |  753 ++++++++
 .../mn_socket/src/arch/sim/native_sock_priv.h   |   32 +
 net/ip/mn_socket/src/mn_socket.c                |  138 ++
 net/ip/mn_socket/src/mn_socket_aconv.c          |   98 +
 net/ip/mn_socket/test/pkg.yml                   |   30 +
 net/ip/mn_socket/test/src/mn_sock_test.c        |  895 +++++++++
 net/nimble/controller/pkg.yml                   |    2 +-
 net/nimble/host/pkg.yml                         |    2 +-
 .../services/bleuart/include/bleuart/bleuart.h  |   34 +
 net/nimble/host/services/bleuart/pkg.yml        |   42 +
 net/nimble/host/services/bleuart/src/bleuart.c  |  201 ++
 net/nimble/host/src/ble_hs.c                    |    5 +-
 net/nimble/pkg.yml                              |    2 +-
 net/nimble/transport/ram/pkg.yml                |    2 +-
 net/nimble/transport/uart/pkg.yml               |    2 +-
 net/wifi/wifi_mgmt/pkg.yml                      |    2 +-
 sys/config/pkg.yml                              |    6 +-
 sys/config/src/config.c                         |    2 +-
 sys/console/README.md                           |   33 +
 sys/console/full/include/console/console.h      |   38 +
 sys/console/full/include/console/prompt.h       |   33 +
 sys/console/full/pkg.yml                        |   44 +
 sys/console/full/src/cons_fmt.c                 |   77 +
 sys/console/full/src/cons_tty.c                 |  561 ++++++
 sys/console/full/src/prompt.c                   |   49 +
 sys/console/stub/include/console/console.h      |   71 +
 sys/console/stub/include/console/prompt.h       |   35 +
 sys/console/stub/pkg.yml                        |   27 +
 sys/coredump/pkg.yml                            |    2 +-
 sys/fcb/README.md                               |   58 -
 sys/fcb/include/fcb/fcb.h                       |  134 --
 sys/fcb/pkg.yml                                 |   28 -
 sys/fcb/src/fcb.c                               |  258 ---
 sys/fcb/src/fcb_append.c                        |  143 --
 sys/fcb/src/fcb_elem_info.c                     |  101 -
 sys/fcb/src/fcb_getnext.c                       |  132 --
 sys/fcb/src/fcb_priv.h                          |   57 -
 sys/fcb/src/fcb_rotate.c                        |   56 -
 sys/fcb/src/fcb_walk.c                          |   53 -
 sys/fcb/test/pkg.yml                            |   30 -
 sys/fcb/test/src/fcb_test.c                     |  672 -------
 sys/id/pkg.yml                                  |    5 +-
 sys/id/src/id.c                                 |    2 +-
 sys/log/pkg.yml                                 |    6 +-
 .../include/mn_socket/arch/sim/native_sock.h    |   25 -
 sys/mn_socket/include/mn_socket/mn_socket.h     |  218 ---
 sys/mn_socket/include/mn_socket/mn_socket_ops.h |   85 -
 sys/mn_socket/pkg.yml                           |   30 -
 sys/mn_socket/src/arch/sim/native_itf.c         |  212 ---
 sys/mn_socket/src/arch/sim/native_sock.c        |  753 --------
 sys/mn_socket/src/arch/sim/native_sock_priv.h   |   32 -
 sys/mn_socket/src/mn_socket.c                   |  138 --
 sys/mn_socket/src/mn_socket_aconv.c             |   98 -
 sys/mn_socket/test/pkg.yml                      |   30 -
 sys/mn_socket/test/src/mn_sock_test.c           |  895 ---------
 sys/reboot/pkg.yml                              |    4 +-
 sys/shell/include/shell/shell.h                 |   48 +
 sys/shell/include/shell/shell_prompt.h          |   25 +
 sys/shell/pkg.yml                               |   50 +
 sys/shell/src/shell.c                           |  579 ++++++
 sys/shell/src/shell_os.c                        |  156 ++
 sys/shell/src/shell_priv.h                      |   27 +
 sys/shell/src/shell_prompt.c                    |   69 +
 sys/stats/pkg.yml                               |    4 +-
 sys/sysinit/pkg.yml                             |    2 +-
 test/crash_test/include/crash_test/crash_test.h |   27 +
 test/crash_test/pkg.yml                         |   42 +
 test/crash_test/src/crash_cli.c                 |   49 +
 test/crash_test/src/crash_nmgr.c                |   75 +
 test/crash_test/src/crash_test.c                |   72 +
 test/crash_test/src/crash_test_priv.h           |   31 +
 test/flash_test/include/flash_test/flash_test.h |   27 +
 test/flash_test/pkg.yml                         |   30 +
 test/flash_test/src/flash_test/flash_test.c     |  155 ++
 test/testreport/include/testreport/testreport.h |   34 +
 test/testreport/pkg.yml                         |   30 +
 test/testreport/src/arch/cortex_m4/io.c         |   91 +
 test/testreport/src/arch/sim/io.c               |  140 ++
 test/testreport/src/results.c                   |  190 ++
 test/testreport/src/testreport.c                |  131 ++
 test/testreport/src/testreport_priv.h           |   48 +
 test/testutil/design.txt                        |  476 +++++
 test/testutil/include/testutil/testutil.h       |  174 ++
 test/testutil/pkg.yml                           |   30 +
 .../src/arch/cortex_m4/testutil_arch_arm.c      |   27 +
 test/testutil/src/arch/sim/testutil_arch_sim.c  |   30 +
 test/testutil/src/arch/sim/tu_args.c            |   23 +
 test/testutil/src/case.c                        |  255 +++
 test/testutil/src/suite.c                       |   67 +
 test/testutil/src/testutil.c                    |   50 +
 test/testutil/src/testutil_priv.h               |   34 +
 726 files changed, 45582 insertions(+), 65200 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/blecent/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/blecent/pkg.yml b/apps/blecent/pkg.yml
index d0b91cb..f90ca57 100644
--- a/apps/blecent/pkg.yml
+++ b/apps/blecent/pkg.yml
@@ -23,7 +23,7 @@ pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
 pkg.deps: 
-    - libs/os 
+    - kernel/os 
     - sys/log
     - net/nimble/controller
     - net/nimble/host
@@ -31,8 +31,8 @@ pkg.deps:
     - net/nimble/host/services/gatt
     - net/nimble/host/store/ram
     - net/nimble/transport/ram
-    - libs/console/full
-    - libs/baselibc
+    - sys/console/full
+    - libc/baselibc
 
 pkg.syscfg_vals:
     # DEBUG logging is a bit noisy; use INFO.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/blehci/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/blehci/pkg.yml b/apps/blehci/pkg.yml
index 198e395..975d779 100644
--- a/apps/blehci/pkg.yml
+++ b/apps/blehci/pkg.yml
@@ -23,8 +23,8 @@ pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
 pkg.deps:
-    - libs/baselibc
-    - libs/console/stub
-    - libs/os
+    - libc/baselibc
+    - sys/console/stub
+    - kernel/os
     - net/nimble/controller
     - net/nimble/transport/uart

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/bleprph/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/bleprph/pkg.yml b/apps/bleprph/pkg.yml
index 4e15338..409f46c 100644
--- a/apps/bleprph/pkg.yml
+++ b/apps/bleprph/pkg.yml
@@ -23,7 +23,7 @@ pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
 pkg.deps: 
-    - libs/os 
+    - kernel/os 
     - sys/log
     - net/nimble/controller
     - net/nimble/host
@@ -31,8 +31,8 @@ pkg.deps:
     - net/nimble/host/services/gatt
     - net/nimble/host/store/ram
     - net/nimble/transport/ram
-    - libs/console/full
-    - libs/baselibc
+    - sys/console/full
+    - libc/baselibc
     - libs/newtmgr
     - libs/newtmgr/transport/ble
     - sys/sysinit

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/bletest/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/bletest/pkg.yml b/apps/bletest/pkg.yml
index 9068192..b17321e 100644
--- a/apps/bletest/pkg.yml
+++ b/apps/bletest/pkg.yml
@@ -28,9 +28,9 @@ pkg.deps:
     - net/nimble/controller
     - net/nimble/host
     - net/nimble/transport/ram
-    - libs/os 
-    - libs/console/full
-    - libs/shell
+    - kernel/os 
+    - sys/console/full
+    - sys/shell
     - libs/imgmgr
     - libs/newtmgr
     - sys/config

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/bletiny/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/bletiny/pkg.yml b/apps/bletiny/pkg.yml
index 465edc4..ce68b37 100644
--- a/apps/bletiny/pkg.yml
+++ b/apps/bletiny/pkg.yml
@@ -23,7 +23,7 @@ pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
 pkg.deps: 
-    - libs/os 
+    - kernel/os 
     - sys/log
     - net/nimble/controller
     - net/nimble/host
@@ -31,8 +31,8 @@ pkg.deps:
     - net/nimble/host/services/gatt
     - net/nimble/host/store/ram
     - net/nimble/transport/ram
-    - libs/console/full
-    - libs/shell
+    - sys/console/full
+    - sys/shell
 
 ### Disable some features to make bletiny small enough to fit on the nRF51.
 ### These features can be re-enabled in the target definition.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/bleuart/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/bleuart/pkg.yml b/apps/bleuart/pkg.yml
index 84abb2c..c4b731c 100644
--- a/apps/bleuart/pkg.yml
+++ b/apps/bleuart/pkg.yml
@@ -23,7 +23,7 @@ pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
 pkg.deps:
-    - libs/os
+    - kernel/os
     - sys/log
     - net/nimble/controller
     - net/nimble/host
@@ -31,11 +31,11 @@ pkg.deps:
     - net/nimble/host/services/gatt
     - net/nimble/host/store/ram
     - net/nimble/transport/ram
-    - libs/console/full
-    - libs/baselibc
+    - sys/console/full
+    - libc/baselibc
     - libs/newtmgr
     - libs/newtmgr/transport/ble
-    - libs/bleuart
+    - net/nimble/host/services/bleuart
 
 pkg.syscfg_vals:
     # Disable unused roles; bleuart is a peripheral-only app.

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/blinky/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/blinky/pkg.yml b/apps/blinky/pkg.yml
index a63becb..3b536cf 100644
--- a/apps/blinky/pkg.yml
+++ b/apps/blinky/pkg.yml
@@ -25,10 +25,10 @@ pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
 pkg.deps:
-    - libs/console/full
+    - sys/console/full
     - libs/newtmgr
-    - libs/os
-    - libs/shell
+    - kernel/os
+    - sys/shell
     - sys/config
     - sys/log
     - sys/stats

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/boot/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/boot/pkg.yml b/apps/boot/pkg.yml
index e2112a9..f97ad59 100644
--- a/apps/boot/pkg.yml
+++ b/apps/boot/pkg.yml
@@ -26,14 +26,14 @@ pkg.keywords:
     - loader
 
 pkg.deps:
-    - libs/bootutil
-    - libs/os
+    - boot/bootutil
+    - kernel/os
     - libs/util
-    - libs/console/stub
+    - sys/console/stub
 
 pkg.deps.BOOT_SERIAL.OVERWRITE:
-    - libs/console/full
-    - libs/boot_serial
+    - sys/console/full
+    - boot/boot_serial
 
 pkg.syscfg_defs:
     BOOT_LOADER:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/ffs2native/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/ffs2native/pkg.yml b/apps/ffs2native/pkg.yml
index 0644425..0825d3c 100644
--- a/apps/ffs2native/pkg.yml
+++ b/apps/ffs2native/pkg.yml
@@ -27,5 +27,5 @@ pkg.keywords:
 pkg.deps:
     - fs/nffs
     - hw/hal
-    - libs/console/full
-    - libs/os
+    - sys/console/full
+    - kernel/os

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/luatest/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/luatest/pkg.yml b/apps/luatest/pkg.yml
deleted file mode 100644
index b56be6b..0000000
--- a/apps/luatest/pkg.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-pkg.name: apps/luatest
-pkg.type: app
-pkg.description: Simple project for testing Lua scripting.
-pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
-pkg.homepage: "http://mynewt.apache.org/"
-pkg.keywords:
-
-pkg.deps:
-     - fs/nffs
-     - libs/os
-     - libs/elua/elua_base
-     - libs/console/full
-     - libs/shell
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/luatest/src/main.c
----------------------------------------------------------------------
diff --git a/apps/luatest/src/main.c b/apps/luatest/src/main.c
deleted file mode 100755
index f71cbe3..0000000
--- a/apps/luatest/src/main.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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 <assert.h>
-#include <string.h>
-#include "os/os.h"
-#include "bsp/bsp.h"
-#include "elua_base/elua.h"
-#include "fs/fs.h"
-#ifdef ARCH_sim
-#include "mcu/mcu_sim.h"
-#endif
-
-static void
-create_script_file(void)
-{
-    char filename[] = "/foobar";
-    char script[] = "print \"eat my shorts\"\n";
-    struct fs_file *nf;
-    int rc;
-
-    rc = fs_open(filename, FS_ACCESS_READ, &nf);
-    if (rc) {
-        rc = fs_open(filename, FS_ACCESS_WRITE, &nf);
-        assert(rc == 0);
-        rc = fs_write(nf, script, strlen(script));
-        assert(rc == 0);
-    }
-    fs_close(nf);
-}
-
-/**
- * main
- *
- * The main function for the project. This function initializes and starts the
- * OS.  We should not return from os start.
- *
- * @return int NOTE: this function should never return!
- */
-int
-main(int argc, char **argv)
-{
-#ifdef ARCH_sim
-    mcu_sim_parse_args(argc, argv);
-#endif
-
-    /* Initialize OS */
-    os_init();
-
-    create_script_file();
-
-    /* Start the OS */
-    os_start();
-
-    /* os start should never return. If it does, this should be an error */
-    assert(0);
-
-    return 0;
-}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/ocf_sample/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/ocf_sample/pkg.yml b/apps/ocf_sample/pkg.yml
index 3abca7e..cb69117 100644
--- a/apps/ocf_sample/pkg.yml
+++ b/apps/ocf_sample/pkg.yml
@@ -25,14 +25,14 @@ pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
 pkg.deps:
-    - libs/os
+    - kernel/os
     - libs/util
     - sys/log
     - libs/iotivity
 
 pkg.deps.OC_TRANSPORT_SERIAL:
-    - libs/shell
-    - libs/console/full
+    - sys/shell
+    - sys/console/full
 
 pkg.deps.OC_TRANSPORT_GATT:
     - net/nimble/controller

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/sblinky/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/sblinky/pkg.yml b/apps/sblinky/pkg.yml
deleted file mode 100644
index 54f7508..0000000
--- a/apps/sblinky/pkg.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you 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.
-#
-
-pkg.name: apps/sblinky
-pkg.type: app
-pkg.description: Basic example application which blinks an LED.
-pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
-pkg.homepage: "http://mynewt.apache.org/"
-pkg.keywords:
-
-pkg.deps:
-    - libs/newtmgr
-    - hw/drivers/adc
-    - fs/nffs
-    - libs/console/full
-    - libs/os
-    - libs/shell
-    - sys/config
-    - sys/log
-    - sys/stats

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/sblinky/src/main.c
----------------------------------------------------------------------
diff --git a/apps/sblinky/src/main.c b/apps/sblinky/src/main.c
deleted file mode 100755
index 2358c0d..0000000
--- a/apps/sblinky/src/main.c
+++ /dev/null
@@ -1,599 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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 "os/os.h"
-#include "bsp/bsp.h"
-#include "hal/hal_gpio.h"
-#include "hal/hal_spi.h"
-#include "console/console.h"
-#include "shell/shell.h"
-#include "stats/stats.h"
-#include "config/config.h"
-#include <os/os_dev.h>
-#include <adc/adc.h>
-#include <assert.h>
-#include <string.h>
-#ifdef ARCH_sim
-#include <mcu/mcu_sim.h>
-#endif
-
-#ifdef NRF51
-#include "nrf.h"
-#include <adc_nrf51/adc_nrf51.h>
-#include "nrf_drv_adc.h"
-#include "app_util_platform.h"
-#include "app_error.h"
-nrf_drv_adc_config_t adc_config = NRF_DRV_ADC_DEFAULT_CONFIG;
-nrf_drv_adc_channel_t g_nrf_adc_chan =
-    NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_2);
-#endif
-
-#ifdef NRF52
-#include "nrf.h"
-#include <adc_nrf52/adc_nrf52.h>
-#include "nrf_drv_saadc.h"
-#include "app_util_platform.h"
-#include "app_error.h"
-nrf_drv_saadc_config_t adc_config = NRF_DRV_SAADC_DEFAULT_CONFIG;
-#endif
-
-#ifdef STM32F4
-#include "stm32f4xx_hal_dma.h"
-#include "stm32f4xx_hal_adc.h"
-#include <adc_stm32f4/adc_stm32f4.h>
-#endif
-
-#if defined(NRF52) || defined(NRF51)
-/* The spi txrx callback */
-struct sblinky_spi_cb_arg
-{
-    int transfers;
-    int txlen;
-    uint32_t tx_rx_bytes;
-};
-struct sblinky_spi_cb_arg spi_cb_obj;
-void *spi_cb_arg;
-#endif
-
-int g_result_mv;
-int g_result;
-
-/* Init all tasks */
-volatile int tasks_initialized;
-int init_tasks(void);
-
-/* Task 1 */
-#define TASK1_PRIO (1)
-#define TASK1_STACK_SIZE    OS_STACK_ALIGN(1024)
-struct os_task task1;
-os_stack_t stack1[TASK1_STACK_SIZE];
-static volatile int g_task1_loops;
-
-/* Task 2 */
-#define TASK2_PRIO (2)
-#define TASK2_STACK_SIZE    OS_STACK_ALIGN(1024)
-struct os_task task2;
-os_stack_t stack2[TASK2_STACK_SIZE];
-
-static volatile int g_task2_loops;
-
-/* Global test semaphore */
-struct os_sem g_test_sem;
-
-/* For LED toggling */
-int g_led_pin;
-
-#if MYNEWT_VAL(SPI_MASTER)
-uint8_t g_spi_tx_buf[32];
-uint8_t g_spi_rx_buf[32];
-
-void
-sblinky_spi_irqm_handler(void *arg, int len)
-{
-    struct sblinky_spi_cb_arg *cb;
-
-    hal_gpio_set(SPI0_CONFIG_CSN_PIN);
-
-    assert(arg == spi_cb_arg);
-    if (spi_cb_arg) {
-        cb = (struct sblinky_spi_cb_arg *)arg;
-        assert(len == cb->txlen);
-        ++cb->transfers;
-    }
-}
-
-#if 1
-static void
-sblinky_spi_tx_vals(int spi_num, uint8_t *buf, int len)
-{
-    int i;
-    int rc;
-    uint8_t *txptr;
-
-    /* Send all bytes in a loop */
-    txptr = buf;
-    for (i = 0; i < len; ++i) {
-        rc = hal_spi_tx_val(0, *txptr);
-        assert(rc != 0xFFFF);
-        ++txptr;
-    }
-}
-#endif
-#endif
-
-#if MYNEWT_VAL(SPI_SLAVE)
-uint8_t g_spi_tx_buf[32];
-uint8_t g_spi_rx_buf[32];
-
-/* XXX: This is an ugly hack for now. */
-#ifdef NRF51
-#define SPI_SLAVE_ID    (1)
-#else
-#define SPI_SLAVE_ID    (0)
-#endif
-
-void
-sblinky_spi_irqs_handler(void *arg, int len)
-{
-    struct sblinky_spi_cb_arg *cb;
-
-    assert(arg == spi_cb_arg);
-    if (spi_cb_arg) {
-        cb = (struct sblinky_spi_cb_arg *)arg;
-        ++cb->transfers;
-        cb->tx_rx_bytes += len;
-    }
-
-    /* Post semaphore to task waiting for SPI slave */
-    os_sem_release(&g_test_sem);
-}
-#endif
-
-void
-sblinky_spi_cfg(int spi_num)
-{
-    int spi_id = 0;
-    struct hal_spi_settings my_spi;
-
-#if MYNEWT_VAL(SPI_MASTER)
-    my_spi.spi_type = HAL_SPI_TYPE_MASTER;
-    my_spi.data_order = HAL_SPI_MSB_FIRST;
-    my_spi.data_mode = HAL_SPI_MODE0;
-    my_spi.baudrate = 8000;
-    my_spi.word_size = HAL_SPI_WORD_SIZE_8BIT;
-    my_spi.txrx_cb_func = NULL;
-    my_spi.txrx_cb_arg = NULL;
-    spi_id = 0;
-#endif
-
-#if MYNEWT_VAL(SPI_SLAVE)
-    my_spi.spi_type = HAL_SPI_TYPE_SLAVE;
-    my_spi.data_order = HAL_SPI_MSB_FIRST;
-    my_spi.data_mode = HAL_SPI_MODE0;
-    my_spi.baudrate = 0;
-    my_spi.word_size = HAL_SPI_WORD_SIZE_8BIT;
-    my_spi.txrx_cb_func = sblinky_spi_irqs_handler;
-    my_spi.txrx_cb_arg = spi_cb_arg;
-    spi_id = SPI_SLAVE_ID;
-#endif
-    hal_spi_config(spi_id, &my_spi);
-}
-
-#if 0
-#define SAADC_SAMPLES_IN_BUFFER (4)
-static nrf_saadc_value_t       m_buffer_pool[2][SAADC_SAMPLES_IN_BUFFER];
-
-int event_finished;
-int total_events;
-
-static void
-saadc_cb(const nrf_drv_saadc_evt_t *event)
-{
-    if (event->type == NRF_DRV_SAADC_EVT_DONE) {
-        ++event_finished;
-    }
-    ++total_events;
-}
-
-void
-saadc_test(void)
-{
-    ret_code_t rc;
-    nrf_saadc_channel_config_t cc =
-        NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);
-
-    rc = nrf_drv_saadc_init(NULL, saadc_cb);
-    APP_ERROR_CHECK(rc);
-    rc = nrf_drv_saadc_channel_init(0, &cc);
-    APP_ERROR_CHECK(rc);
-
-    rc = nrf_drv_saadc_buffer_convert(m_buffer_pool[0], SAADC_SAMPLES_IN_BUFFER);
-    APP_ERROR_CHECK(rc);
-
-    rc = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAADC_SAMPLES_IN_BUFFER);
-    APP_ERROR_CHECK(rc);
-}
-#endif
-
-
-#define ADC_NUMBER_SAMPLES (16)
-#define ADC_NUMBER_CHANNELS (1)
-
-#if MYNEWT_VAL(ADC_3)
-
-#define STM32F4_ADC3_DEFAULT_CHAN_CFG {\
-    .Channel = ADC_CHANNEL_4,\
-    .Rank = 1,\
-    .SamplingTime = ADC_SAMPLETIME_144CYCLES,\
-    .Offset = 0\
-}
-
-ADC_ChannelConfTypeDef adc3_chan_cfg = STM32F4_ADC3_DEFAULT_CHAN_CFG;
-
-uint8_t *sample_buffer1;
-uint8_t *sample_buffer2;
-
-int adc3_result;
-int my_result_mv3[ADC_NUMBER_SAMPLES];
-
-int
-adc3_read_event(struct adc_dev *dev, void *arg, uint8_t etype,
-        void *buffer, int buffer_len)
-{
-    int i;
-    int rc;
-
-    for (i = 0; i < ADC_NUMBER_SAMPLES; i++) {
-        rc = adc_buf_read(dev, buffer, buffer_len, i, &adc3_result);
-        if (rc != 0) {
-            goto err;
-        }
-        my_result_mv3[i] = adc_result_mv(dev, ADC_CHANNEL_4, adc3_result);
-    }
-
-    adc_buf_release(dev, buffer, buffer_len);
-
-    return (0);
-err:
-    return (rc);
-}
-#endif
-
-#if MYNEWT_VAL(ADC_1)
-
-#define STM32F4_ADC1_DEFAULT_CHAN_CFG {\
-    .Channel = ADC_CHANNEL_10,\
-    .Rank = 1,\
-    .SamplingTime = ADC_SAMPLETIME_144CYCLES,\
-    .Offset = 0\
-}
-
-ADC_ChannelConfTypeDef adc1_chan_cfg = STM32F4_ADC1_DEFAULT_CHAN_CFG;
-
-int adc1_result;
-int my_result_mv1[ADC_NUMBER_SAMPLES];
-uint8_t *sample_buffer3;
-uint8_t *sample_buffer4;
-int
-adc1_read_event(struct adc_dev *dev, void *arg, uint8_t etype,
-        void *buffer, int buffer_len)
-{
-    int i;
-    int rc;
-
-    for (i = 0; i < ADC_NUMBER_SAMPLES; i++) {
-        rc = adc_buf_read(dev, buffer, buffer_len, i, &adc1_result);
-        if (rc != 0) {
-            goto err;
-        }
-        my_result_mv1[i] = adc_result_mv(dev, ADC_CHANNEL_10, adc1_result);
-    }
-
-    adc_buf_release(dev, buffer, buffer_len);
-
-    return (0);
-err:
-    return (rc);
-}
-#endif
-
-void
-task1_handler(void *arg)
-{
-    struct os_task *t;
-#if MYNEWT_VAL(ADC_3)
-    struct adc_dev *adc3;
-#endif
-#if MYNEWT_VAL(ADC_1)
-    struct adc_dev *adc1;
-#endif
-
-#if MYNEWT_VAL(SPI_MASTER)
-    int i;
-    uint8_t last_val;
-#endif
-
-#ifdef NRF52
-    nrf_saadc_channel_config_t cc =
-        NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN1);
-    cc.gain = NRF_SAADC_GAIN1_4;
-    cc.reference = NRF_SAADC_REFERENCE_VDD4;
-#endif
-
-    /* Set the led pin for the E407 devboard */
-    g_led_pin = LED_BLINK_PIN;
-    hal_gpio_init_out(g_led_pin, 1);
-
-#if MYNEWT_VAL(ADC_3)
-    adc3 = (struct adc_dev *) os_dev_open("adc3", 1, NULL);
-    assert(adc3 != NULL);
-#endif
-
-#if MYNEWT_VAL(ADC_1)
-    adc1 = (struct adc_dev *) os_dev_open("adc1", 1, NULL);
-    assert(adc1 != NULL);
-#endif
-
-#ifdef NRF51
-    adc_chan_config(adc3, 0, &g_nrf_adc_chan);
-#endif
-
-#ifdef NRF52
-    adc_chan_config(adc3, 0, &cc);
-#endif
-
-#ifdef STM32F4
-#if MYNEWT_VAL(ADC_3)
-    adc_chan_config(adc3, ADC_CHANNEL_4, &adc3_chan_cfg);
-#endif
-#if MYNEWT_VAL(ADC_1)
-    adc_chan_config(adc1, ADC_CHANNEL_10, &adc1_chan_cfg);
-#endif
-#endif
-
-#if MYNEWT_VAL(SPI_MASTER)
-    /* Use SS pin for testing */
-    hal_gpio_init_out(SPI0_CONFIG_CSN_PIN, 1);
-    sblinky_spi_cfg(0);
-    hal_spi_enable(0);
-
-#if 1
-    int rc;
-    /* Send some bytes in a non-blocking manner to SPI using tx val */
-    g_spi_tx_buf[0] = 0xde;
-    g_spi_tx_buf[1] = 0xad;
-    g_spi_tx_buf[2] = 0xbe;
-    g_spi_tx_buf[3] = 0xef;
-    sblinky_spi_tx_vals(0, g_spi_tx_buf, 4);
-
-    /* Send blocking with txrx interface */
-    for (i = 0; i < 32; ++i) {
-        g_spi_tx_buf[i] = i + 1;
-    }
-    memset(g_spi_rx_buf, 0x55, 32);
-    rc = hal_spi_txrx(0, g_spi_tx_buf, g_spi_rx_buf, 32);
-    assert(!rc);
-
-    /* Now send with no rx buf and make sure it dont change! */
-    for (i = 0; i < 32; ++i) {
-        g_spi_tx_buf[i] = (uint8_t)(i + 32);
-    }
-    memset(g_spi_rx_buf, 0xAA, 32);
-    rc = hal_spi_txrx(0, g_spi_tx_buf, NULL, 32);
-    assert(!rc);
-    for (i = 0; i < 32; ++i) {
-        if (g_spi_rx_buf[i] != 0xAA) {
-            assert(0);
-        }
-    }
-#endif
-
-    /* Set up for non-blocking */
-    hal_spi_disable(0);
-    spi_cb_arg = &spi_cb_obj;
-    spi_cb_obj.txlen = 32;
-    hal_spi_set_txrx_cb(0, sblinky_spi_irqm_handler, spi_cb_arg);
-    hal_spi_enable(0);
-#endif
-
-#if MYNEWT_VAL(SPI_SLAVE)
-    sblinky_spi_cfg(SPI_SLAVE_ID);
-    hal_spi_enable(SPI_SLAVE_ID);
-
-    /* Make the default character 0xAA */
-    hal_spi_slave_set_def_tx_val(SPI_SLAVE_ID, 0xAA);
-
-    /* Setup a buffer to receive into */
-    memset(g_spi_tx_buf, 0xEE, 32);
-    rc = hal_spi_txrx(SPI_SLAVE_ID, g_spi_tx_buf, g_spi_rx_buf, 32);
-    assert(rc == 0);
-#endif
-#if MYNEWT_VAL(ADC_3)
-    sample_buffer1 = malloc(adc_buf_size(adc3, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-    sample_buffer2 = malloc(adc_buf_size(adc3, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-    memset(sample_buffer1, 0, adc_buf_size(adc3, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-    memset(sample_buffer2, 0, adc_buf_size(adc3, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-#endif
-
-#if MYNEWT_VAL(ADC_1)
-    sample_buffer3 = malloc(adc_buf_size(adc1, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-    sample_buffer4 = malloc(adc_buf_size(adc1, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-    memset(sample_buffer3, 0, adc_buf_size(adc1, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-    memset(sample_buffer4, 0, adc_buf_size(adc1, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-#endif
-
-#if 1
-#if MYNEWT_VAL(ADC_3)
-    adc_buf_set(adc3, sample_buffer1, sample_buffer2,
-            adc_buf_size(adc3, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-    adc_event_handler_set(adc3, adc3_read_event, NULL);
-#endif
-
-#if MYNEWT_VAL(ADC_1)
-    adc_buf_set(adc1, sample_buffer3, sample_buffer4,
-            adc_buf_size(adc1, ADC_NUMBER_CHANNELS, ADC_NUMBER_SAMPLES));
-    adc_event_handler_set(adc1, adc1_read_event, NULL);
-#endif
-#endif
-
-    while (1) {
-        t = os_sched_get_current_task();
-        assert(t->t_func == task1_handler);
-
-#if 0
-        int rc;
-        rc = adc_chan_read(adc, 4, &g_result);
-        assert(rc == 0);
-        g_result_mv = adc_result_mv(adc, 4, g_result);
-#endif
-        int rc;
-        rc = OS_OK;
-
-
-#if MYNEWT_VAL(ADC_1)
-        rc = adc_sample(adc1);
-        assert(rc == OS_OK);
-#endif
-
-#if MYNEWT_VAL(ADC_3)
-        rc = adc_sample(adc3);
-        assert(rc == OS_OK);
-#endif
-        ++g_task1_loops;
-
-#if MYNEWT_VAL(SPI_MASTER)
-        /*
-         * Send a spi buffer using non-blocking callbacks.
-         * Every other transfer should use a NULL rxbuf
-         */
-        last_val = g_spi_tx_buf[31];
-        for (i = 0; i < 32; ++i) {
-            g_spi_tx_buf[i] = (uint8_t)(last_val + i);
-        }
-        hal_gpio_clear(SPI0_CONFIG_CSN_PIN);
-        rc = hal_spi_txrx(0, g_spi_tx_buf, g_spi_rx_buf, 32);
-        assert(!rc);
-#endif
-
-        /* Wait one second */
-        os_time_delay(OS_TICKS_PER_SEC);
-
-        /* Toggle the LED */
-        hal_gpio_toggle(g_led_pin);
-
-#if 0
-        nrf_drv_saadc_sample();
-#endif
-        /* Release semaphore to task 2 */
-        os_sem_release(&g_test_sem);
-    }
-
-#if MYNEWT_VAL(ADC_1)
-    os_dev_close((struct os_dev *) adc1);
-#endif
-
-#if MYNEWT_VAL(ADC_3)
-    os_dev_close((struct os_dev *) adc3);
-#endif
-
-}
-
-void
-task2_handler(void *arg)
-{
-#if MYNEWT_VAL(SPI_SLAVE)
-    int rc;
-#endif
-    struct os_task *t;
-
-    while (1) {
-        /* just for debug; task 2 should be the running task */
-        t = os_sched_get_current_task();
-        assert(t->t_func == task2_handler);
-
-        /* Increment # of times we went through task loop */
-        ++g_task2_loops;
-
-        /* Wait for semaphore from ISR */
-        os_sem_pend(&g_test_sem, OS_TIMEOUT_NEVER);
-
-#if MYNEWT_VAL(SPI_SLAVE)
-        /* transmit back what we just received */
-        memcpy(g_spi_tx_buf, g_spi_rx_buf, 32);
-        rc = hal_spi_txrx(SPI_SLAVE_ID, g_spi_tx_buf, g_spi_rx_buf, 32);
-        assert(rc == 0);
-#endif
-    }
-}
-
-/**
- * init_tasks
- *
- * Called by main.c after os_init(). This function performs initializations
- * that are required before tasks are running.
- *
- * @return int 0 success; error otherwise.
- */
-int
-init_tasks(void)
-{
-    /* Initialize global test semaphore */
-    os_sem_init(&g_test_sem, 0);
-
-    os_task_init(&task1, "task1", task1_handler, NULL,
-            TASK1_PRIO, OS_WAIT_FOREVER, stack1, TASK1_STACK_SIZE);
-
-    os_task_init(&task2, "task2", task2_handler, NULL,
-            TASK2_PRIO, OS_WAIT_FOREVER, stack2, TASK2_STACK_SIZE);
-
-    tasks_initialized = 1;
-    return 0;
-}
-
-/**
- * main
- *
- * The main function for the project. This function initializes the os, calls
- * init_tasks to initialize tasks (and possibly other objects), then starts the
- * OS. We should not return from os start.
- *
- * @return int NOTE: this function should never return!
- */
-int
-main(int argc, char **argv)
-{
-    int rc;
-
-#ifdef ARCH_sim
-    mcu_sim_parse_args(argc, argv);
-#endif
-
-    os_init();
-
-#if 0
-    saadc_test();
-#endif
-    rc = init_tasks();
-    os_start();
-
-    /* os start should never return. If it does, this should be an error */
-    assert(0);
-
-    return rc;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/slinky/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/slinky/pkg.yml b/apps/slinky/pkg.yml
index 6bbbcdb..3d4f7a4 100644
--- a/apps/slinky/pkg.yml
+++ b/apps/slinky/pkg.yml
@@ -25,15 +25,15 @@ pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
 pkg.deps:
-    - libs/console/full
-    - libs/flash_test
+    - sys/console/full
+    - test/flash_test
     - libs/imgmgr
     - libs/newtmgr
-    - libs/os
-    - libs/bootutil
-    - libs/shell
+    - kernel/os
+    - boot/bootutil
+    - sys/shell
     - libs/util
-    - libs/split
+    - boot/split
     - sys/config
     - sys/id
     - sys/log

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/splitty/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/splitty/pkg.yml b/apps/splitty/pkg.yml
index a984e5f..0a8d80b 100644
--- a/apps/splitty/pkg.yml
+++ b/apps/splitty/pkg.yml
@@ -26,14 +26,14 @@ pkg.keywords:
 
 pkg.deps:
     - fs/nffs
-    - libs/console/full
+    - sys/console/full
     - libs/imgmgr
     - libs/newtmgr
-    - libs/os
-    - libs/bootutil
-    - libs/shell
+    - kernel/os
+    - boot/bootutil
+    - sys/shell
     - libs/util
-    - libs/split
+    - boot/split
     - sys/config
     - sys/id
     - sys/log

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/apps/test/pkg.yml
----------------------------------------------------------------------
diff --git a/apps/test/pkg.yml b/apps/test/pkg.yml
index 22bee48..ff3d3fd 100644
--- a/apps/test/pkg.yml
+++ b/apps/test/pkg.yml
@@ -26,11 +26,11 @@ pkg.keywords:
 
 pkg.deps:
     - fs/nffs
-    - libs/bootutil
-    - libs/console/full
+    - boot/bootutil
+    - sys/console/full
     - crypto/mbedtls
-    - libs/os
-    - libs/testreport
-    - libs/testutil
+    - kernel/os
+    - test/testreport
+    - test/testutil
     - libs/util
     - sys/config

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/boot/boot_serial/include/boot_serial/boot_serial.h
----------------------------------------------------------------------
diff --git a/boot/boot_serial/include/boot_serial/boot_serial.h b/boot/boot_serial/include/boot_serial/boot_serial.h
new file mode 100644
index 0000000..67fa415
--- /dev/null
+++ b/boot/boot_serial/include/boot_serial/boot_serial.h
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+#ifndef __BOOT_SERIAL_H__
+#define __BOOT_SERIAL_H__
+
+/*
+ * Create a task for uploading image0 over serial.
+ *
+ * Task opens console serial port and waits for download command.
+ * Return code 0 means new image was uploaded, non-zero means that
+ * there was an error.
+ */
+int boot_serial_task_init(struct os_task *task, uint8_t prio,
+  os_stack_t *stack, uint16_t stack_size, int max_input);
+
+#endif /*  __BOOT_SERIAL_H__ */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/boot/boot_serial/pkg.yml
----------------------------------------------------------------------
diff --git a/boot/boot_serial/pkg.yml b/boot/boot_serial/pkg.yml
new file mode 100644
index 0000000..69773a1
--- /dev/null
+++ b/boot/boot_serial/pkg.yml
@@ -0,0 +1,36 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+#
+
+pkg.name: libs/boot_serial
+pkg.description: The boot_serial library is used when downloading image over serial port.
+pkg.author: "Apache Mynewt <de...@mynewt.incubator.apache.org>"
+pkg.homepage: "http://mynewt.apache.org/"
+pkg.keywords:
+    - boot
+    - bootloader
+
+pkg.deps:
+    - hw/hal
+    - kernel/os
+    - boot/bootutil
+    - encoding/base64
+    - encoding/crc
+
+pkg.req_apis:
+    - console

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/boot/boot_serial/src/boot_serial.c
----------------------------------------------------------------------
diff --git a/boot/boot_serial/src/boot_serial.c b/boot/boot_serial/src/boot_serial.c
new file mode 100644
index 0000000..23c343a
--- /dev/null
+++ b/boot/boot_serial/src/boot_serial.c
@@ -0,0 +1,403 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 <assert.h>
+#include <stddef.h>
+#include <inttypes.h>
+#include <ctype.h>
+#include <stdio.h>
+
+#include <bsp/bsp.h>
+
+#include <hal/flash_map.h>
+#include <hal/hal_flash.h>
+#include <hal/hal_system.h>
+
+#include <os/endian.h>
+#include <os/os.h>
+#include <os/os_malloc.h>
+
+#include <console/console.h>
+
+#include <base64/base64.h>
+#include <crc/crc16.h>
+
+#include <bootutil/image.h>
+
+#include "boot_serial/boot_serial.h"
+#include "boot_serial_priv.h"
+
+#define BOOT_SERIAL_OUT_MAX	48
+
+static uint32_t curr_off;
+static uint32_t img_size;
+static struct nmgr_hdr *bs_hdr;
+
+static void boot_serial_output(char *data, int len);
+
+/*
+ * Looks for 'name' from NULL-terminated json data in buf.
+ * Returns pointer to first character of value for that name.
+ * Returns NULL if 'name' is not found.
+ */
+char *
+bs_find_val(char *buf, char *name)
+{
+    char *ptr;
+
+    ptr = strstr(buf, name);
+    if (!ptr) {
+        return NULL;
+    }
+    ptr += strlen(name);
+
+    while (*ptr != '\0') {
+        if (*ptr != ':' && !isspace(*ptr)) {
+            break;
+        }
+        ++ptr;
+    }
+    if (*ptr == '\0') {
+        ptr = NULL;
+    }
+    return ptr;
+}
+
+/*
+ * List images.
+ */
+static void
+bs_list(char *buf, int len)
+{
+    char *ptr;
+    struct image_header hdr;
+    uint8_t tmpbuf[64];
+    const struct flash_area *fap = NULL;
+    int good_img, need_comma = 0;
+    int rc;
+    int i;
+
+    ptr = os_malloc(BOOT_SERIAL_OUT_MAX);
+    if (!ptr) {
+        return;
+    }
+    len = snprintf(ptr, BOOT_SERIAL_OUT_MAX, "{\"images\":[");
+    for (i = FLASH_AREA_IMAGE_0; i <= FLASH_AREA_IMAGE_1; i++) {
+        rc = flash_area_open(i, &fap);
+        if (rc) {
+            continue;
+        }
+
+        flash_area_read(fap, 0, &hdr, sizeof(hdr));
+
+        if (hdr.ih_magic == IMAGE_MAGIC &&
+          bootutil_img_validate(&hdr, fap->fa_flash_id, fap->fa_off,
+            tmpbuf, sizeof(tmpbuf), NULL, 0, NULL) == 0) {
+            good_img = 1;
+        } else {
+            good_img = 0;
+        }
+        if (good_img) {
+            len += snprintf(ptr + len, BOOT_SERIAL_OUT_MAX - len,
+              "%c\"%u.%u.%u.%u\"", need_comma ? ',' : ' ',
+              hdr.ih_ver.iv_major, hdr.ih_ver.iv_minor, hdr.ih_ver.iv_revision,
+              (unsigned int)hdr.ih_ver.iv_build_num);
+        }
+        flash_area_close(fap);
+    }
+    len += snprintf(ptr + len, BOOT_SERIAL_OUT_MAX - len, "]}");
+    boot_serial_output(ptr, len);
+    os_free(ptr);
+}
+
+/*
+ * Image upload request.
+ */
+static void
+bs_upload(char *buf, int len)
+{
+    char *ptr;
+    char *data_ptr;
+    uint32_t off, data_len = 0;
+    const struct flash_area *fap = NULL;
+    int rc;
+
+    /*
+     * should be json inside
+     */
+    ptr = bs_find_val(buf, "\"off\"");
+    if (!ptr) {
+        rc = NMGR_ERR_EINVAL;
+        goto out;
+    }
+    off = strtoul(ptr, NULL, 10);
+
+    if (off == 0) {
+        ptr = bs_find_val(buf, "\"len\"");
+        if (!ptr) {
+            rc = NMGR_ERR_EINVAL;
+            goto out;
+        }
+        data_len = strtoul(ptr, NULL, 10);
+
+    }
+    data_ptr = bs_find_val(buf, "\"data\"");
+    if (!data_ptr) {
+        rc = NMGR_ERR_EINVAL;
+        goto out;
+    }
+    if (*data_ptr != '"') {
+        rc = NMGR_ERR_EINVAL;
+        goto out;
+    }
+    ++data_ptr;
+    data_ptr = strsep(&data_ptr, "\"");
+    if (!data_ptr) {
+        rc = NMGR_ERR_EINVAL;
+        goto out;
+    }
+
+    len = base64_decode(data_ptr, data_ptr);
+    if (len <= 0) {
+        rc = NMGR_ERR_EINVAL;
+        goto out;
+    }
+
+    rc = flash_area_open(FLASH_AREA_IMAGE_0, &fap);
+    if (rc) {
+        rc = NMGR_ERR_EINVAL;
+        goto out;
+    }
+
+    if (off == 0) {
+        curr_off = 0;
+        if (data_len > fap->fa_size) {
+            rc = NMGR_ERR_EINVAL;
+            goto out;
+        }
+        rc = flash_area_erase(fap, 0, fap->fa_size);
+        if (rc) {
+            rc = NMGR_ERR_EINVAL;
+            goto out;
+        }
+        img_size = data_len;
+    }
+    if (off != curr_off) {
+        rc = 0;
+        goto out;
+    }
+    rc = flash_area_write(fap, curr_off, data_ptr, len);
+    if (rc) {
+        rc = NMGR_ERR_EINVAL;
+        goto out;
+    }
+    curr_off += len;
+
+out:
+    ptr = os_malloc(BOOT_SERIAL_OUT_MAX);
+    if (!ptr) {
+        return;
+    }
+    if (rc == 0) {
+        len = snprintf(ptr, BOOT_SERIAL_OUT_MAX, "{\"rc\":%d,\"off\":%u}",
+          rc, (int)curr_off);
+    } else {
+        len = snprintf(ptr, BOOT_SERIAL_OUT_MAX, "{\"rc\":%d}", rc);
+    }
+    boot_serial_output(ptr, len);
+    os_free(ptr);
+    flash_area_close(fap);
+}
+
+/*
+ * Console echo control. Send empty response, don't do anything.
+ */
+static void
+bs_echo_ctl(char *buf, int len)
+{
+    boot_serial_output(NULL, 0);
+}
+
+/*
+ * Reset, and (presumably) boot to newly uploaded image. Flush console
+ * before restarting.
+ */
+static void
+bs_reset(char *buf, int len)
+{
+    char msg[] = "{\"rc\":0}";
+
+    boot_serial_output(msg, strlen(msg));
+    os_time_delay(250);
+    system_reset();
+}
+
+/*
+ * Parse incoming line of input from console.
+ * Expect newtmgr protocol with serial transport.
+ */
+void
+boot_serial_input(char *buf, int len)
+{
+    int rc;
+    uint16_t crc;
+    uint16_t expected_len;
+    struct nmgr_hdr *hdr;
+
+    if (len < BASE64_ENCODE_SIZE(sizeof(uint16_t) * 2)) {
+        return;
+    }
+    rc = base64_decode(buf, buf);
+    if (rc < 0) {
+        return;
+    }
+    len = rc;
+
+    expected_len = ntohs(*(uint16_t *)buf);
+    buf += sizeof(uint16_t);
+    len -= sizeof(uint16_t);
+
+    len = min(len, expected_len);
+
+    crc = crc16_ccitt(CRC16_INITIAL_CRC, buf, len);
+    if (crc || len <= sizeof(crc)) {
+        return;
+    }
+    len -= sizeof(crc);
+    buf[len] = '\0';
+
+    hdr = (struct nmgr_hdr *)buf;
+    if (len < sizeof(*hdr) ||
+      (hdr->nh_op != NMGR_OP_READ && hdr->nh_op != NMGR_OP_WRITE) ||
+      (ntohs(hdr->nh_len) < len - sizeof(*hdr))) {
+        return;
+    }
+    bs_hdr = hdr;
+    hdr->nh_group = ntohs(hdr->nh_group);
+
+    buf += sizeof(*hdr);
+    len -= sizeof(*hdr);
+
+    /*
+     * Limited support for commands.
+     */
+    if (hdr->nh_group == NMGR_GROUP_ID_IMAGE) {
+        switch (hdr->nh_id) {
+        case IMGMGR_NMGR_OP_LIST:
+            bs_list(buf, len);
+            break;
+        case IMGMGR_NMGR_OP_UPLOAD:
+            bs_upload(buf, len);
+            break;
+        default:
+            break;
+        }
+    } else if (hdr->nh_group == NMGR_GROUP_ID_DEFAULT) {
+        switch (hdr->nh_id) {
+        case NMGR_ID_CONS_ECHO_CTRL:
+            bs_echo_ctl(buf, len);
+            break;
+        case NMGR_ID_RESET:
+            bs_reset(buf, len);
+            break;
+        default:
+            break;
+        }
+    }
+}
+
+static void
+boot_serial_output(char *data, int len)
+{
+    uint16_t crc;
+    uint16_t totlen;
+    char pkt_start[2] = { SHELL_NLIP_PKT_START1, SHELL_NLIP_PKT_START2 };
+    char buf[BOOT_SERIAL_OUT_MAX];
+    char encoded_buf[BASE64_ENCODE_SIZE(BOOT_SERIAL_OUT_MAX)];
+
+    bs_hdr->nh_op++;
+    bs_hdr->nh_len = htons(len);
+    bs_hdr->nh_group = htons(bs_hdr->nh_group);
+
+    crc = crc16_ccitt(CRC16_INITIAL_CRC, bs_hdr, sizeof(*bs_hdr));
+    crc = crc16_ccitt(crc, data, len);
+    crc = htons(crc);
+
+    console_write(pkt_start, sizeof(pkt_start));
+
+    totlen = len + sizeof(*bs_hdr) + sizeof(crc);
+    totlen = htons(totlen);
+
+    memcpy(buf, &totlen, sizeof(totlen));
+    totlen = sizeof(totlen);
+    memcpy(&buf[totlen], bs_hdr, sizeof(*bs_hdr));
+    totlen += sizeof(*bs_hdr);
+    memcpy(&buf[totlen], data, len);
+    totlen += len;
+    memcpy(&buf[totlen], &crc, sizeof(crc));
+    totlen += sizeof(crc);
+    totlen = base64_encode(buf, totlen, encoded_buf, 1);
+    console_write(encoded_buf, totlen);
+    console_write("\n", 1);
+}
+
+/*
+ * Task which waits reading console, expecting to get image over
+ * serial port.
+ */
+static void
+boot_serial(void *arg)
+{
+    int rc;
+    int off;
+    char *buf;
+    int full_line;
+    int max_input = (int)arg;
+
+    rc = console_init(NULL);
+    assert(rc == 0);
+    console_echo(0);
+
+    buf = os_malloc(max_input);
+    assert(buf);
+
+    off = 0;
+    while (1) {
+        rc = console_read(buf + off, max_input - off, &full_line);
+        if (rc <= 0 && !full_line) {
+            continue;
+        }
+        off += rc;
+        if (!full_line) {
+            continue;
+        }
+        if (buf[0] == SHELL_NLIP_PKT_START1 &&
+          buf[1] == SHELL_NLIP_PKT_START2) {
+            boot_serial_input(&buf[2], off - 2);
+        }
+        off = 0;
+    }
+}
+
+int
+boot_serial_task_init(struct os_task *task, uint8_t prio, os_stack_t *stack,
+  uint16_t stack_size, int max_input)
+{
+    return os_task_init(task, "boot", boot_serial, (void *)max_input,
+      prio, OS_WAIT_FOREVER, stack, stack_size);
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6a7432f4/boot/boot_serial/src/boot_serial_priv.h
----------------------------------------------------------------------
diff --git a/boot/boot_serial/src/boot_serial_priv.h b/boot/boot_serial/src/boot_serial_priv.h
new file mode 100644
index 0000000..86ba6c6
--- /dev/null
+++ b/boot/boot_serial/src/boot_serial_priv.h
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+#ifndef __BOOTUTIL_SERIAL_PRIV_H__
+#define __BOOTUTIL_SERIAL_PRIV_H__
+
+/*
+ * From shell.h
+ */
+#define SHELL_NLIP_PKT_START1   6
+#define SHELL_NLIP_PKT_START2   9
+
+/*
+ * From newtmgr.h
+ */
+#define NMGR_ERR_EINVAL         3
+
+#define NMGR_OP_READ            0
+#define NMGR_OP_WRITE           2
+
+#define NMGR_GROUP_ID_DEFAULT   0
+#define NMGR_GROUP_ID_IMAGE     1
+
+#define NMGR_ID_CONS_ECHO_CTRL  1
+#define NMGR_ID_RESET           5
+
+struct nmgr_hdr {
+    uint8_t  nh_op;             /* NMGR_OP_XXX */
+    uint8_t  nh_flags;
+    uint16_t nh_len;            /* length of the payload */
+    uint16_t nh_group;          /* NMGR_GROUP_XXX */
+    uint8_t  nh_seq;            /* sequence number */
+    uint8_t  nh_id;             /* message ID within group */
+};
+
+/*
+ * From imgmgr.h
+ */
+#define IMGMGR_NMGR_OP_LIST             0
+#define IMGMGR_NMGR_OP_UPLOAD           1
+
+
+void boot_serial_input(char *buf, int len);
+
+#endif /*  __BOOTUTIL_SERIAL_PRIV_H__ */