FreeDOS support
Re: FreeDOS support
dhylands
Since freedos build based on djgpp, and in the last version of https://github.com/pohmelie/micropython-freedos I had reduce env variables count to one. Just DJGPP=/path/to/djgpp-folder. So maybe use this env variable (DJGPP) as condition for branching in makefile?
Since freedos build based on djgpp, and in the last version of https://github.com/pohmelie/micropython-freedos I had reduce env variables count to one. Just DJGPP=/path/to/djgpp-folder. So maybe use this env variable (DJGPP) as condition for branching in makefile?
Re: FreeDOS support
Personally I think using the DJGPP env var seems awkward, and makes it a lot more difficult lt to switch back and forth between unix and freedoms builds.
Re: FreeDOS support
For "virtual", block copy uses standard Python syntax of array slice assignment:pohmelie wrote: How about block copy for "physical" and "virtual"?
Code: Select all
# mem1 & mem2 is bytearray captured e.g. by uctypes.bytearray_at()
mem1[0:10] = mem2[100:110]
It's the same on probably any virtual-memory system. That's why there's no block copy support for that in uPy - a typical usecase for accessing physical memory is doing IOMEM access, and that's usually done single data unit at time anyway. If you really need it, doing your adhoc solution makes sense.pohmelie wrote: Cause djgpp "physical" memory access is expensive.
It's in review state currently: https://github.com/micropython/micropyt ... rdware-APIpohmelie wrote: Also, can't find some common machine module description in /py. Does it have standard/template?
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: FreeDOS support
Agree.dhylands wrote:Personally I think using the DJGPP env var seems awkward, and makes it a lot more difficult lt to switch back and forth between unix and freedoms builds.
Great! I forgot about wikipfalcon wrote:It's in review state currently: https://github.com/micropython/micropyt ... rdware-API
Re: FreeDOS support
I need to disable "MICROPY_STREAMS_NON_BLOCK", it is defined in "mpconfigport.h". How to do that? Cause in "mpconfigport.h" there is no check about it is already defined.
Re: FreeDOS support
So, it's probably fair to assume that FreeDOS port will need its own mpconfigport.h. So, if you still follow "try to host djgpp port within unix/" approach (as recommended), feel free to create mpconfigport_freedos.h file, and then a target to Makefile similar to existing "minimal" or "fast". Again, that's minimal set of changes, and good approach to start with. It may be the case that it will be worth the port is worth it's own subdir, but starting with minimal-changes approach is always good.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: FreeDOS support
Trying to build termios module. And have some issues:
First one is just cast error, cause djgpp termios.h said
this can be solved, by add (unsigned char *)&... to modtermios.c. But should this be done? And how, if so?
Rest of errors are macros based. If I comment
in modtermios.c, then module compiles ok. But I don't understand why "C(B9600)" is not error, but "C(B57600)" is
Code: Select all
CC modtermios.c
modtermios.c: In function 'mod_termios_tcgetattr':
modtermios.c:63:45: error: passing argument 1 of 'mp_obj_new_bytes' from incompatible pointer type [-Werror=incompatible-pointer-types]
cc->items[i] = mp_obj_new_bytes(&term.c_cc[i], 1);
^
In file included from ../py/mpstate.h:34:0,
from ../py/nlr.h:68,
from modtermios.c:32:
../py/obj.h:603:10: note: expected 'const byte * {aka const unsigned char *}' but argument is of type 'cc_t * {aka unsigned int *}'
mp_obj_t mp_obj_new_bytes(const byte* data, mp_uint_t len);
^
In file included from ../py/mpstate.h:34:0,
from ../py/nlr.h:68,
from modtermios.c:32:
modtermios.c: At top level:
modtermios.c:139:7: error: 'B57600' undeclared here (not in a function)
C(B57600),
^
../py/obj.h:84:66: note: in definition of macro 'MP_OBJ_NEW_SMALL_INT'
#define MP_OBJ_NEW_SMALL_INT(small_int) ((mp_obj_t)((((mp_int_t)(small_int)) << 1) | 1))
^
modtermios.c:135:50: note: in expansion of macro 'MP_ROM_INT'
#define C(name) { MP_ROM_QSTR(MP_QSTR_ ## name), MP_ROM_INT(name) }
^
modtermios.c:139:5: note: in expansion of macro 'C'
C(B57600),
^
modtermios.c:140:7: error: 'B115200' undeclared here (not in a function)
C(B115200),
^
../py/obj.h:84:66: note: in definition of macro 'MP_OBJ_NEW_SMALL_INT'
#define MP_OBJ_NEW_SMALL_INT(small_int) ((mp_obj_t)((((mp_int_t)(small_int)) << 1) | 1))
^
modtermios.c:135:50: note: in expansion of macro 'MP_ROM_INT'
#define C(name) { MP_ROM_QSTR(MP_QSTR_ ## name), MP_ROM_INT(name) }
^
modtermios.c:140:5: note: in expansion of macro 'C'
C(B115200),
^
cc1: all warnings being treated as errors
make[1]: *** [build-freedos/modtermios.o] Error 1
make[1]: Leaving directory `/home/broomrider/tmp/micropython/unix'
make: *** [freedos] Error 2
Code: Select all
typedef unsigned cc_t;
typedef unsigned speed_t;
typedef unsigned tcflag_t;
struct termios {
cc_t c_cc[NCCS];
tcflag_t c_cflag;
tcflag_t c_iflag;
tcflag_t c_lflag;
tcflag_t c_oflag;
speed_t c_ispeed;
speed_t c_ospeed;
};
Rest of errors are macros based. If I comment
Code: Select all
// C(B57600),
// C(B115200),
Re: FreeDOS support
Because 35 years ago SystemV/BSD didn't have speeds beyond 38400 or so, and any higher value is "non-standard". Should be fixed in https://github.com/micropython/micropyt ... b7b28a64b9 . (And right, these issues are exactly the kind of changes I'm looking for to support DJGPP - they should be largely small and localized).in modtermios.c, then module compiles ok. But I don't understand why "C(B9600)" is not error, but "C(B57600)" is
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: FreeDOS support
Yep, if we want to build it, apparently it should be done. And it seems that DJGPP tries to be smart and support control chars to be unicode chars . Well, that's still not supported on uPy side (because hardly anybody need that), so just a minimal workaround applied indeed: https://github.com/micropython/micropyt ... dc9136baa2pohmelie wrote: this can be solved, by add (unsigned char *)&... to modtermios.c. But should this be done? And how, if so?
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: FreeDOS support
Yep, you are right (http://www.delorie.com/djgpp/doc/incs/termios.h) 38400 is high bound.pfalcon wrote:Because 35 years ago SystemV/BSD didn't have speeds beyond 38400 or so