Ignore:
Timestamp:
Jan 21, 2018, 12:10:09 AM (6 years ago)
Author:
coas-nagasima
Message:

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/prototool/src/main.c

    r321 r331  
    4949#include <netdb.h>
    5050#include <unistd.h>
    51 #include <setjmp.h>
    5251#include <signal.h>
    5352#include <time.h>
    5453#include <sys/time.h>
    55 #include <sys/unistd.h>
     54#include <unistd.h>
    5655#include <errno.h>
    5756
     
    6564#include <mruby/dump.h>
    6665#include <mruby/string.h>
    67 #include <usrcmd.h>
     66#include <ntshell/usrcmd.h>
    6867
    6968#define ETHER_MAX_LEN 1518
     
    8988extern int mruby_main(int argc, char **argv);
    9089extern int mirb_main(int argc, char **argv);
     90extern int curl_main(int argc, char **argv);
    9191extern int tcc_main(int argc, char **argv);
    9292extern int vi_main(int argc, char **argv);
     
    101101        {"mruby","mruby command", mruby_main},
    102102        {"mirb", "Embeddable Interactive Ruby Shell", mirb_main},
     103        {"curl", "Command lines or scripts to transfer data", curl_main},
    103104        {"tcc", "Tiny C compiler", tcc_main},
    104105        {"vi", "Text editor", vi_main},
    105         {"cd", "change directory", usrcmd_cd },
    106         {"ls", "list files", usrcmd_ls },
    107         {"cp", "copy file", usrcmd_cp },
    108         {"rm", "remove file", usrcmd_rm },
    109         {"mv", "move file", usrcmd_mv },
    110         {"mkdir", "Make directory", usrcmd_mkdir},
    111         {"hexdump", "Hex dump", usrcmd_hexdump},
    112106        {"onitest", "Onigumo Test", onitest_main},
    113107        {"tcp_echo", "TCP echo server/client", tcp_echo_main},
    114108        {"help", "This is a description text string for help command.", usrcmd_help},
    115         {"info", "This is a description text string for info command.", usrcmd_info},
    116         {"exit", "Exit Natural Tyny Shell", usrcmd_exit},
    117109};
    118110cmd_table_info_t cmd_table_info = { &cmdlist, sizeof(cmdlist) / sizeof(cmdlist[0]) };
     
    521513}
    522514
    523 // Provide implementation of _sbrk (low-level dynamic memory allocation
    524 // routine) for GCC_ARM which compares new heap pointer with MSP instead of
    525 // SP.  This make it compatible with RTX RTOS thread stacks.
    526 
    527 // Linker defined symbol used by _sbrk to indicate where heap should start.
    528 int _end;
    529 uint32_t  _stack;
    530 
    531 // Turn off the errno macro and use actual global variable instead.
    532 #undef errno
    533 int errno;
    534 
    535 static unsigned char* heap = (unsigned char*)&_end;
    536 
    537 // Dynamic memory allocation related syscall.
    538 caddr_t _sbrk(int incr) {
    539         unsigned char*        prev_heap = heap;
    540         unsigned char*        new_heap = heap + incr;
    541 
    542         if (new_heap >= (unsigned char*)&_stack) {     /* _stack is end of heap section */
    543                 errno = ENOMEM;
    544                 return (caddr_t)-1;
    545         }
    546 
    547         heap = new_heap;
    548         return (caddr_t) prev_heap;
    549 }
    550 
    551 char *optarg;
     515void _start_c(long *p);
    552516int _data, _mdata, _edata;
    553517int _bss, _ebss;
    554518
    555 int _PowerON_Reset(int argc, char **argv)
     519void _PowerON_Reset(long *args)
    556520{
    557521        memcpy(&_data, &_mdata, (size_t)&_edata - (size_t)&_data);
    558522        memset(&_bss, 0, (size_t)&_ebss - (size_t)&_bss);
    559523
    560         optarg = *argv;
    561         return main(argc, argv);
     524        _start_c(args);
    562525}
    563526
Note: See TracChangeset for help on using the changeset viewer.