Integrate with the host platforms filesystem (Linux)

You need an actual VIC.

Moderator: Moderators

Post Reply
wimoos
Vic 20 Afficionado
Posts: 348
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Integrate with the host platforms filesystem (Linux)

Post by wimoos »

All,

Has anyone ever tried to integrate VIC with the host platform through the filesystem ? That is, in linux do:

Code: Select all

ln -s /dev/urandom rnd
xvic
and then in VICE

Code: Select all

10 OPEN1,8,0,"RND"
20 GET#1,A$:IFA$=""THENA$=CHR$(0)
30 PRINTASC(A$)
40 IFST=0THEN20
50 CLOSE1
This works. Also the /proc area might be useful.

Unfortunately, I can't get opening a named pipe to work. It makes VICE hang, so that is doesn't respond anymore. Anybody a clue ?

Regards,

Wim.
VICE; selfwritten 65asmgen; tasm; maintainer of WimBasic
User avatar
srowe
Vic 20 Scientist
Posts: 1340
Joined: Mon Jun 16, 2014 3:19 pm

Re: Integrate with the host platforms filesystem (Linux)

Post by srowe »

It probably is opening the file in blocking mode, what does strace tell you?
wimoos
Vic 20 Afficionado
Posts: 348
Joined: Tue Apr 14, 2009 8:15 am
Website: http://wimbasic.webs.com
Location: Netherlands
Occupation: farmer

Re: Integrate with the host platforms filesystem (Linux)

Post by wimoos »

Hello srowe

Thanks to strace , I now see that VICE opens files with the syscall openat() and does not use the O_ASYNC flag that is needed when addressing a pipe.

Regards,

Wim.
VICE; selfwritten 65asmgen; tasm; maintainer of WimBasic
groepaz
Vic 20 Scientist
Posts: 1188
Joined: Wed Aug 25, 2010 5:30 pm

Re: Integrate with the host platforms filesystem (Linux)

Post by groepaz »

Make a feature request, perhaps :)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Integrate with the host platforms filesystem (Linux)

Post by chysn »

I just tried this by creating the RND symlink in my ~/vic20/ VICE virtual device directory, and running your BASIC program. It works just fine, I get an output of random numbers.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
Post Reply