FreeDOS support

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
josie87
Posts: 24
Joined: Tue Jun 30, 2015 2:46 pm

FreeDOS support

Post by josie87 » Tue Jun 30, 2015 2:59 pm

Hi,

while waiting impatiently for my pyboard, I build micropython for unix and played a bit with it. I'm impressed by it's loading speed. You did a great job. I'm looking forward to test the pyboard on my project. :-)

We use a DOS environment at work (for some things we need to). To get the things done, we are doing, I implemented a big program in pure python (pythond 2.4.2). Since I use the same codebase to run the program on windows, I'm still bound to Python2.

If there would be a FreeDOS port of micropython I could make the jump to Python3 (using normal python+qt on windows).

Dos is still used in some special areas, such as system maintenance/diagnose. It boots in under 5s. Writing batch scripts in this area is no fun and very limited... The power of python puts the fun back into DOS ;-)

Is there a chance to get a FreeDos (DJGPP) build of micropython?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: FreeDOS support

Post by dhylands » Tue Jun 30, 2015 3:19 pm

I'm not aware of anybody working on such a port, but it should be possible.

In the open source world, I believe that the expression goes "patches welcome".

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: FreeDOS support

Post by pfalcon » Tue Jun 30, 2015 7:22 pm

Yes, as long as you talk about DJGPP and 32-bit DOS extender support, it should be possible. But effort indeed should be driven by folks who need it. I'd rather work on arm64 port instead for example ;-).
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/

josie87
Posts: 24
Joined: Tue Jun 30, 2015 2:46 pm

Re: FreeDOS support

Post by josie87 » Wed Jul 01, 2015 3:33 am

I will set up a build environment and report back.

josie87
Posts: 24
Joined: Tue Jun 30, 2015 2:46 pm

Re: FreeDOS support

Post by josie87 » Sun Jul 05, 2015 10:33 am

Can't get it to compile. Don't have much of a clue about compiling... Is there a good cross compiler apart from djgpp?

could someone with better knowledge assist me?

pohmelie
Posts: 55
Joined: Mon Nov 23, 2015 6:31 pm

FreeDOS port

Post by pohmelie » Mon Nov 23, 2015 6:41 pm

Hi everyone! I want to make some port for FreeDOS, since we use it in some embedded things. As I expect, I need to redefine couple of hal functions, but can't find list or something with them on wiki. Also, can't get where is micropython core. Is it "py" directory? Maybe there is some "information about porting" so I will just get off for reading?
Thanks for great project! ;)

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: FreeDOS port

Post by dhylands » Mon Nov 23, 2015 9:07 pm

No there isn't any documentation on porting.

The core of micropyton is in the py directory. You should probably look at something like the minimal port as a starting place.

The HAL generally changes from port to port. The common stuff that we do use can be found in py/mphal.h which mostly relates to stdin/stdout and some timing routines.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: FreeDOS support

Post by pfalcon » Mon Nov 23, 2015 9:15 pm

Unix minimal port as a starting place. And better to search forum first (merged into older topic).
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/

pohmelie
Posts: 55
Joined: Mon Nov 23, 2015 6:31 pm

Re: FreeDOS support

Post by pohmelie » Tue Nov 24, 2015 7:10 pm

It looks like there is no cheap way to build micropython for dos. I tried out OpenWatcom, cause I have success with building Lua 5.3.1 for FreeDos with it. But OpenWatcom does not work with make files and some gcc-specific syntax (like __attribute__). After I tried DJGPP, which was built via https://github.com/andrewwutw/build-djgpp. But make breaks on assembly nlrx86.S with syntax(?) errors:

Code: Select all

CC ../py/nlrx86.S
../py/nlrx86.S: Assembler messages:
../py/nlrx86.S:57: Warning: .type pseudo-op used outside of .def/.endef ignored.
../py/nlrx86.S:57: Error: junk at end of line, first unrecognized character is `n'
../py/nlrx86.S:74: Warning: .size pseudo-op used outside of .def/.endef ignored.
../py/nlrx86.S:74: Error: junk at end of line, first unrecognized character is `n'
../py/nlrx86.S:86: Warning: .type pseudo-op used outside of .def/.endef ignored.
../py/nlrx86.S:86: Error: junk at end of line, first unrecognized character is `n'
../py/nlrx86.S:94: Warning: .size pseudo-op used outside of .def/.endef ignored.
../py/nlrx86.S:94: Error: junk at end of line, first unrecognized character is `n'
../py/nlrx86.S:106: Warning: .type pseudo-op used outside of .def/.endef ignored.
../py/nlrx86.S:106: Error: junk at end of line, first unrecognized character is `n'
../py/nlrx86.S:131: Warning: .size pseudo-op used outside of .def/.endef ignored.
../py/nlrx86.S:131: Error: junk at end of line, first unrecognized character is `n'
I have no experience with Gas (and almost nothing with intel asm) and don't get what is going on here :?
Is there way to exclude/replace assemly files? Or is there simple solution for this?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: FreeDOS support

Post by dhylands » Tue Nov 24, 2015 10:12 pm

You could try using the generic setjmp/longjmp handler by setting:

Code: Select all

#define MICROPY_NLR_SETJMP (1)
in your mpconfigport.h file.

Then it won't use the assembler file version.

Post Reply