summaryrefslogtreecommitdiffstatshomepage
path: root/unix/main.c
Commit message (Collapse)AuthorAge
* 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.
* unix: Support readline history saving to file, improves interactive usage.Paul Sokolovsky2015-03-13
|
* py: Protect mp_parse and mp_compile with nlr push/pop block.Damien George2015-02-07
| | | | | | | | | | To enable parsing constants more efficiently, mp_parse should be allowed to raise an exception, and mp_compile can already raise a MemoryError. So these functions need to be protected by an nlr push/pop block. This patch adds that feature in all places. This allows to simplify how mp_parse and mp_compile are called: they now raise an exception if they have an error and so explicit checking is not needed anymore.
* py, unix, stmhal: Allow to compile with -Wshadow.Damien George2015-01-20
| | | | See issue #699.
* unix: Add target to build "minimal" uPy interpreter.Damien George2015-01-16
|
* py, unix: Allow to compile with -Wsign-compare.Damien George2015-01-16
| | | | See issue #699.
* py: Can compile with -Wmissing-declarations and -Wmissing-prototypes.Damien George2015-01-12
|
* py: Put all global state together in state structures.Damien George2015-01-07
| | | | | | This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient.
* unix: Prefix includes with py/; remove need for -I../py.Damien George2015-01-01
|
* py: Add include guards to mpconfig,misc,qstr,obj,runtime,parsehelper.Damien George2014-12-29
|
* unix/windows: Make sure that process exit code is portable 8-bit value.Paul Sokolovsky2014-12-19
| | | | This fixes FORCED_EXIT internal flag leaking into Windows exit code.