Native Gopher browser in BASIC for Model B/Zimodem - proof of concept

comms devices, modems, serial links, terminal software, BBS's, memories from the past, Prestel/Micronet etc
Post Reply
SevernWolf
Posts: 19
Joined: Sat Feb 17, 2024 8:06 am
Contact:

Native Gopher browser in BASIC for Model B/Zimodem - proof of concept

Post by SevernWolf »

I've recently started using a Beeb again for the first time in 30 years, and as an exercise I thought it would be fun to write a Gopher client, initially in BASIC as a proof of concept. It currently requires a wifi modem running a recent version of the Zimodem https://github.com/bozimmerman/Zimodem firmware, so it won't work on an emulator. For details on how to make your own modem, see https://www.northdevonretroarchive.co.u ... -via-wifi/. Parts cost around £10-£15.

For anyone that isn't familiar with Gopher, it's a text-only way of navigating the internet that appeared in the early 90s alongside the world-wide-web. Initially Gopher was more popular because most people only had access to the internet via text terminals, but as computers' multimedia capabilities grew, the web started to grow exponentially, leaving Gopher in its wake.

I'm sharing this experimental browser mainly to see if anyone has any thoughts on where I should take it next.

It works, but it's very slow and many pages are truncated due to a lack of memory.

I think the speed can be increased by changing the baud rate to 9600 and rewriting the page load routine in assembler. The parsing of pages could also be done much faster in assembler as it's a relatively simple format.

The bigger problem is the lack of memory. I think I need 16k of available memory to store pages, and ideally 32k.

One option is to download pages to disc and load them into memory as required. This would allow me to keep a history, too, so the back button would work more quickly without having to reload over the network.

Another option is to use sideways RAM. This would be more tricky as the program is written in BASIC, but I see Chris who is a regular on these forums has written a guide: http://www.boobip.com/information-index ... -ram-basic

What are people's thoughts?

If anyone would like to give it a try, you're very welcome. I've attached a disc image with two files on it:
SOURCE: Original BASIC program. Not well commented as I was running out of memory. Probably won't actually run as-is due to memory constraints.
GOPHER: The same BASIC program compressed using Tookit+ *CRUNCH commend to save memory. This is the one to run.

You can adjust the size of the buffer used to store pages by altering H%=4000 in the first line (BUFMAX%=4000 on line 60 in the SOURCE file)

Keys:
L - load link (then enter the appropriate line number on the left of the screen)
A - page up
Z - page down
B - back (reloads page from the network)

Caveats:
- Tested with Zimodem running v4 .0.1 firmware. May not work in earlier versions due to bugs in packet handling.
- Pages longer than 4000 bytes are truncated, and not nicely. The end can get corrupted.
- Pages load at 1200 baud, so large ones can take ages.
- The progress bar stops when the buffer is full, but the rest of the page will continue to download at 1200 baud and get silently dumped. This can take ages.
- Parsing can take an extra 30 seconds before a page can be displayed.
- Only Gophermap, text and search pages can be displayed.
- Selecting a invalid link number will cause undefined behaviour
- I haven't done much error handling, either.

As it stands, the best way to use Gopher is probably to telnet into a Linux machine and run a Gopher client, but I love the idea of a native(ish) client on the BBC rather than just using it as a terminal.

All feedback welcome!
Attachments
Gopher_000.ssd
(200 KiB) Downloaded 4 times
Electron, Model B Issue 7, Master 128
nicolagiacobbe
Posts: 215
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: Native Gopher browser in BASIC for Model B/Zimodem - proof of concept

Post by nicolagiacobbe »

Well, the idea is great (and tempting) but for what I could remember the gopher pages I accessed at the university where 80 cols for several screens high, the MODE 0 beeb only gives 5K or so for both code and data hence sideway ram is a must and I would not feel too bad as it is the actual standard.
P.S. doing it in BASIC is awesome but will always be slow, even 1200 baud mean more than one hundred chars every second. Maybe a few M/C routines for parsing and saving/recovering data from sideway ram could give the boost.
SevernWolf
Posts: 19
Joined: Sat Feb 17, 2024 8:06 am
Contact:

Re: Native Gopher browser in BASIC for Model B/Zimodem - proof of concept

Post by SevernWolf »

nicolagiacobbe wrote: Thu Apr 11, 2024 8:23 pm Well, the idea is great (and tempting) but for what I could remember the gopher pages I accessed at the university where 80 cols for several screens high, the MODE 0 beeb only gives 5K or so for both code and data hence sideway ram is a must and I would not feel too bad as it is the actual standard.
P.S. doing it in BASIC is awesome but will always be slow, even 1200 baud mean more than one hundred chars every second. Maybe a few M/C routines for parsing and saving/recovering data from sideway ram could give the boost.
Thanks for the reply. I'm using MODE 3, but that still leaves me horribly short of memory.

BASIC can keep up with 1200 baud, but it does make for very slow loading of larger pages, which can be up to 32K. I plan to replace the load and parsing routines with m/c initially so I can bump the speed up to 9600 baud. The rest of the code works fine in BASIC, but I'll need to give it some thought if I want to use sideways RAM. I haven't written any assembler for 30 years. so I wanted to ease myself back in gently!
Electron, Model B Issue 7, Master 128
brianmartin_2001
Posts: 419
Joined: Mon Jun 14, 2021 7:39 pm
Contact:

Re: Native Gopher browser in BASIC for Model B/Zimodem - proof of concept

Post by brianmartin_2001 »

I ve been wanting to find an efficient way of Gopher browsing since I saw this vid here a few years ago.

https://youtu.be/O5aK8YtY7FY?si=utmxEudbpexzkSiT

This is somewhat the way you described using a Linux client. I tried this with a Pi4 but not that successful. Didn't look that hard for a gopher client though.

I will give this a try on my Beeb . I have a wimodem 232 so not
certain it will work but will be neat if it does.

Well done tackling this. Hope you can improve it to where you want it to be.

Brian
Sysop of (the Night Owl BBS) nightowlbbs.ddns.net:6400
SevernWolf
Posts: 19
Joined: Sat Feb 17, 2024 8:06 am
Contact:

Re: Native Gopher browser in BASIC for Model B/Zimodem - proof of concept

Post by SevernWolf »

Hi Brian,

Good to see other people also interested in Gopher.

As it stands, I don't think the software will work on anything other than a zimodem device. It (zimodem) uses a slightly quirky packet-based protocol for downloading files. This is useful if you're using BASIC as you don't have to worry about the speed. However, when I change the loader to machine code, I could probably accommodate a more generic approach and just grab the entire page from the RS432 input buffer as it downloads.
Last edited by SevernWolf on Fri Apr 12, 2024 11:15 pm, edited 1 time in total.
Electron, Model B Issue 7, Master 128
SevernWolf
Posts: 19
Joined: Sat Feb 17, 2024 8:06 am
Contact:

Re: Native Gopher browser in BASIC for Model B/Zimodem - proof of concept

Post by SevernWolf »

P.S. Just seen your signature. I'm enjoying the Night Owl! Well done for managing to get it all set up. I love the fact that I'm connecting my BBC to another BBC over the internet in 2024. I was an early user of the net (JANET, and then the internet or ARPAnet is it was often called then) back in 1992 when I went to university, but was never allowed to have a modem at home for my BBC Master. The Night Owl takes me back to the BBSs I used to connect to at other universities in those early days.
Electron, Model B Issue 7, Master 128
brianmartin_2001
Posts: 419
Joined: Mon Jun 14, 2021 7:39 pm
Contact:

Re: Native Gopher browser in BASIC for Model B/Zimodem - proof of concept

Post by brianmartin_2001 »

Ah I see you were on just there. Great to have a new caller.
Thanks for visiting. If you intend to return drop me a message
(all new callers can do that) and ask for Mail Board access and I
will set it up for you. If I am actually online I can do it there and then.

Sorry I missed you tonight, I was out just there , had to see a man about a kebab.

cheers
Brian
Sysop of (the Night Owl BBS) nightowlbbs.ddns.net:6400
Post Reply

Return to “communications”