Cbmsh - A Unix-like shell for the commodores

Basic and Machine Language

Moderator: Moderators

pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Cbmsh - A Unix-like shell for the commodores

Post by pallas »

Update: cbmsh now has its own web page:

http://www.opbyte.it/cbmsh/

But this thread will continue to be the main discussion resource.

*** Original post: ***

I was looking for a unix-like shell (or of any kind) for the vic but couldn't find any.
So I thought I could make one, but I've got too many unanswered questions in my mind.
Thus I'm asking you guys for advices.

1) First of all, is it a good idea to have a unix-like shell on a vic. I say: why not!

2) If I was to make one from scratch or compile an existing one. Pretty complex topic, see the next points. I need your points of view on this, nevertheless.

3) If a new one it would need to, at least, support basic commands like ls, cp, rm, cd etc. Which language? C65, asm? My bet is some sort of C because I know the language well and it is more portable.

4) Compiling an existing one might be even more difficult than making a new one, unless I can find a shell written in C which has very little dependencies. For example, I believe most shells depend on gnu readline, so I would need to compile that first. The dream would be to have busybox for cbm :-)

5) Is anyone interested in making a community project out of this? I do not have much time to dedicate, and if I was to do it myself alone, it would take ages. Maybe a git or svn on sourceforge would be the best way to work on it.

Now don't tell me there is one already and I'm a very bad googler hahaha! :-D
Last edited by pallas on Mon Apr 22, 2013 4:43 am, edited 2 times in total.
rhurst
Omega Star Commander
Posts: 1369
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

Like the one with C128 version of Super C? Love the concept as the interface to their compiler... but for VIC, it would have to at least support a RAM drive with FE3, or the like. Else, it would be a slow interface on a slow computer offering only more complexity.
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

The RAM drive for the FE3 is already there, even with a command channel, so rename and delete work. :)

Of course, there's always the VIC wedge, and menu-driven environments like CBM-Command, or graphic environments like VIN, but having a real command line, maybe even with 40 columns per line (so full directory entries can be displayed properly) with readable commands, capable of starting programs, would be a nice touch.

Ideally it should come as cartridge so it's already there when the VIC-20 is powered on.

Ah, daydreaming on weekends. :lol:
KingTrode
Vic 20 Hobbyist
Posts: 133
Joined: Tue Apr 13, 2010 2:32 am

Re: A Unix-like shell?

Post by KingTrode »

pallas wrote:1) First of all, is it a good idea to have a unix-like shell on a vic. I say: why not!
It certainly would be nice to have something like this available.

pallas wrote:3) If a new one it would need to, at least, support basic commands like ls, cp, rm, cd etc. Which language? C65, asm? My bet is some sort of C because I know the language well and it is more portable.
Personally I would use the tool(s) that would best produce something that gets the most out the VIC / utilizes your programming skills (sacrificing portability if need be).
pallas wrote:4) Compiling an existing one might be even more difficult than making a new one, unless I can find a shell written in C which has very little dependencies. For example, I believe most shells depend on gnu readline, so I would need to compile that first. The dream would be to have busybox for cbm :-)
If you already have some good ideas for the basic shell and your comfortable with your dev tools, I would start from scratch - combined with what you have seen in other similar shells / feedback from the members here to produce a draft.
pallas wrote:5) Is anyone interested in making a community project out of this? I do not have much time to dedicate, and if I was to do it myself alone, it would take ages. Maybe a git or svn on sourceforge would be the best way to work on it.
I don't have great skills in this area but if I could help in anyway then I would certainly try.
Mike wrote:Maybe even with 40 columns per line (so full directory entries can be displayed properly) with readable commands, capable of starting programs, would be a nice touch.

Ideally it should come as cartridge so it's already there when the VIC-20 is powered on.
Would be very nice if it supported these features.


KingTrode / Jim
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

To get an impression what's available today, here's an expanded list of links to utilities I hinted at in my previous post:

o VIC WEDGE (runs in *all* memory configurations!),

o Kananga's VIN20 GUI with filebrowser, and

o Plbyrd's CBM Command V2.1.

for completeness, I should also mention:

o nbla000's CBM File Browser, even though it 'lacks' directory organizing features like rename and scratch,

o Diddl's SJLOAD 07 for JiffyDOS-enabled drives (includes all SD2IEC and uIEC drives, etc.),

o Waterloo BASIC+, which has the VIC Wedge built-in (included on Mega-Cart), and

o the BASIC V4 extension cartridge.

In principle, the last one makes the disk commands of CBM BASIC V4 like DIRECTORY, RENAME, SCRATCH, etc. available as BASIC extension for the VIC-20, you can use these from the READY prompt as well, thus it's already quite near to that specification you gave above. It's just missing the 40 column support, and tools for single file and whole disk copy. ;)
pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Post by pallas »

Thanks Mike for the information.
I didn't have much time this weekend to work on this, but I did have a look around to see what minimal shells, written in C, are available. There are a lot, because of the use in embedded systems, network equipment etc.
There is one that is promising, it's called "sash". The source is pretty simple and is designed to work stand-alone, so it's a good candidate. It uses "make" and no other compilation tools.
Of course there is a lot of work needed:

- remove all features which are not available on the vic: process management, compression, etc.
- remove dependancies on libraries which are not provided by cc65 and other limitations (use of "double" for example).
- fix all the rest to work correctly on the vic: a lot of little things will need to be suited to the limitations of a '81 computer ;)

Next step for me is having a deeper look at cc65 and which libraries it provides.
Then, if I don't find any blocking matter, I could start cleaning up the sources and trying to compile and see what's up.
Assuming it's all ok and I have the time to do all this, I'll the upload the sources to sourceforge. But let's not dream too much for now ;)
User avatar
Schema
factor
Posts: 1430
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

Wasn't there a port of Contiki to the VIC? The C64 version has a rudimentary shell.
pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Post by pallas »

Progress:
I was able to compile a heavily modified sash but it crashes like hell. I think it's because I'm using the svn version of cc65. I can't use the stable one because it misses some features I need.
Changing an empty loop from 0 iterations to some causes a crash, so it must be something related to the compiler.
And the snapshots + svn are currently unavailable, so I don't know if any fix has been made to the cc65 sources.
Pausing for now... :-)
rhurst
Omega Star Commander
Posts: 1369
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

FYI, CC65 has an active developer mail list for support. Post your loop and observations there and at least one person typically helps or resolves the matter the same day.
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Post by pallas »

Turned out it was a compiler problem indeed. Reverted some svn revisions back and now, no more crashes!
Let me fix some more evident bugs and then I'll post it.
Cheers! :-)
pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Post by pallas »

Now it's mostly working.

What's missing:

- program execution
- fitting 16k
- "ls" options
- chdir and pwd can manage devices only, no subdirs

Image
FD22
Vic 20 Hobbyist
Posts: 148
Joined: Mon Feb 15, 2010 12:31 pm

Post by FD22 »

Genuinely impressive. Looking forward to seeing where this goes next.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

But... Why would this be useful?
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Post by pallas »

Boray wrote:But... Why would this be useful?
Have you ever used a Unix like shell?
Even if you find it useless, it's funny to do and pretty cool, IMHO.
Your mileage may vary ;-)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Of course I have used unix shells as well as DOS, AmigaDos etc. But I can't see much use for it on a vic-20. Would it include script execution? And would it require special programs? I mean a normal vic-20 program takes over the whole computer anyway.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Post Reply