Arduino Filestore - Code now available to download

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
Post Reply
gazzaD
Posts: 34
Joined: Sun Jun 18, 2017 11:37 am
Contact:

Arduino Filestore - Code now available to download

Post by gazzaD » Sat Mar 31, 2018 4:54 pm

A while ago I mentioned I was working on building an Econet Filestore based around the Arduino Due and an Acorn Econet module. I've now found sufficient round tuits to upload my work so far to GitHub, along with a hardware schematic to build the thing.

In terms of the basic FS functionality most of it is there apart from the file access rights, but some of the undocumented subtleties of how these operations work are missing - so expect odd things to happen.

I have tried to split the code into layers, so in theory the code should be portable to other Econet systems as long as the same interfaces for sending and receiving frames are implemented.
Gareth

User avatar
lcww1
Posts: 280
Joined: Wed Mar 15, 2017 11:16 pm
Location: Moon Base Alpha
Contact:

Re: Arduino Filestore - Code now available to download

Post by lcww1 » Sun Apr 01, 2018 10:17 am

Fantastic! Thanks a lot for sharing your project :D I’ve just ordered an Arduino DUE to test this out - the genuine boards are a bit pricey, though farnell do have them at a competitive price - I’ve also found a combined ethernet/SD card sheild at hobbytronics for a good price that looks as though it will do the job.....really looking forward to having a go ......

User avatar
myelin
Posts: 443
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Arduino Filestore - Code now available to download

Post by myelin » Mon Apr 02, 2018 4:07 am

Thank you! Very excited to try this out :)
SW/EE from New Zealand, now in Mountain View, CA, making BBC/Electron hardware projects for fun.
Most popular: fast serial port, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.

User avatar
jgharston
Posts: 3212
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Arduino Filestore - Code now available to download

Post by jgharston » Mon Apr 02, 2018 11:13 pm

All the
if (usrHdl==-1){
fsError(0xBF,F("Who are you?"),txPort);
return;

can be move up one level to the calling code.

Not essential, but a useful thing for *I AM to do is to ping the client and keep a note of the machine type. You can then use this later for, eg, giving RISC OS clients 32 handles, giving Atom clients UPPER CASE text messages, and setting a default library.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: Arduino Filestore - Code now available to download

Post by crj » Tue Apr 03, 2018 12:47 am

I thought the RISC OS NetFS hacked the choice of library itself?

User avatar
jgharston
Posts: 3212
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Arduino Filestore - Code now available to download

Post by jgharston » Tue Apr 03, 2018 3:01 am

crj wrote:I thought the RISC OS NetFS hacked the choice of library itself?
Yes.
ANFS 4.xx does: if OPT 5,1 set, do *FindLib which can then set a specific library.
ANFS 5.xx does: if Configure ArthurLib set, do: select the drive % is on, if $.ArthurLib exists, set the library to it

I added an option to SoftMDFS so that Atoms and Systems could get their library automatically set to ATOMLIB and SYSLIB. Documentation suggests that this was the functionality of early Level II fileservers.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

gazzaD
Posts: 34
Joined: Sun Jun 18, 2017 11:37 am
Contact:

Re: Arduino Filestore - Code now available to download

Post by gazzaD » Mon Apr 16, 2018 11:40 pm

Actually findlib doesn't work, but *LIb does. I need to take account of the handles passed to the Loadas call, rather than using what the Filestore thinks the library should be. I've only spotted this problem recently as it doesn't show up with RISC OS machines, and their interesting use of libraries by the desktop - which I'm still not convinced I've got right.

BTW, the reason I'm doing a check to see if a user is logged on as part of each function is because a couple of operations (like get server time) don't need to be logged on. I recognise that there is room for code to be refactored here, and would welcome anyone elses contribution to fix the things that don't work.

I want to get the basic file transfer code right, so that when I move on to writing the code to pull FTP and HTTP(S) files though the Ethernet interface to the Econet, I've only got the new code to debug.
Gareth

gazzaD
Posts: 34
Joined: Sun Jun 18, 2017 11:37 am
Contact:

Re: Arduino Filestore - Code now available to download

Post by gazzaD » Mon Apr 16, 2018 11:47 pm

While I'm not exhibiting at Wakefield, I've booked a hotel room for the Friday night. So you will probably find me in the hotel bar on Friday evening if you want to say hello, and discuss the vagaries of Econet and 68B54 programming :)
Gareth

User avatar
jgharston
Posts: 3212
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Arduino Filestore - Code now available to download

Post by jgharston » Tue Apr 17, 2018 12:44 am

gazzaD wrote:BTW, the reason I'm doing a check to see if a user is logged on as part of each function is because a couple of operations (like get server time) don't need to be logged on. I recognise that there is room for code to be refactored here, and would welcome anyone elses contribution to fix the things that don't work.
Yes, you'd normally do something like:

Code: Select all

      IFUsr%=-1THEN
        CASEFunction%OF
          WHEN0 :PROC_FS_Cli
          WHEN14:PROC_FS_Discs
          WHEN15:PROC_FS_Users
          WHEN16:PROC_FS_Date
          WHEN23:PROC_FS_Bye
          WHEN25:PROC_FS_Version
          OTHERWISE
            PROC_Error(&BF,"Who are you?")
        ENDCASE
      ELSE
        IFFunction%<>1ANDFunction%<>2ANDFunction%<>5ANDFunction%<>29:UsrTab_URD%(Usr%)=ECPB%?2
        CASEFunction%OF
            REM Standard functions
          WHEN0 :PROC_FS_Cli
          WHEN1 :PROC_FS_Save
etc.
There's also the issue that some functions (1, 2, 5, 29) pass a port number where the URD would normally be in the parameter block.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
jgharston
Posts: 3212
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Arduino Filestore - Code now available to download

Post by jgharston » Wed Apr 18, 2018 6:55 pm

gazzaD wrote:While I'm not exhibiting at Wakefield, I've booked a hotel room for the Friday night. So you will probably find me in the hotel bar on Friday evening if you want to say hello, and discuss the vagaries of Econet and 68B54 programming :)
I've just booked in for Friday, so I'll be around as well.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

Post Reply