Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 21:28 19 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MMB4L: MMBasic for Linux alpha release

     Page 5 of 11    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 09:37am 29 Sep 2021
Copy link to clipboard 
Print this post

  Volhout said  My personal preference would be that MMB4L supports serial port (USB serial port) ...


Yes, that's my baseline too.

The high-level requirements for the MMB4L that I'm writing for my own use are:

- runs in a terminal window on a modern x86_64 linux box so I have full access to modern development tools.
- has language compatibility with MMBasic 5.07 (CMM2 and Picomite) - initially excluding graphics, sound, GPIO.
- has a more advanced pre-processor than the CMM2; based upon work I've done in basic for SPTools. Will also be able to spit out the pre-processed files so they can be transferred to the Picomite.
- has sufficient serial comms (and inbuilt software) to seamlessly transmit and receive programs and data from a tethered 'mite over a USB cable without leaving the MMB4L environment.
- ultimately has the ability to spin off a separate high-resolution graphics window to "emulate" the LCD/LED display capabilities of the Picomite (and a subset of those of the CMM2).

Basically it's a development and "emulation" environment for MMBasic programs I might then want to deploy on the CMM2 or Picomite and also provides the capability to use MMBasic for scripting on Linux.

The MMB4L that some other people want is a homage to the PiCRomite and I will try and facilitate @lizby in producing that ... if that doesn't work out then people will have to wait until my interest drifts that way.

Both these MMB4L's would be built from the same code-base, it's just that the general Linux version would disable the Pi/GPIO functionality.

  Volhout said  Other interfaces (ethernet, wifi, bluetooth) require drivers and protocols ...


I won't be implementing any of that in MMB4L but with the availability of the SYSTEM() command and perhaps in the future some equivalent of CSUBs that might become a possibility fo those with interest and ability.

  TassyJim said  Back before Peter's RPI basic had serial port support, I experimented with treating the serial as a file ... Not sure if the same code works on Tom's code. I am not in a position to play with Linux at the moment.


I was curious about that myself but am being pulled in so many different directions at the moment (not just by this project) that I haven't had a change to test it - perhaps someone else could ? I guess there must be some external way of setting up the serial parameters on a Linux device ? If it worked on the PiCRomite then there is a good chance it may "just work" (TM) with MMB4L.

Best wishes,

Tom
Edited 2021-09-29 19:45 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3590
Posted: 10:45am 29 Sep 2021
Copy link to clipboard 
Print this post

I have a few test setups running expect scripting in bash on linux that make use of Putty to manage the serial ports. Expect handles the Telnet trafic to an IP device. I open Putty in a separate window and make it open the serial port (i.e. /dev/ttyUSB0) and handle all the real time stuff. And then in the script I simply send data and commands to the serial port with the echo and cat commands.

Maybe things could be done much simpler, but this worked for me.
PicomiteVGA PETSCII ROBOTS
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3678
Posted: 11:07am 29 Sep 2021
Copy link to clipboard 
Print this post

  thwill said  
  TassyJim said  Back before Peter's RPI basic had serial port support, I experimented with treating the serial as a file ... Not sure if the same code works on Tom's code. I am not in a position to play with Linux at the moment.


I was curious about that myself but am being pulled in so many different directions at the moment (not just by this project) that I haven't had a change to test it - perhaps someone else could ? I guess there must be some external way of setting up the serial parameters on a Linux device ? If it worked on the PiCRomite then there is a good chance it may "just work" (TM) with MMB4L.

Best wishes,

Tom
Will probably just work or need trivial effort to make it work, depending whether detailed control of "modem" lines is wanted.

John
Edited 2021-09-29 21:09 by JohnS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 12:18pm 29 Sep 2021
Copy link to clipboard 
Print this post

Ha,

Just got the PicROmite manual from @lizby (I wasn't aware there was such a thing) and I see I have been re-inventing the wheel with respect to the CONSOLE commands I included in MMB4L ... someone could have pointed this out, it was a missed opportunity for derision . I suppose if nobody mentioned it then nobody is that bothered that I've chosen to plough my own furrow ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5771
Posted: 12:40pm 29 Sep 2021
Copy link to clipboard 
Print this post

Maybe nobody apart from lizby ever got one to work?  ;)
I never saw one either, so you're not alone.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3590
Posted: 01:13pm 29 Sep 2021
Copy link to clipboard 
Print this post

Sorry Tom,

Picromite on Debian Stretch apparently was a stable platform, but I became involved with Debian Buster release of MMBasic, and for me that version never worked stable on my Pi Zero. I have suspected PIGPIO to be the culprit, but have no proof. So I have, apart from some hair tearing evenings, never been able to do real projects with it.

And I never saw a MMBasic manual, maybe that would have helped at that time.
In the mean time some hair has grown back (in other places ? uh uh..), so I may be more resilient against disasters now...

Volhout
I
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3590
Posted: 06:54pm 29 Sep 2021
Copy link to clipboard 
Print this post

Hi Tom,

Finally had time to look at your 32 bit x86 build.
I followed the instructions on github, and since I am running an older system (nano 2.5.3) I used the description that you provided.

1/ mmb4l starts
2/ the editor opens, but not all bindings are accepted, maybe this is the nano version ?

Linux i686 MMBasic Ver 2021.01.00-a1
Copyright 2011-2021 Geoff Graham
Copyright 2021 Thomas Hugo Williams
> edit "fun"

Error in /home/harm/.nanorc on line 29: Cannot map name "copy" to a function

Error in /home/harm/.nanorc on line 30: Cannot map name "zap" to a function

Error in /home/harm/.nanorc on line 31: Cannot map name "paste" to a function

Error in /home/harm/.nanorc on line 42: Cannot map name "constantshow" to a function

Error in /home/harm/.nano/mmbasic.syntax.nanorc on line 6: Command "comment" not understood

Press Enter to continue starting nano.


I'll play with it a little more...

Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 07:05pm 29 Sep 2021
Copy link to clipboard 
Print this post

  Volhout said  2/ the editor opens, but not all bindings are accepted, maybe this is the nano version ?


Hi Volhout, that does look like the issue.

Try the following replacements:

   "copy" -> "copytext"
   "zap" -- remove this or replace with "cut"
   "paste" -> "uncut"
   "constantshow" -- remove

And remove line 6 of the syntax file ... I suspect there may be other issues with the syntax file.

You could also build/download a newer nano and put it in your PATH.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3590
Posted: 07:39pm 29 Sep 2021
Copy link to clipboard 
Print this post

Yes, that solved the syntax highlighting. Copy and paste (^C and ^V) work now.

However saw 1 thing that intrigued.
Syntax highlighting is not perfect when line numbers are used...



When the line number is removed, highlighting works. See the top 2 lines of this basic listing. Also the second command on the line is not highlighted.

Maybe do not spend to much time on it. Nobody uses line numbers anymore...

Volhout
Edited 2021-09-30 05:41 by Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 09:07pm 29 Sep 2021
Copy link to clipboard 
Print this post

Hi Volhout,

Thanks for the bug report about the syntax highlighting, that can definitely be much better. Nano has a powerful syntax highlighting engine based on regex matching, but the resource/syntax file I cobbled together for alpha 1 is a real dog's breakfast. It looks like some keywords are set to be only highlighted if they are the first non whitespace tokens on the line.

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Rado
Regular Member

Joined: 27/11/2020
Location: Croatia
Posts: 59
Posted: 08:38pm 02 Oct 2021
Copy link to clipboard 
Print this post

Finally found the time to install and run on my Mint. Found a bug in mandelbrot demo on oversized terminals (mine is 309x81):


 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 09:34am 04 Oct 2021
Copy link to clipboard 
Print this post

  Rado said  Finally found the time to install and run on my Mint. Found a bug in mandelbrot demo on oversized terminals (mine is 309x81):


Thanks for the bug report, for the second alpha I will increase the maximum supported in MMB4L from 255 => 1024 and update the example accordingly.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 02:23pm 08 Oct 2021
Copy link to clipboard 
Print this post

Hi folks,

I am adding the ability to start MMB4L like so:
./mmbasic myprogram.bas --foo --bar \"wom bat\"


Which will cause MMB4L to startup and immediately do:
RUN "myprogram.bas", --foo --bar "wom bat"

But I have some design decisions I'd like opinions on:

1. Should the default behaviour be for MMB4L to immediately exit when the program in question ends ?
 - does your answer change if the program reports an MMBasic ERROR ?
 - what about if the user interrupts with Ctrl-C ?

2. Should the default behaviour be for MMB4L to clear the screen and show the MMB4L copyright banner when run like this; that would be the usual behaviour when started for interactive use ?

Best wishes,

Tom
Edited 2021-10-09 01:36 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5771
Posted: 03:20pm 08 Oct 2021
Copy link to clipboard 
Print this post

IMHO...

1.
How about a --i flag for an interactive mode? Then it would restart the editor when the program ended or cas halted with Ctrl-C. Without the flag it would terminate under those conditions.

2.
With the above --i flag it displays the banner, being in interactive mode. Without it it just runs the prog with any listed arguments.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 08:45pm 08 Oct 2021
Copy link to clipboard 
Print this post

End your BAS program with "SYSTEM EXIT" (or similar) and you exit MMB4L, otherwise stay in MMB4L.
With an error MMB4L should remain.

Jim
Edited 2021-10-09 06:49 by TassyJim
VK7JH
MMedit   MMBasic Help
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5771
Posted: 08:49pm 08 Oct 2021
Copy link to clipboard 
Print this post

That sounds good, Jim. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 08:55pm 08 Oct 2021
Copy link to clipboard 
Print this post

maybe "END SYSTEM" to end and return to system rather than MMB is a better suggestion.

Jim
VK7JH
MMedit   MMBasic Help
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3865
Posted: 07:59am 09 Oct 2021
Copy link to clipboard 
Print this post

Thanks for the input.

MMB4L inherits the QUIT command from MMBasic for DOS which can already be used within a program (though I probably wouldn't) so no need to invent a new concept there.

I think Mick's suggestion is the way forward, I was thinking along similar lines but was overcomplicating it so thanks to Mick for straightening me out there.

When not running "interactively" I have realised that an ERROR needs to exit to the Linux prompt otherwise if running headlessly MMB4L will be sitting at a prompt waiting for input that can never come.

The discussion also made me realise that MMB4L will require a mechanism to return an exit code to Linux. So I propose to add optional integer arguments to END, ERROR (a user value for Mm.ErrNo) and QUIT.

It also made me wonder how MMB4L will cope with redirected < input and > output (something to test later) and whether it will need an explicit mechanism to print to STDERR ... though maybe the developer might be expected to open and print to the corresponding "device/file".

Best wishes,

Tom
Edited 2021-10-09 18:10 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5771
Posted: 09:28am 09 Oct 2021
Copy link to clipboard 
Print this post

Hadn't even considered it running headlessly. Good point.

I like the error arguments. Very useful!
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3027
Posted: 12:05pm 09 Oct 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  Hadn't even considered it running headlessly. Good point.

I like the error arguments. Very useful!

True and true. I always ran picromite headless, and am running MMB4L headless on a PiZW.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
     Page 5 of 11    
Print this page
© JAQ Software 2024