Commodore 64 Supercharged by Omega2 (Pictures)



  • Way back in August last year I had an idea to "supercharge" my Commodore 64 with the Omega 2(+). This would require a second serial port, so the addition of ttyS1 on the Omega 2 worked out great for this.

    Here's the breadboard circuit, using a 74HC245 for voltage level shifting (3.3V to 5V):

    0_1500949766816_3df27d13-ba54-40ea-b78c-e3a99fbf146d-image.png

    Attached:

    0_1500949731610_54218151-017e-474d-937d-9b33b76fc9c4-image.png

    It works!

    0_1500949827351_fcc3977b-5002-4625-9774-e02842ea93eb-image.png



  • I've done something similar with a Raspberry Pi, but I much prefer the Omega2's form factor, looks like it would fit tidily in a retro cartridge case, for example.

    Some minor issues though:

    • There isn't quite enough oomph from the C64's User Port to power the Omega2 directly (through a voltage converter) - max at 5V is officially 100 mA but it can usually be pushed safely to 200 mA with a good power supply though. Still not enough for the O2+ unfortunately.

    • It's a little awkward to get a login prompt over ttyS1 as well as at 2400 baud, as per this post. A login prompt isn't strictly necessary, you could have a python script running for example to handle whatever, but a real prompt is pretty cool.



  • Figured out a good solution after a bit of digging. Shell script:

    #!/bin/ash
    
    stty -F /dev/ttyS1 2400
    
    while :
    do
      echo "" >/dev/ttyS1
      echo "Onion Omega 2+ on Commodore 64!" >/dev/ttyS1
      ash -l </dev/ttyS1 >/dev/ttyS1 2>&1
    done
    

    Right now I'm launching it manually, but could do it from inittab or some other approach at startup.

    Still two outstanding questions:

    • How could i get it to actually give a login prompt?
    • Related...Is there any documentation anywhere on what command line parameters this version of busybox ash takes?

  • administrators

    @Leif-Bloomquist said in Commodore 64 Supercharged by Omega2 (Pictures):

    • How could i get it to actually give a login prompt?
    • Related...Is there any documentation anywhere on what command line parameters this version of busybox ash takes?

    Try ash -l -c /bin/login
    I think that's the effect you were looking for.

    No documentation that I know of, found the -c option by running ash --help



  • @Lazar-Demin

    Thanks, that does the trick.

    No documentation that I know of,

    How do you not have documentation for the code that ships on your own product? That fascinates/baffles me.

    found the -c option by running ash --help

    Fair enough, but the output is pretty cryptic:

    root:~#ash --help
    BusyBox v1.26.2 () multi-call binary.
    
    Usage: ash [-/+OPTIONS] [-/+o OPT]... [-c 'SCRIPT' [ARG0 [ARGS]] / FILE [ARGS]]
    
    Unix shell interpreter
    

    I don't see how you can glean much from that.


  • administrators

    @Leif-Bloomquist said in Commodore 64 Supercharged by Omega2 (Pictures):

    How do you not have documentation for the code that ships on your own product? That fascinates/baffles me.

    We didn't create, develop, or modify BusyBox, it's a (GPL) utility that's commonly used with Embedded Linux. We don't have any special access to documentation, just what's available online.



  • Is there a unix shell on this planet that does not have the -c option? :-)

    But yes, there's no clear path leading to busybox shell docs, until one starts digging a bit harder, which I did a while ago:

    The busybox shell originates from the almquist shell (ash). ash became dash when is was ported to debian, and later became the default /bin/sh on ubuntu. And ash was also included into busybox.

    So when you want to know something about the busybox shell, the closest match is a dash man page.



  • @Lazar-Demin said in Commodore 64 Supercharged by Omega2 (Pictures):

    We didn't create, develop, or modify BusyBox, it's a (GPL) utility that's commonly used with Embedded Linux.

    Excuse me but this is simply not true.
    BusyBox is modular and extremely configurable. On Omega you take advantage of these opportunities all the time when including or excluding applets / commands / features at compile time.
    Due to the lack of information we don't have other possibilities than the trial and error method or digging the source code (if there is any).
    A short Readme would be very useful (to show us what you've enabled / disabled).

    In addition sometimes there is a pinch of false info (especially for newbies). For example:

    Onion Omega2 Documentation 2017-08-10

    The Command Line Interface

    Some Basic Commands

    Information

    If you are not used to work with the terminal, you might be happy to get some additional information what you can do within this “Black-Box”.

    To get more info about what commands you can use, just type:
    busybox --help
    and you will get a overview of what busy-box is and all commands available over it.

    busybox --list
    if you prefer a list of all this commands.

    Omega2+ v0.1.10-b160 BusyBox v1.26.2

    root@Omega-5BE1:~# busybox
    busybox: applet not found
    
    root@Omega-5BE1:~# busybox --help
    -help: applet not found
    
    root@Omega-5BE1:~# busybox --info
    -info: applet not found
    

  • administrators

    @György-Farkas What I meant was that we didn't modify the source code. I would argue that choosing which packages/modules to compile in is not modification

    In any case, our firmware build root is now open source: https://github.com/OnionIoT/source
    You can clone the repo, follow our instructions on setting up the build system, and then using make menuconfig to see which busybox packages were selected.
    Alternatively, you can try to decipher the .config file directly: https://github.com/OnionIoT/source/blob/lede-17.01/.config

    Regarding the documentation, I'll make a note to fix that. It worked at previously!



  • for this project and initial stub work.

    I began a similar project but without the max232 level shifter. It would explain why my terminal was receiving Garbage.

    I encountered a odd sitiation with the script. If I use SSH to anther server , the password prompt returns on the omega putty shell and not the serial.

    I also wasnt able to CTRL+C anfter a ping command.



  • @Leif-Bloomquist
    I have the same setup in a way and I get a " -ash can't access tty; job control turned of "
    When it shows on the serial port

    I have this script work on rc.local and it works on boot.

    Trying a ping command or top won't let me CTRL+C out of it.



  • @Lee-Lilleorg-Meilleur

    I Have Come up with an inittab solution :

    I use a USB (until i setup a MAX232)

    ttyUSB0::respawn:/bin/ash -l -c /bin/login

    This will provide a basic login shell to the serial term and allow ssh to other systems.
    It accepts CTRL+C too so pings work !!


Log in to reply
 

Looks like your connection to Onion Community was lost, please wait while we try to reconnect.