summaryrefslogtreecommitdiffstatshomepage
path: root/unix/main.c
Commit message (Collapse)AuthorAge
* unix/main: Implement -m option for packages.Paul Sokolovsky2017-05-09
|
* unix/main: Don't allow to specify too small heap size.Paul Sokolovsky2017-05-06
| | | | | | | | | This will lead to crash like: FATAL: uncaught NLR 80a5420 On x86_32, the minimum heap size is smaller, but not 2 times, so just use value which works for x86_64.
* unix/main: Ignore SIGPIPE signal, instead make EPIPE arrive.Paul Sokolovsky2017-05-01
| | | | | | | | | | | | | Do not raise SIGPIPE, instead return EPIPE. Otherwise, e.g. writing to peer-closed socket will lead to sudden termination of MicroPython process. SIGPIPE is particularly nasty, because unix shell doesn't print anything for it, so the above looks like completely sudden and silent termination for unknown reason. Ignoring SIGPIPE is also what CPython does. Note that this may lead to problems using MicroPython scripts as pipe filters, but again, that's what CPython does. So, scripts which want to follow unix shell pipe semantics (where SIGPIPE means "pipe was requested to terminate, it's not an error"), should catch EPIPE themselves.
* unix, windows: Use core-provided KeyboardInterrupt exception object.Damien George2017-04-11
|
* unix: Convert mp_uint_t to size_t for use of mp_obj_list_get.Damien George2017-03-29
|
* unix/main: Refactor to put lexer constructors all in one place.Damien George2017-03-14
| | | | | The lexer can now raise an exception on construction so it must go within an nlr handler block.
* unix: Remove remaining, obsolete traces of GNU readline support.Damien George2017-03-03
|
* unix/main: Properly handle MICROPYPATH starting with ':'.Paul Sokolovsky2017-02-07
| | | | In other words, where first path component is an empty string.
* unix/main: Allow to print the parse tree in coverage build.Damien George2016-12-22
| | | | | Passing -v -v -v on the command line of the coverage build will now print the parse tree (as well as other things at this verbosity level).
* py: Be more specific with MP_DECLARE_CONST_FUN_OBJ macros.Damien George2016-10-21
| | | | | | | In order to have more fine-grained control over how builtin functions are constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific, with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW. These names now match the MP_DEFINE_CONST_FUN_OBJ macros.
* unix/main: When preparing sys.path, allocate exact strings on uPy heap.Paul Sokolovsky2016-07-09
| | | | | | | Due to the way modern compilers work (allocating space for stack vars once at tha start of function, and deallocating once on exit from), using intermediate stack buffer of big size caused blockage of 4K (PATH_MAX) on stack for the entire duration of MicroPython execution.
* unix/main: Improve help for -X options a bit.Paul Sokolovsky2016-07-08
|
* unix/main: Error out on unknown value of suffix in -X heapsize= option.Paul Sokolovsky2016-07-08
| | | | E.g. -X heapsize=16Kfoo, -X heapsize=1G will lead to error.
* unix: Add basic thread support using pthreads.Damien George2016-06-28
| | | | Has the ability to create new threads.
* unix: implement -i option (inspect - start REPL after script is finished)Pavol Rusnak2016-04-01
|
* py/runtime: mp_stack_ctrl_init() should be called immediately on startup.Paul Sokolovsky2016-01-29
| | | | | | | | | Calling it from mp_init() is too late for some ports (like Unix), and leads to incomplete stack frame being captured, with following GC issues. So, now each port should call mp_stack_ctrl_init() on its own, ASAP after startup, and taking special precautions so it really was called before stack variables get allocated (because if such variable with a pointer is missed, it may lead to over-collecting (typical symptom is segfaulting)).
* unix/main: Remove debug code left from MP_OBJ_TO_PTR refactor.Paul Sokolovsky2016-01-29
|
* unix: Allow to build coverage build with OBJ_REPR_D.Damien George2016-01-11
|
* extmod/moduos_dupterm: Make mp_uos_dupterm_tx_strn() function reusable.Paul Sokolovsky2016-01-01
| | | | Function to actually spool output terminal data to dupterm object.
* unix: Implement uos.dupterm(). Conditional on MICROPY_PY_OS_DUPTERM.Paul Sokolovsky2015-12-28
|
* unix: Properly cancel REPL input when Ctrl-C is pressed.Damien George2015-12-22
|
* windows: Make keyboard_interrupt_obj available, it's standard feature.Paul Sokolovsky2015-12-18
|
* unix/main: mp_verbose_flag available only if MICROPY_DEBUG_PRINTERS is true.Paul Sokolovsky2015-12-07
| | | | Not available for minimal build for example.
* unix/main: Check pending exception at the end of code block execution.Paul Sokolovsky2015-12-04
| | | | | | Usually this checking is done by VM on jump instructions, but for linear sequences of instructions and builtin functions this won't happen. Particular target of this change is long-running builtin functions like time.sleep().
* py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR.Damien George2015-11-29
| | | | | | | | | This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
* unix/main: Get rid of perror() which uses stdio.Paul Sokolovsky2015-11-23
|
* unix: Use printf() implementation in terms of mp_printf().Paul Sokolovsky2015-11-22
| | | | | | In other words, unix port now uses overriden printf(), instead of using libc's. This should remove almost all dependency on libc stdio (which is bloated).
* py/emitglue: Host definition of mp_verbose_flag.Paul Sokolovsky2015-11-21
| | | | | This may not seem like the ideal place, but is actually the only place in py/ where it gets referenced, so is just right.
* unix/main: Remove stray mp_printf() from previous commit.Paul Sokolovsky2015-11-13
|
* main.c: Switch stderr printing from ANSI C to native POSIX.Paul Sokolovsky2015-11-13
|
* unix/main: Use builtin unichar_isdigit() in preference if libc's.Paul Sokolovsky2015-11-13
| | | | Less dependencies.
* all: Add py/mphal.h and use it in all ports.Damien George2015-10-31
| | | | | | py/mphal.h contains declarations for generic mp_hal_XXX functions, such as stdio and delay/ticks, which ports should provide definitions for. A port will also provide mphalport.h with further HAL declarations.
* unix: Use "Ctrl" as a name of the key, not "CTRL".Paul Sokolovsky2015-10-20
|
* unix: Add exit and paste-mode hints to shell startup banner.Damien George2015-10-12
| | | | Thanks to @nyov for the initial patch.
* Rename "Micro Python" to "MicroPython" in REPL, help, readme's and misc.Damien George2015-10-12
|
* repl: Add paste mode to friendly REPL, entered via CTRL-E.Damien George2015-10-11
| | | | | | | | Use CTRL-E to enter paste mode. Prompt starts with "===" and accepts all characters verbatim, echoing them back. Only control characters are CTRL-C which cancels the input and returns to normal REPL, and CTRL-D which ends the input and executes it. The input is executed as though it were a file. The input is not added to the prompt history.
* py: Allocate parse nodes in chunks to reduce fragmentation and RAM use.Damien George2015-10-02
| | | | | | | | With this patch parse nodes are allocated sequentially in chunks. This reduces fragmentation of the heap and prevents waste at the end of individually allocated parse nodes. Saves roughly 20% of RAM during parse stage.
* unix: Use MICROPY_HAL_H macro for header inclusion.Alex March2015-09-19
| | | | | Follow the same format as other ports using the macro to include the HAL header.
* unix: Enable REPL auto-indent.Damien George2015-09-12
|
* unix: Bump default heap size to 1MB (2MB on 64-bit systems).Paul Sokolovsky2015-08-22
|
* unix: Allow to cat a script into stdin from the command line.Damien George2015-06-04
| | | | See issue #1306.
* unix: Allow to override default sys.path value.Paul Sokolovsky2015-05-30
| | | | | | | Using MICROPY_PY_SYS_PATH_DEFAULT macro define. A usecase is building a distribution package, which should not have user home path by default in sys.path. In such case, MICROPY_PY_SYS_PATH_DEFAULT can be defined on make command-line (using CFLAGS_EXTRA).
* unix: Add option to use uPy readline, and enable by default.Damien George2015-05-27
| | | | | | This gets uPy readline working with unix port, with tab completion and history. GNU readline is still supported, configure using MICROPY_USE_READLINE variable.
* unix: Factor out stdio and ctrl-C code to unix_mphal.c file.Damien George2015-05-27
|
* unix: Print unhandled exception to stderr, like CPython does.Paul Sokolovsky2015-05-10
|
* unix: Make extra-coverage function callable from Python scripts.Damien George2015-05-08
| | | | | This allows the output of the extra-coverage tests to be checked using the normal run-tests script.
* unix: Add special function to improve coverage.Damien George2015-05-08
| | | | | | The function and corresponding command-line option are only enabled for the coverage build. They are used to exercise uPy features that can't be properly tested by Python scripts.
* py: Replace py-version.sh with makeversionhdr.py, written in Python.Damien George2015-04-28
| | | | Also rename py-version.h to mpversion.h for consistency with mpconfig.h.
* py: Overhaul and simplify printf/pfenv mechanism.Damien George2015-04-16
| | | | | | | | | | | | | | | | | | | | | | Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
* unix: Bump stack limit and adjust for 64-bitness.Paul Sokolovsky2015-03-21
| | | | Without that, "import http.client" failed due to max recursion.