RickCarlino / fbbs2

Forth BBS 2, 1985 Bulletin Board software written in Forth (historic reconstruction)
64 stars 2 forks source link

Target platforms #8

Open larsbrinkhoff opened 2 years ago

larsbrinkhoff commented 2 years ago

Free-form discussion. How will we run this?

larsbrinkhoff commented 2 years ago

I gather the first version (FBBS1?) ran on "MVP Forth". MVP is Mountain View Press, which amazingly is still in business: http://theforthsource.com/ I believe it's a Forth-79 dialect for the ... 8080 or Z80? I don't know whether it was hosted on top of CP/M or bare metal.

In any event, I'm not sure we have or could get the earlier version.

larsbrinkhoff commented 2 years ago

The current version which is what we have here, is for F83. It's (somewhat obviously) a Forth-83 dialect. I believe F83 ran on 8080, 8086, and 68000. Again, unknown so far what operating systems, if any, were involved. Possibly CP/M and/or DOS.

larsbrinkhoff commented 2 years ago

Having covered the historical environments, we look into the future. Would we want this to run on the original Forth, on the original hardware. Real hardware, or emulator?

Or do we want to port it forward to a Forth-94 or 2012? If so, which one? I suggest gforth is a convenient option which is widely available and easy to install.

larsbrinkhoff commented 2 years ago

There are references to "LP F83". What is that, and how is it different from the plain "F83"? Just about the only thing I can find is this code comment from a comp.lang.forth article:

\ WARNING: some signed/unsigned STACK comment may be WRONG!
\ might be unsigned/signed mixed up @ 48bit, who cares?
\ but even LP F83 and plagiarists are wrong w/ un~ <-> signed!
\ MASTER LOAD SCREEN ALL 11:57 31MAR93
larsbrinkhoff commented 2 years ago

Oh, by the way, I understand the implementation uses blocks, so the target Forth will have to support that. Of course, the original F83 would do it, and I think gforth does too.

RickCarlino commented 2 years ago

Free-form discussion. How will we run this?

I think we will need to sandbox it, wherever we decide to run it. Based on the documentation, it seems that it might have some security issues.

The author mentioned that they intentionally do not provide modem control words and leave that work to the end-user. This makes things easier for us. We could run it on something like Websocketd or Inetd or even attach it to an ESP microcontroller.

MVP is Mountain View Press, which amazingly is still in business: http://theforthsource.com/

I tried to find copies of it online to no avail. There is no email on the site for ways to purchase a license (and hints that the site may be an archive). Several sourcecode comments suggest that MVP-Forth was a secondary target and that the real action happened on LP F83 (not sure what LP stands for).

Is it possible that the "P" in LP F83 stands for "Pygmy" ? https://comp.lang.forth.narkive.com/bxyOhrUj/d-mod-definition

Would we want this to run on the original Forth, on the original hardware. Real hardware, or emulator?

Two ideas:

  1. If no original LP F83 binaries can be found: Port it to GForth for max usability by future users
  2. If a pristince LP F83 binary is found: Run it on an emulator (or a 386 in my basement) to speed up the restoration process.

    I suggest gforth is a convenient option which is widely available and easy to install.

I agree.

b0blee commented 2 years ago

I ran F83 on CP/M (Z-80, S-100). I don't remember FBBS, though, which is odd because I was into BBSs at the time. I wrote a terminal program in Forth for the Hayes modem in that S-100, and that program got me my first programming job.

While SCR editors are retro fun, plain text with CR/LF line endings is a lot easier to work with.

larsbrinkhoff commented 2 years ago

I actually work with screen files professionally right now, and I think there's something to be said for that format. Rick already converted the screens to a linear file, so we are on board with the new times. It also makes more sense for modern version control and sharing code on GitHub. Still, one option is to run this on F83 so I suppose the screens may come in handy after all.

Veering a bit off topic, I still have a few Atari ST machines so that MIDI code of yours wouldn't have to stay dead. And Atari TOS is kinda sorta CP/M, so maybe it could even run F83. Coming back full circle.

larsbrinkhoff commented 2 years ago

Rick found this guide by @nealcrook for running F83 under DOSBOX: https://github.com/nealcrook/multicomp6809/wiki/CamelForthRebuild

b0blee commented 2 years ago

The music I did on Atari ST was in Forthmacs, a Forth that used emacs for code editing. It was extended for music with ForMuLa, the Forth Music Language. I'm not interested in reviving the code or using an Atari ST again, but the algorithms are useful. I ported two of the songs to Ruby about 5 years ago, just for fun.

lodger-c64 commented 1 year ago

I tried to find copies of it online to no avail. There is no email on the site for ways to purchase a license (and hints that the site may be an archive). Several sourcecode comments suggest that MVP-Forth was a secondary target and that the real action happened on LP F83 (not sure what LP stands for).

Is it possible that the "P" in LP F83 stands for "Pygmy" ? https://comp.lang.forth.narkive.com/bxyOhrUj/d-mod-definition

Okay, maybe I'm too late for the party here but I just came across this repo and am very interested in contributing or helping out with historical information. Since I am just getting into Forth and this project is way beyond my scope of knowledge, I hope I can at least provide some insights / comments on the original code which I took a look at:

  1. "LP" is 1980s Laxen & Perry Forth 83 for CP/M (Z80/8080), as can be found here: https://github.com/janaite/forth83-80

  2. I recognized parts of the original modem code in the original version of fbbs2 to be Zilog SIO related, and since I have a working SIO/2 based, Z80 machine capable of running CP/M (actually, it's an RC2014 homebrew computer kit on steroids) here, I thought it may compile with some minor changes. Well it didn't since the definitions of some modem specific words like 'CHAT' and 'MEMIT' are missing in the code. I suppose those were stored in some seperate screen file not provided to this project, which is too bad (I'd really like to get my hands on that SIO code ... heh ...)

  3. From what I understand, fbbs2 ran on a CP/M machine with a Zilog SIO serial IO chip using Laxen and Perry Forth 83 1.0.0 for CP/M. Unfortunately, the only F83 version for CP/M I could find these days was 2.x

  4. If you think about re-writing this unique piece of code, I'd recommend to stay true to the Forth 2012 standard and not to use any fancy extensions to the language. I have a My4TH discrete CPU computer here that implements the Forth 2012 Core standard and the idea of someday having a BBS (fbbs2) running on it is very, very tempting. gForth may sound like a good idea but personally, I think this will make the program less portable to less capable platforms (e.g. 8 and 16 bit microcontrollers) where the available Forth implementation (e.g. Camel Forth) may not have such a superset of words.

RickCarlino commented 1 year ago

Hi @lodger-c64, thanks for taking a look at the project! At this point, @larsbrinkhoff and I have mostly stepped away from it. I wanted to run it live eventually, but I think it might be a bit too open-ended to run safely on the public internet. The original author (b0b) was nice enough to share some insights with us and we even got it mostly working on DOSBox but stopped there. If you want to continue working on the project or have any questions, feel free to open a new issue.

larsbrinkhoff commented 1 year ago

Thanks @lodger-c64. The timescale of these retrocomputing projects are in decades, so it's not too late to jump in!

lodger-c64 commented 1 year ago

Gentlemen, thank you for responding to my post. I hope you don't mind if I give you a little background as to why I contacted you and how this project may be useful (to me)?

I'm the guy who's running "RC-BOX BBS" (https://www.telnetbbsguide.com/bbs/rc-box/) and to get this thing up and running, I had to dig deep into Z80 assembler and make myself familiar with the CP/M operating system as well as the development tool chain required to put all the pieces together. I'm currently maintaining the RBBS 4.1 source code for CP/M, which is written in BDS-C. So as you can see, I have a small weakness for such things.

Now, in recent weeks I have become interested in Forth, which I knew by name but never really used as a coder. Reason for this is that I just built a My4TH discrete cpu computer which uses Forth 2012 Core as a programming language. I've also set up my CP/M machine to run both, old VolksForth 3.8 and DX Forth 5.4 to make myself familiar with the concept of the language. Long story short, I've just started to grasp this wonderful language and have already written some smaller code.

Back on topic: so now it may be a little clearer why this project caught my attention - I tried to get the original CP/M version of fbbs2 up and running again as it seems to match the Z80 hardware I have in use here. It even compiles with F83 2.1.0 but bails out on screen 23 since there are some modem related words that are missing a proper definition (MEMIT, CHAT).

As I have written in my first post, I assume these modem specific routines / words to have been included from a separate file. Would make sense, given the way how hardware specific support was provided on CP/M using "overlays". It might be possible for me to reverse-engineer this code, as I know the Zilog SIO chip from my "RC-BOX" project and have even written a very, very simple terminal program in Z80 assembler to learn how to address it. But for that I'd need to know what MEMIT (modem emit?) and CHAT (send a string to the modem?) actually do. Do you think you could comment on these specific words or give a hint on how to learn more about these?

I understand that porting the original code to a modern variant of Forth is a rather complex task. And even if this particular piece of code may not be portable or just too old to be worth the effort, have you ever thought about writing a new, fresh BBS based on Forth? Maybe borrowing ideas from this project, making some new code as portable (back and Forth, pun intended) as possible?

So much for now, once more thank you for replying to my post!

larsbrinkhoff commented 1 year ago

It has been some time since we touched this code. I don't remember exactly now, but I think we concluded that users would have access to most of the Forth internals, not just the BBS. So it's not well suited to expose to the net today.

RickCarlino commented 1 year ago

That sounds like a fun project @lodger-c64, although like @larsbrinkhoff mentions, I would highly discourage anyone from connecting this codebase to the internet. I don't remember exactly what I found when I was in here last, but I remember seeing multiple security issues and concluded that this app is a relic from a time when security was less of a concern.

If I remember correctly, the MEMIT / CHAT words need to be implemented by the host Forth and control the modem. It has been so long since I touched this code, but I do remember the codebase has a few words that are intentionally left undefined so that they can be custom-made for the host.