Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts

Friday, May 29, 2026

Caravan (Part 1) - A New Plan For A New Place

My partner and I are looking for a new place to be.  Being the computing-dependent nerd that I am, I want to be able to have all the services I depend on in our current place available in the new place as soon as there's power and Internet.  To that end, I decided what I ought to do is build a road-ready rack with a firewall and a few computers in it.  Once we close on the new place and get utilities turned on, I can pop the rack in there, and be up and running in an hour or 2.

Some background -  About a year ago, I had switched from all my "vital services" being on VMs on a Proxmox cluster to hosting them on a couple RasPi 5s.  I consolidated a lot.  Where before I had separate VMs for my RMVOD, Icecast2, Desktop, food inventory web app, file services, and so on, I decided I could do a lot more with a lot less CPU and memory overhead if I just had it all running on one 16GB RasPi 5.  I have a second RP5 that is the Jenkins host and hosts backup media.  Actually there's a third RP5 that acts as a bastion server and rack console.  This resulted in using a lot less power and generating a lot less heat.  The file services are facilitated by 4 x 8TB disks configured in a RAID5 arrangement in a USB3 enclosure, viz:

 


Can be got here: https://www.amazon.com/dp/B0DD3GZSGJ 

 That USB3 4-bay HDD enclosure hangs off the one main 16GB RasPi 5, and holds my audio and video stashes, my personal file share, and various sundry other bits and bobs.  Other than that, and USB connections to printers and backup media, basically my whole "infrastructure" is handled by 3 Raspberry Pi 5s and a tiny Netgate box doing the routing. 

  This transition has worked out well.  My plan is to more or less replicate this success but in a portable package.

 Enter Caravan

 The name "caravan" was just meant as a nod to portability and the kind of "home away from home" self-contained nature of a camping trailer or RV.  I settled on a 6-space rack enclosure, such that it could handle a switch, a shelf for a Netgate 1100, 2U for a RasPi enclosure, and a PDU.

I ended up getting this enclosure:

 


Can be got here:  https://www.amazon.com/dp/B0CZ41ZHD6

 It comes with screws for the rails (it takes 10-32 screws, but prefers them short), so that's handy, but there's a few shortcuts taken by the manufacturer that might cause frustration.  The plastic stinks -- it off-gasses... It claims to be HDPE... and maybe it is, but I've never come across HDPE stinking like this.  Screws holding the rack rails to the enclosure are poorly placed.  Things like that.  On the bright side it's cheap, and I'm not going on tour with Aerosmith (or whoever the kids like today), so extreme toughness and/or ATA-certification is not important for me in this application.  Surviving an 8-hour car ride is the thing. 

 The switch I settled on is a simple TP-link 24-port unmanaged gigabit switch (TL-SG1024S). It fits in 1U, comes with the rack ears and is under a hundred bucks. 

 Can be got here: https://www.amazon.com/dp/B0779R9LJ3 

 The PDU is kind of an odd choice.  I went with one from Pyle.  Yeah, Pyle.  Normally, Tripp-Lite has been my go-to for rack PDUs in my personal/home stuff.  They're pretty bulletproof, and I've found them reliable.  In this instance, tho, I was anticipating having a bunch of wall-wart power supplies (because no one has figured out how to do a rack-mount muli-Pi power supply yet, apparently) and 1U PDUs with traditional outlets are just not happy with that.  This Pyle unit has all pigtails in the back.  It really is a thing of beauty.  Viz:

 


Can be got here: https://www.amazon.com/dp/B072RC5NZQ 

 The big deal, tho, is the enclosure/mount for the Raspberry Pis.  I wanted something that would accommodate the PCIe SSD capability offered by the Pi 5.  I also wanted to be able to stuff it with RasPis, because... who knows what kind of goofy shenanigans I might get up to?  I went with a GeekPi unit which stands the RasPis on their side, and has a daughter board for each of the 10 "caddies" which uses pogo pins for power delivery and some GPIO connections, and connects to the PCIe connector on the Pi for M.2 SSD support via flat-flex.  This enclosure holds up to 10 RasPi 5s.  My only big gripe with this thing is that the screws for the caddies aren't captive.  The daughter boards seem to work great, and packing up to 40 cores of Raspberry Pi goodness into 2U is pretty sweet.  The daughter boards move the power connection to the front panel, so easy power on/off is right there.

 


 Can be got here: https://www.amazon.com/dp/B0DQL2N6V9

I have the rack assembled and 7 of the RasPi slots occupied.  Now I'm building out services. I've currently got 1 16GB, 2 8GB and 4 4GB RasPis mounted.  One of the 8GB units has a 1TB SSD setup as a MariaDB server, with the OS on a MicroSD, and the data on the SSD.  The other 8GB unit also has a 1TB SSD, but the OS is installed on it.  This one is serving as a Desktop machine with xrdp installed.  I have one of the 4GB RasPis serving as a bastion server and rack console, and the other 3 4GB units have not been assigned, although I expect one of them will be a file & print server (and maybe identity) and one will likely be media streaming.  I have designs for setting up local email, chat, groupware, an Asterisk PBX, and a few other services.  The 16GB unit will host most of the dynamic web stuff (minus database and file needs).  I haven't worked it all out yet, and I have some room to grown in the GeekPi enclosure.

More to come

There's plenty more to do and a lot more decisions to take.  I'll update as this progresses, but I thought it might be nice to offer some of the stuff I've done so far in case anybody's considering a similar project.

I think that's all for now. 

 

 

Friday, August 1, 2025

Register The Click

 Remember when computers acted like computers?

Remember when you could tell a computer, "when this condition exists, do these things, then report the outcome"?  ...if the computer hardware and firmware was nominally operational, it would just follow the instructions and do the things.

I have a pair of Raycon "everyday earbuds" which ... work ... mostly.  When they work... WHEN they work correctly, they sound decent and stay in my ear for a little while.  ...which... y'know...  is mediocre.

When I open the little case and put the earbuds in my ears... about 50% of the time one of them has not woken up.  I then have to futz around and fumble with the sleepy one for a couple minutes to wake it up.  That's great.  When I go to STOP using them, I'll manually pause whatever media, open the case, remove one bud and place it in the case, then the other.  Close the case.  Wait a few seconds.  Resume playback of the media.  It's playing in the little earbud case.  Pause media again, go into Bluetooth menu on phone and manually disengage the earbuds.  Bump media back 30 seconds and resume play.  I have not run these earbud through multiple laundry cycles (not even one).  I have sweated pretty vigorously on them, but... they're earbuds.  People supposedly use them while working out and stuff.  In the rain.  That seems unlikely to be the problem.

Some of the blame may rest with Android (the Operating System on my phone), some may rest with the firmware in the tiny computers in the earbuds and the case that manage pairing, charging, and ... I don't know... selling my ear canal dimensions to Chinese data brokers?

In any event, it seems to me that there has been a trend ongoing since at least the arrival of Java that has put so much abstraction between when I press a "button" someplace and what happens as a consequence that it's basically up to a dice roll whether or not anything actually happens... and if something DOES happen, whether or not it's what I intend... that computers have become essentially useless.  

My user experience is getting sensibly and quantifiably worse with every new UI "improvement".  

I blame "capacitive touch sensors".  Seriously.  The promise of multi-touch screens was huge, and, after a decade or so of beta testing in production... they're about 70-80% there.  In that time, one-page web applications and smart-phone apps have banked on these touch screens being viable and reliable.  They are not.  Is it humid?  Is it dry?  Are your hands sweaty?  Have they been sweaty?  What's the pH of your skin?  Are you near a source of RF energy?  Are you in a hurry?  Did you press hard enough?  Did you press too hard?  Does the size of the touch surface impact its effectiveness?  It kinda seems so...  Couple this ridiculousness with the fact that UI designers are steering away from things like feedback.  An animation or color change or "click" to acknowledge a "button push".  Not in five minutes.  FUCKING NOW.  ...and maybe an indication that the thing is actually working on something and hasn't just FROZEN.  A throbber, a progress bar... a CLI spinner or series of periods as the process moves forward.  I can do without proportionally-spaced anti-aliased vector fonts and window transparency if it means I can get what I need done, done... without all the anxiety of "did my button push register?!" and waiting in uncertainty for some indication that I will get the result I want.  

I want my computer experience to be as reliable, immediate, responsive, and free from anxiety as playing actual real live acoustic drums.  I hit drum with stick, drum does what it's supposed to do, immediately, and without any perceptible "consideration".  I want it to be entirely predictable.  If I hit the head dead center, I expect it to sound rich and full,  If I hit it off-center, I expect it to sound pinched and a little funny tonally.  If I hit the rim, I expect it to add a certain additional sound.  I don't have to watch my stick hit each drum and wait for it to make a sound.  I can not-look-at-the-drums while I'm playing and have a fair idea of whether I'm hitting them correctly.  Right away.  I have confidence in drums.  I have no confidence in modern computer user interfaces.

I don't hold out any hope that I'll see an eight-core, sixteen-thread personal computer running at four gigahertz with thirty-two gigabytes of RAM that can get out of its own goddamned way and and just register a fucking button push when I push the fucking button, rather than waiting until it takes another screenshot and "encrypts" it so Microsoft can... what? ...masturbate to it?  I don't need the window to be transparent.  I don't need fancy convolving animations and sound effects to know that I just minimized a window.  Register the click and do the thing.  NOW.

First of all, I need feedback.  Give me confidence that I have actually pressed a button. 



Saturday, September 21, 2024

Remember Watching Reruns On Local TV?

 I know it's been a while since I've updated on anything here regarding any of my ongoing projects...

Well...

Binge-watching a TV series has become a pretty popular thing, and I've certainly done it myself.  The sense of the "episodic" nature of a lot of (especially older) TV shows is kind of lost, though, when I binge them.  I started really noticing it, strangely enough, watching Star Trek: Strange New Worlds.  I found I enjoyed it more watching one episode, going away and doing something else, then coming back and watching another episode, maybe a few days or weeks later.

RMVOD has finally made some progress.  One new feature that I've been ruminating about for a while was doing something akin to what you might see on a broadcast TV station in the 80s or 90s... a scheduling block of syndicated TV shows.  Typically a TV station would buy the rights to a TV show, and just play one episode a day, or one day a week, rifling through the episodes in whatever order the distributor provided them in.  Granted, some gave it more thought than that, but... They would have a block of shows for mid-morning, early afternoon, late afternoon, evening, and so on.  Weekday and and weekend schedules. 

A screenshot of RMVOD showing the TV Series Play List content.
 TV Series Play Lists in RMVOD

So, what I'm working on is something similar for RMVOD.  It's a playlist of TV Series, not individual movies or episodes.  When you initiate playback of a "Syndication Play List", the UI calls the API to request a list of the episodes to play.  The server looks through you watch history to see the most recently watched episode in each series, and picks the next one.  Of course, not all series have the same number of episodes.  There's an option in the Play List to specify whether a Series should loop back around to the beginning when it runs out of episodes.  If a Series runs out of episodes, and the Series restart flag is not set, then the series is skipped.  There is another option on the Play List which permits the programming block to keep looping until you manually stop it.

Right now, the only thing that's working is the basic Play List interpretation and episode selection on the server, and playback in the web client.  The storage of Play Lists in the database is solved, however, currently the Play Lists offered to the user are hard-coded in the web client.  Display and selection of a playlist in the web client is minimally solved, but creation, editing and deletion/deactivation of Play Lists is still to be developed.  

So, it's a baby feature, but just testing it out, I've really enjoyed the "one episode at a time for each series" thing... and as I get used to the patterns of the playlists (show A, then show B, then show C) I suspect it will be more enjoyable and relaxing.  Maybe this is just a me thing, but I find it more enjoyable than binging for a lot of shows... maybe most of them.

One thing I've also been thinking of as a stretch goal for this playlist feature is a "movie of the week" sort of function.  Basically, create a special kind of artifact (an new "Major Type", maybe) which picks out a movie that meets certain user-definable criteria, and hasn't been watched in some period of time (90 days, maybe), and inserts that into the artifact list.

Anyway, that's what's been going on at RIBBBITn3rding.  If you're curious, you can check out the code for RMVOD here: https://github.com/taobear68/rmvod  (it's Open Source)

Saturday, February 3, 2024

Proxmox Migration - Progress Report #1

I have procured parts to build a "modern" Proxmox host, including an ATX MoBo, 12C/24T AMD Ryzen 7900X, 128GB RAM, a 2TB SSD, and 4 x 1GB NIC.  I've pre-built the new host (Joanna, named after Roz mother from Frasier ...and, yes, I've set up that many machines that I'm going that deep into the bench of Frasier characters) on a "test bench" frame I bought.

The parts... minus the NIC and SSD.  Also ended up
using the cooler that came with the CPU.

I have done some storage experiments, and arrived at the conclusion that using the existing 18TB disks in a XFS RAID5 will be the way to go.  That means I will need to wipe the disks and re-format them when I do the OS Reinstall on Jerome.  For continuity of service, that means I need to port those files off to somewhere else.  I have decided to light up Floyd, my old 20-bay storage server, which has been cold iron for a little over a year (that's when I migrated storage to the disks onboard Jerome).  Floyd is up and operating as expected.  I have migrated my video library back over there, and now I have to migrate my other file shares over there.  Then I need to repoint all my share mounts.  That'll be fun.  This is in preparation for the OS install on Jerome.

Of course, I'll also need to migrate all the VMs currently running on Jerome off to Joanna.  In previous migration attempts, I have not forced the MAC address of the copy to match the MAC of the original.  For these remaining VMs, I really want to make sure the copies on Joanna look just like the originals did on Jerome.  Hopefully I can coordinate everything and set the MACs, and they just come up.

I've done some networking experiments with the new NIC, and managed to get 2 of the 4 interfaces set up, which is the minimum I need to set-up my replacement PFsense VM.  I plan on the other two being "room for expansion".  I've decided to go with a replacement rather than a migration, as I want to be able to "flip the switch" on my other machines -- from VirtualBox-based VM to Proxmox-based VM -- without any down time.  Once Jerome is back up running Proxmox, I'll just set up another PFsense VM there.  ...but I'll be able to take my time and make sure all the network interfaces are set up and working as I expect.

I had hoped that I could setup a "storage" VM on Joanna, and mount the shares from Floyd there, and re-share them via NFS, which, I'd hoped, would eliminate the need to re-write all the /etc/fstab files on all the machines on the network that use the shares twice.  It looks like that's not going to work.  However, I did figure out how I'm going to do the big disk array once Jerome is running Proxmox, and I will be using a storage VM to share those filesystems... I may even try out TrueNAS.  Who knows.  At a minimum, I can just use Debian, as my needs are pretty contained.

Ultimately, my plan is for Jerome to be the "prime" VM host, where all my "full time" VMs (storage, firewall, desktop, streaming servers) will run, and Joanna will be my "secondary" VM host, where "lab machines" and other non-full time VMs will live.  Each VM host will have its own local storage, but the "Big Store" will live on Jerome for the foreseeable future.  Floyd (named, incidentally, for Mayberry's favorite barber -- I used to name my machines after Andy Griffith Show characters) will go back to cold iron once the migration on Jerome is complete.

Today, I plan to move the guts of Joanna into the case I'd originally bought for Zora.  Then, I'll migrate some (all?) the non-PFsense VMs to Joanna.  Maybe I can also set up a PFsense VM on Joanna.  We'll see.  It looks like it'll be a full, rich day.

Tuesday, January 30, 2024

Migrating from VirtualBox to Proxmox - A beginning

A long time ago, now (2019, as it turns out), I set up a super-duper AMD Threadripper machine with 16 cores and 32 threads, and 128GB of RAM to be a Virtual Machine host for my home lab. Since then, it has evolved into the host for my PFsense router, my "desktop" machine, and a bunch of other VMs, as well as my storage server. At the time, I set it up with a regular Ubuntu install with VirtualBox running on it. All these VMs are being run on VirtualBox. 

I know. 

Well, time-and-a-half went by, and I became aware of Proxmox. I never really had spare hardware with enough grunt to really try it out, so I kinda let it go. Then, my employment relationship with that online furniture retailer (as well as those of about 500 other folks) suddenly ended. The machine I'd put together as a "BYO" desktop for work was suddenly out of a job as well. That was a pretty beefy machine... AMD Ryzen 7, 8C16T with 32GB of RAM... but it had a sort of narcolepsy problem. it would just... for no apparent cause... stop. It didn't seem to be thermally-related... not the power supply. I have no explanation... it just farts out... but I can usually get a good 6-8 hours out of it, sometimes a lot more. ...so it finally dawned on me that this old beast might be a good Proxmox test mule.   That was a couple months ago.  I decided to give it a go, and I like it. I like it enough that I want to migrate my "production" VM host to Proxmox. 

Well. 

I'd hoped to migrate the VMs, one by one, to Proxmox on a different host, and then do an OS re-install on Jerome (the Threadripper box - named after the "good family man" to whom, Frasier and Niles owed a "favor") with Proxmox, and migrate some or all of the VMs back over. 

The old BYO machine (named Zora, after Fraiser's "excitable" Greek aunt... I have a lot of machines named after characters from Frasier) is based on a Mini-ITX motherboard, so it has only one PCIe slot, and that's taken up by a video card. I need more Ethernet ports to run my PFsense router... and, of course, there's the "oops I forgot how to computer" problem. So, I decided to build a new machine, with a full ATX motherboard, and slots... and I managed to find an AMD Ryzen 7 CPU with 12 cores and 24 threads AND a built-in GPU... so that's exciting. Not QUITE as heavy as Jerome, but pretty good... and 128GB of RAM. So, I can put a 4 x 1GB Ethernet board in there, and run my PFsense router, and the board has 4 SATA ports, so I can figure out how to do my storage. 

Ah, yes, storage. Jerome has three 18TB drives in a RAID5 array, and those are run by the host OS. I'm thinking that under Proxmox, I will have the raw drives forwarded up to one of the VMs that will serve as the storage server... but I'm not entirely sure how that will work. I haven't really dug into the docs yet. I know it's been done in other KVM environments, so... I'm confident it should be doable. When I get the new machine up and running I can try it out. It would be lovely to just be able to take the disks as they are, and plug them in on a fresh Proxmox install, build a fileshare VM and just... ta-da! We'll see. 

So, the parts for the new Proxmox host are supposed to show up today. Hopefully, everything goes together without a hitch, and I can begin properly experimenting. 

Updates when they're warranted.

Sunday, January 28, 2024

RMVOD v0.9.2 is HERE! It's a BIG DEAL!

New Features:

 0) User Sessions.  You have the option to log in at the browser and track your viewing across multiple devices, such that your recommendations will be consistent across devices, and your tv series viewing history will be aggregated.  User sessions also enables you to bring your settings with you, like playback speed, watch next episode, and resume playback.  In addition to your settings, watch data like "current artifact" and "time offset" are also captured in your session, so you can switch devices easily in mid playback.

1) Recent Episodes. Thanks to the existence of User Sessions, it is now possible to keep track of what the latest episode is that you've watched for a TV Series, and either re-watch or watch the next one with just one click.


Bug Fixes and Minor Tweaks:

Posters now fetched from OMDbAPI - The previous source of poster images became unusable.  RMVOD has been shifted to take advantage of the service on OMDbAPI 

Added "stats" - The "Settings" tab has a clickable link which fetches the current "statistics" for the server, including the current count of movies, tv episodes and tv series, as well as viewing statistics for the top 10 tags among tv series and movies, and the top 10 titles for each tag.

OMDbAPI "Series Fetch" bug fix - Fetching series info from OMDbAPI had a bug, which has been fixed.

Added Playback Speed option to "Settings" - Playback Speed can be set as a option in the Settings tab.

Fix title set on play. - There was an issue with setting the page title when playback starts.

Fix Recs Poster Image thing. - There was an issue in the recommendations artifact details wherein the artifact details were not getting the "oops no poster" when there was no poster for the artifact.  

Reworked statistics to have the period delivered by the client, rather than hard-coded in the API.  



Download the latest stable code here:

https://github.com/taobear68/rmvod/releases/tag/v0.9.2


Thursday, January 19, 2023

RIBBBITmedia VOD -- The Beat Goes On

 RIBBBITmedia VOD -- The Beat Goes On

A lot has happened since October.

  • There's a GitHub repository
  • The "one page" is redesigned to use a tabbed interface
  • There are now search links in the artifact details for people involved
  • Multi-Factor Search is working now
  • "(series)" now in pale yellow to stand out a little more
  • Page header has been simplified, and now contains the artifact details when something is playing
  • Cookies are now being used to capture the currently playing artifact and play position to permit resuming playback on page reload
  • Cookies are capturing the state of "Settings" to allow them to persist across page loads
  • Search factors added: year range, major type, SQL WHERE Clause
  • Single and Group artifact creation works in the web UI
  • Version numbers are gathered from API, CSS, HTML, and DB, passed to the JS UI, and listed in the footer of the page
Fresh load of the "One Page"
The "One Page" is done with a nearly black background and light gray font to aid readability and minimize shock to the eyes when being used in a "home theatre" setting, with low ambient light.

Artifact playback
Artifact details are included in the header during playback.  A clock display is also included in the header.
Add multiple artifacts
"Add Multiple Artifacts" is a new feature (not that you could tell by the lack of visual sense it makes)

Still to do:
  • New function: Add Episodes to a Series
  • Add some descriptions, directions, and (maybe) tooltips
  • Clean up alignment of new forms







Thursday, October 6, 2022

RIBBBIT media VOD

 RIBBBIT media Video On Demand!



Well, what is the point of this?!  

As a long-time cord-cutter, I've made some use of streaming services (mostly YouTube, but also Netflix and Amazon Prime), but I've often been frustrated by available solutions for streaming my own media at home.  Part of what frustrates me about the commercial VOD services is that I'm at the mercy of what their library managers decide will be available to me.  Let's say I want to watch "The Towering Inferno".  Well, if none of the services I'm subscribed to currently think that is worth having online, I'm out of luck.  Well, if I own the DVD, why not just watch it on that?  DVDs are great for getting "ownership" of the media into my possession, but once I have it, I'm very restricted in how I can consume it (to say nothing of maintaining and regularly interacting with a library).   Yes, "ripping" DVDs offers some solace, but now there are data storage issues, and how do you catalog and index such a library? For years, I simply hung an NFS share out there, and watched via VLC on a PC or laptop.  That has obvious limitations.  That DID scratch my itch for a time, but I wanted something more library-ish with indexing and searching and so on.  One obvious (but exhausting to maintain) way to achieve this would be a forest of symbolic links on that NFS share... but another way would be to use an RDBMS to maintain all those relationships, and simply query against that to get the filename of interest.  That has the potential to be much easier to maintain (and expand).

What's it made of?

Since HTML5 includes (among other things) handling for video playback, I figured it couldn't be TOO hard to implement a simple video player page.  I was right.

I've been working on re-ripping and/or transcoding my video library from MPEG2 to MPEG4.  As of this writing, I have over 2,500 TV Episodes and 350 movies in MP4 format (all ripped from DVDs I own) and logged in the DB, many with metadata (such as runtime, people and companies involved, synopsis, and so on).

The system consists of:

  • a static HTML page, which loads 2 JavaScript files, and sets up the layout of the page, 
  • a Python file which serves both as a Flask REST API and a CLI for interacting with the database, and 
  • a MariaDB database.  

All told, the HTML, JavaScript, Python, and SQL DDL currently fit in under 6000 lines of code (including comments and whitespace).  Some refactoring will likely bring that down a bit.



As of now, the ability to edit DB info for individual "artifacts" within the web page exists.  The CLI is for doing things like bulk-creation of artifacts from file lists, creating tags, assigning individual "episodes" to a "series", and so on.  On the bright side, the back-end code to achieve these things exists in the Python file, but I haven't gotten around to hanging a web UI on any of it yet.



Also, there is no authentication on the web side... You are J. Random User.  The back end keeps no stats on you, and currently places no restrictions on whether you can update DB information for any particular artifact.  Obviously, this is not intended for public use.  It's intended for a person (or family) to interact with their own video library.

Call to action(?)

Is this something that interests you?  Would you be interested in seeing this go up on a publicly accessible repo?  Comment!


Thursday, June 30, 2022

Netgear SSO? That's a hard no. pfSense to the rescue!

 Some time ago... a couple years, now... my trusty old cheap Netgear router breathed its last, and I bought a new one.  The new one had this pain in the ass "Single Sign On" thing that made you set up an account with Netgear in order to log in to the router.  Hard pass on that.  It's possible to log-in locally, but it's extra steps that piss me off.  I've been ruminating on switching to pfSense for my routing/firewall needs, and just getting one or more cheap Wireless Access Points to handle the WiFi.  I have enough hardware just lying around that I could have done pfSense on a dedicated x86 machine, but the power, space, and noise were things I was not crazy about dealing with.  I'd thought about installing it on a VM on my Threadripper VM Host, but the networking would be a problem without additional hardware.  I finally got a 4x1G ethernet card for my VM Host, and stood up and pfSense VM.  

The config process was not bad, per se, but it was a little opaque in spots.  I have a separate Raspberry Pi running dnsmasq, handling local DNS, DHCP, and DNS forwarding, whereas nearly all of these modern router appliances have built-in, and a pretty enthusiastic about acting as your DHCP and DNS server.  Chalk it up to paranoia, if you like, but I prefer the "component stereo" model here, if for nothing else, it allows be to keep at least some of my more complex config stuff up and running if something like a router quits.  Getting DNS forwarding through pfSense was a little bit confusing at first, but I got it worked out.

Port forwarding turned out to be easy once I figured out that refreshing DHCP leases had to be done on target boxes for return traffic to go back through the router.  I'm smart.

OpenVPN server setup on pfSense has not brought me joy, yet, but it could, still.  I remain hopeful.  Part of the problem, I think, is that my network is on another RFC-1918 network -- that is, I need to traverse another "local" network to get to the Internet.

I ran into a couple hiccups when I tried to get one of the WAPs I bought working.  They're TP-Link AC1200 (TL-WA1201) devices, and they were cheap.  I bought 3, because why not.  The "quick setup" didn't seem to stick, entirely... so I had to kind of work through "not quick setup", and it seemed to take a few tries at that, with resets in between for it to really come up and do its job.  So far, an hour into its service life, the first TP-Link TL-WA1201 seems to be doing the right things.

So, now, my private network is fronted by a VM running pfSense through a dedicated 4x1GB ethernet card, and WiFi is running of a TP-Link WAP, and with any luck, I'll never have to deal with Netgear's stupid SSO nonsense again.

The next bit of excitement for the home network is a 48-port switch.  I know, how can I possibly justify a 48-port switch?!  Well... I'm not going to pretend that I have 48 wired Ethernet machines up and running all the time, but I do have 6 machines in my rack, and 20 or so machines strewn about, and I have little "desktop switches" all over the place... I'm hoping to get away from that.  Of course, that will mean doing more home-runs, but I'm hoping it will make for less confusing networking.

Monday, June 20, 2022

The RIBBBITN3RDing BitPump


The RIBBBITN3RDing BitPump


The RIBBBITN3RDing BitPump r0.1


A little bit of background 

I've been trying quite a few new things with my RIBBBIT65 designs, and I'm running into issues which aren't making a lot of sense.  I've also been having some trouble isolating issues (e.g. "known good" components or circuits don't work *here*... and it turns out "known good" wasn't)  I wanted to have a way that I could repeatably, and quickly, put a bunch of R65 Bus signal configurations ... snapshots, if you will... on the bus to confirm the thing is behaving the way I expect.  Rather than coding something up in 6502 Assembly for every different testing scenario - and, in the process, intoroducing the possibilty that the CORE board I'm using has a problem, I thought it would be better to do something like my TTL Busy Boxes, but on steroids.  The Busy Boxes are just boards with switches and/ or lights that let you do some multiple of 8 worth of switching and/or indicating.  The first one I designed has an 8-position DIP switch, 8 mini-tac switches, and a 10-segment LED bar graph.  That's great for, say, the data bus.  There's still the address bus (16 bits) and all the control signals.  Well, controlling 32 (or more) signals via DIP switches and/or Mini-Tac switches through 20 or 30 cycles (to test an ACIA or a VIA) just seemed like a nightmare.  ...if only there was a way to repeatably send out pre-defined bit patterns over regular time intervals...


The BitPump

The RIBBBITN3RDing BitPump is intended to be an easily reconfigurable digital signal generator which can provide the bit patterns necessary for in-circuit testing of subsystems which interface with 8-bit microcomputers.  


The BitPump, configured for use with the RIBBBIT65 provides:

  • an 8-bit bidirectional Data Bus
  • a 16-bit output-only Address Bus
  • 4 jumpered CPU Control signals (VPB, RWB, MLB, SYNC)
  • Jumpered Pull-ups for 5 CPU Control Inputs (SOB,RDY,BE,NMIB,IRWB,RSTB)
  • 8 bits of completely manual switching, both latching and momentary on each bit, with indicator LEDs
  • 1 "bus clock" driven by a separate IO pin from the bit pattern

The BitPump uses a RaspberryPi Pico (or simlar) to drive a set of four serial-to-parallel shift registers.  

The lower 8 bits (which in the original configuration are wired to the data bus) are bidirectional, and the data direction is controlled by the same "control bit" which drives the R65's RWB (Read, Not-Write) line.  In "Read" mode, the data lines from the bus are displayed on the LEDs.

Since the BitPump is driven by a RaspberryPi Pico (or equivalent), the user has the ability to easily re-program the device to send whatever bit patterns are desired at whatever speed is desired (within the confines of 74HCTXX switching speeds and the capabilities of the sytem under test).


Uses of the BitPump

I'm planning to use the BitPump to see what's going on with my Mini-ITX design.  There's definitely something rotten in Denmark.... hopefully I'll be able to use the BitPump's lower speed, and "known good" bit patterns to isolate the problem(s).  Similar story on the "CORE Daugher Support" board, which is basically supposed to provide a serial console, IO selects, pull-ups and a few other things to the CORE Daughter board I designed for the ITX MoBo, to just make it minimally interactive and runnable.  I plan to troubleshoot both these boards using bit pattern sets delivered by the BitPump.

After that , I plan to use the BitPump to test out different ways of running the 40x4 character LCDs I have.

I can also use it for direct testing of IO and memory chips, since the "data bus" is bidirectional.

What can you use it for?  I dunno.  You could build one and try it out.


Possible updates to the BitPump

One thing I think might be nice is a knob to control the "clock speed".  This could be done easily with a pot and one of the PWM inputs on the Pico.

Another thing that might be nice is a manually controlled "RUN/STOP/STEP" thing that could be done with a couple digital inputs on the Pico.

Do you have any ideas?

Wednesday, March 30, 2022

RIBBBIT65 on Mini-ITX: The Pre-Dawn Chill

RIBBBIT65 on Mini-ITX: The Pre-Dawn Chill

Good news, everyone! I've taught the toaster to feel love!

Also, the design of r0.1 of the Mini-ITX version of the RIBBBIT65 is frozen!  After six months and at least a dozen "clear all tracks" re-works, switching the WDC chips from PDIPs to PLCCs to QFPs, changing all the TTLs and passives to SMT and a myriad other second-guessings and but-what-ifs, first light is in sight.

The board's ID block

The board has 1 ACIA (the serial console, as socketed PLCC), 3 VIAs (2 general pupose, and one "internal" for the LCD character display - as QFPs), and support chips to cover power, reset, PROM select, and IO select.  There are 5 DB9 serial ports and 2 DB25 connectors providing access to the general pupose VIAs.  ACIAs (with MAX232s) are available on "Serial Twin" daughter boards, and the system "core" is provided by a mezzanine board.

PROM and IO select signals, as well as IRQ lines for integrated peripherals are available on headers.

The top of the board, favoring the rear IO
The board is powered by a standard 24-pin ATX-style connector, and has an ATX-style pin header to support power and reset switches, and a power LED.

The top of the board, favoring the front edge
If everything goes according to plan, I should be able to just drop this board into one of a handful of Mini-ITX cases I have around, and cook.

The "core mezzanine board" has already been designed, fabbed, and assembled, and I'm pretty sure it's good to go.  The "serial twins" cards have been fabbed, and I've assembled one of them, so that's a plus.
"Core mezzanine board" with EEPROM address decoding

"Serial Twins" card with 2 MAX232s and PLCC sockets for 2 W65C51s 


...so, now, it's off to review proofs, fix any issues, and then off to manufacturing!


The back of the board, favoring the rear IO


I'm planning on streaming the assembly of this board, as this will likely be quite the educational experience for me, and hopefully you can learn something too, or at least be entertained by my hamfisted efforts!  Check out the RIBBBITN3RDing YouTube channel - subscribe and click the notify bell if you'd like to catch the streams live.  Eventually, I plan to edit the assembly down to a single video with boring bots cut out and tedious soldering sped up... but that will likely take a while.



Tuesday, January 4, 2022

RIBBBIT65 On Mini-ITX: The Before Times

 RIBBBIT65 On Mini-ITX: The Before Times


I've been ruminating and mulling on the possibility of implementing the RIBBBIT65 in a Mini-ITX form factor.  My goal for this is to fit the "CORE" and SystemIO functionality in a Mini-ITX footprint, make use of rear panel IO and front panel lights and switches, and be supplied by a standard ATX power supply connector.

My first pass at the design study was arranging paper cutouts on a cardboard Mini-ITX sized blank.  I quickly discovered that I could not fit the myriad functions I wanted on a Mini-ITX board using PDIP ICs.  This was the impetus for trying to implement the address decoding using an EEPROM.  I then toyed with a few variations on the theme of mezzanine boards... putting the CORE and primary peripherals on the motherboard, and "secondary" peripherals on the mez... putting the main peripherals on the main board, and the CORE on a mez... I settled on putting the CORE on a mezzanine, in large part, because its conversation with the IO is isolated to 8 address lines, 8 data lines, and an AD line.  Sure, you need clock, RW, IRQ and so on... but... that simplifies routing immensely on the motherboard.  It also permits me to use the CORE mezzanine in other applications if I want/need.

Goals

My first goal was trying to make a CORE mezzanine board.  I figured making that fit on something I could stack on a Mini-ITX board would be something of an accomplishment.  It would also give me something solid and tangible I could design against.


PotatoCam view of r0.1 of the CORE mezzanine card
for the RIBBBIT65 Mini-ITX 

KiCAD 3D render of in-progress r0.1 of the
RIBBBIT65 Mini-ITX Motherboard

Above is my second layout of the RIBBBIT65 Mini-ITX, and I think this might be the best I can do under the circumstances.  I don't know if this version of the RIBBBIT65 Mini-ITX is ever going to go to manufacturing. There's just so many compromises. I wanted to at least do a PCB layout to get a sense of the issues I was facing. I may send it out to manufacturing just to validate the integration... work out any bugs before I switch to PLCCs and SMT, but I really think PLCCs for the WDC chips and SMT for the passives and jellybean logic is going to have to be the way forward for the Mini-ITX form factor if I'm going to fit everything I want on there.

The journey continues...


Wednesday, December 15, 2021

CrapDASM Demo (et al) Video!

Just posted a new video to the YouTube channel -- Mostly covers the CrapDASM disassembler.  



One thing I didn't mention (because I forgot in the moment) among the things I want to fix/improve on the CrapDASM (and, yeah, I think that's going to be the name) is "decorations" for the mnemonics.  For example,  indicating vectors, indexed offsets, and stuff like that.  Right now, you can't just take the disassembler output, type it into an assembler, and go...  and while that may never actually be a thing, I'd like to get a little closer to understanding what's going on by reading the disassembler output.  Decorations are distinct based on opcode, and there is a finite and small list of decorations (basically one for each addressing mode).  

I also discovered (after posting the video) and issue with the routine that increments the the vector to the current OpCode.  Moar debugging!

Anyway,  progress is being made, so, hooray!

Sunday, December 12, 2021

Avengers! Disassemble!

 

Disassembler, disassemble yourself!

So, I thought it would be a good exercise to write a disassembler for the RIBBBIT65.  My plan is to integrate this into the CoreROM, but I have a few fixes and tweaks I want to do first.  As it is now, this starts as $1000 and references some constants and code in the CoreROM (e.g. CIOH), so, unfortunately, this won't really output anything without that, but you could stuff your own output routines in there if you were so inclined.  

...and, yes, I realize there's a bunch of stuff in here that's redundant... and some hard-coded addresses (rather than constants)... but I thought it might be nice to get something out there.

Originally, I had written this with its own "private" buffer, that it would then copy to the CIOH output buffer, but then I realized that was dumb, and just made this write directly to the CIOH output buffer.  Unfortunately, there are still some vestiges of the "private buffer" business in here (constants and such).

Anyway... here it is.

; START BNW CONSTANTS
DBUTIL0 = $50
DBUTIL1 = $51
DBUTIL2 = $52
DBUTIL3 = $53
DBUTIL4 = $54
VWMSGSYS = $0090  ; System Message Vector
VWMSGPRG = $0092  ; Program Message Vector
VWMSGSPC = $0094  ; Special Message Vector
DBCPBTERM = $6237  ; Current Peripheral Buffer Terminate Value
CBSERBRDM = $6238  ; Serial Baud Rate Delay MultiplierDFCLCDLB0 = $6d00  ; Character LCD Line Buffer 0
DFCLCDLB1 = $6d30  ; Character LCD Line Buffer 1
DFCLCDLB2 = $6d60  ; Character LCD Line Buffer 2
DFCLCDLB3 = $6d90  ; Character LCD Line Buffer 3
DFCLCDLB4 = $6dc0  ; Character LCD Line Buffer 4
pfciohobufappendbytestart = $b264 ;EXPR(45668=0xb264) ABS 
pfsetcurpstart = $b1c0 ; EXPR(45504=0xb1c0) ABS 
pfciohstdentry = $b27f ; EXPR(45695=0xb27f) ABS 
pfciohobufinitstart = $b23d ; EXPR(45629=0xb23d) ABS 
; END BNW CONSTANTS


VWLDASMSTARTVEC = $b0   ; Vector to beginning of space to disassemble
VWLDASMENDVEC = $b2     ; Vector to end of space to disassemble
VWLDASMCUROCVEC = $b4   ; Vector to the current "working" OpCode
DBLDASMOBWP = $ba       ; Output Buffer Write Pointer (offset)
DBLDASMOBRP = $bb       ; Output Buffer Read Pointer (offset)
DBLDASMOCVINCCNT = $bc  ; Number of times to increment VWLDASMCUROCVEC
DBLDASMDONEFLG = $bd    ; Done Flag -- Anything other than $00 means done
DBLDASOCWRKCPY = $be    ; Working copy of the current OpCode





DBBTHSRC = $21
;DWBTHRES = $22
DWBTHRES = $72
PFBYTETOASCII = $e14f

;BTHRESL EXPR(115=0x73) EQU 
;BTHRESH EXPR(114=0x72) EQU

    .org $1000
pfbdasmentry:

    ;;;; Tell the CLCD we're streaking
    lda #<$c200 ; dfr65msg001 ; $c200 ; dfr65msg001
    sta $0090 ; VWMSGSYS ; $0090 ; VWMSGSYS
    lda #>$c200 ; dfr65msg001 ; $c200 ; dfr65msg001
    sta $0090 + 1 ; VWMSGSYS + 1 ; $0090 + 1 ; VWMSGSYS + 1
    lda #pfbdasmclcdmsg ; twmesg   ;;;;   <<<======LOCAL MESSAGE
    sta $0092 + 1 ; VWMSGPRG + 1 ; $0092 + 1 ; VWMSGPRG + 1
    jsr $ce17 ; pflcd162spmsgtobufstart ; $ce17 ; pflcd162spmsgtobufstart
    jsr $bd00 ; pfclcd162l1bufstart ; $bd00 ; pfclcd162l1bufstart
    
    
    ;; INITIALIZE THE THINGS
    lda #$00
    sta DBLDASMDONEFLG
    clc
    lda VWLDASMSTARTVEC
    sta VWLDASMCUROCVEC
    lda VWLDASMSTARTVEC + 1
    sta VWLDASMCUROCVEC + 1
    
    jsr pfbdasmserportinit
    
;;;; HERE BEGINS THE BIG OUTER LOOP
pfbdasmmainlooptop:

    ;; Save a working copy of the current OpCode
    ldy #$00                  ; Copy the Current OC Vector to "Working Copy"
    lda (VWLDASMCUROCVEC),y
    sta DBLDASOCWRKCPY
    
    ; Initialize the things
    lda #$00
    sta DBLDASMOBWP       ; Output Buffer Write Pointer (offset)
    sta DBLDASMOBRP       ; Output Buffer Read Pointer (offset)
    
    ; Clear the Output Buffer
    jsr pfciohobufinitstart

    ; Call the POC Disassembler
    jsr pfpocdasmentry
    
    ; Write the Serial Buffer out to the port
    jsr pfbdasmserportwrite
    
    ;;; Increment the "Current OpCode Vector" the correct number of 
    ;;; times for the "length" of the OpCode
    jsr pfbdasmcurocvecincstart

    lda DBLDASMDONEFLG        ; Get the "DONE" flag
    cmp #$00                  ; $00 == Keep going
    bne pfbdasmexit           ; Bail out if != 0
    
    jmp pfbdasmmainlooptop
    
pfbdasmexit:
    rts
    
    
    
    
    
;;;;;; INITIALIZE THE SERIAL PORT
pfbdasmserportinit:
    ; preserve the registers
    pha
    txa
    pha
    tya
    pha
    ; Initialize the SIO4 device
    ;; Set baud rate write delay
    lda #$08
    sta CBSERBRDM ; CBSERBRDM
    ;; Set terminate character
    lda #$00
    sta DBCPBTERM ; DBCPBTERM
    ;lda #$04 ;;; 
    lda #$05
    jsr pfsetcurpstart
    lda #$10
    jsr pfciohstdentry
    ;restore the registers
    pla
    tay
    pla
    tax
    pla
    rts


;;;;;; WRITE TO THE SERIAL PORT
pfbdasmserportwrite:
    ;;;; START WRITE TO SERIAL PORT MAYBE
    ; Preserve the registers
    pha
    tya
    pha
    txa
    pha
    
    ;lda #$04 ;;;;
    lda #$05
    jsr pfsetcurpstart
    lda #$62
    jsr pfciohstdentry
        
    ;;;; END WRITE TO SERIAL PORT MAYBE
    ; Restore the registers
    pla
    tax
    pla
    tay
    pla
    rts

;;;;;;;;NEW INCREMENT CURRENT OPCODE VECTOR
pfbdasmcurocvecincstart:
    pha
    txa
    pha
    tya
    pha
    
    ldy DBLDASOCWRKCPY
    lda dfopcdarglut,y
    sta DBUTIL3 ; TMP copy of OpCode length
    ; Get the c lsb
    lda VWLDASMCUROCVEC
    ; eor with $ff to see how many steps til carry
    eor #$ff
    sta DBUTIL4 ; tmp holding spot for "steps til carry"
    lda DBUTIL4
    cmp DBUTIL3 ; compare with opcode length
    bcs pfbdasmcurocvecincinclsbonly ; no carry expected
    lda DBUTIL3 ; Opcode Length
    sbc DBUTIL4 ; tmp holding spot for "steps til carry"
    sta VWLDASMCUROCVEC
    clc
    lda VWLDASMCUROCVEC + 1
    adc #$01
    sta VWLDASMCUROCVEC + 1
    jmp pfbdasmcurocvecinccheckgt
    nop
    
pfbdasmcurocvecincinclsbonly:
    clc
    lda VWLDASMCUROCVEC
    adc DBUTIL3
    sta VWLDASMCUROCVEC
    nop
  
pfbdasmcurocvecinccheckgt:
    lda VWLDASMCUROCVEC + 1  ; 80
    cmp VWLDASMENDVEC + 1  ; 80
    beq pfbdasmcurocvecincchecklsbgt
    bmi pfbdasmcurocvecincdonedone
    bpl pfbdasmcurocvecincoverflow
pfbdasmcurocvecincchecklsbgt:
    lda VWLDASMCUROCVEC
    cmp VWLDASMENDVEC
    bmi pfbdasmcurocvecincdonedone
    nop

pfbdasmcurocvecincoverflow:
    lda #$ff
    sta DBLDASMDONEFLG
    nop

pfbdasmcurocvecincdonedone:    
    pla
    tay
    pla
    tax
    pla
    rts
    nop
    nop
    nop
    nop
;;;;;;;;;;END NEW INCREMENT CURRENT OPCODE VECTOR

;;;;;;; START "PROOF OF CONCEPT" DISASSEMBLER
    ;.org $1800
pfpocdasmentry:
    ;  Preserve the registers
    pha
    txa
    pha
    tya
    pha 
    
    ldy #$00
    lda (VWLDASMCUROCVEC),y  ; Load the OpCode at the "Current OpCode Vector"
    sta $0600                ; Store the OpCode in $0600
    tay                      ; Move the OpcCode to rY
    lda dfopcdmnemlut,y      ; Load the Mnemonic Offset from the lookup table
    sta $0601                ; Store the Mnemonic Offset in $0601
    lda dfopcdarglut,y       ; Load the Arg Count from the lookup table
    sta $0602                ; Store the Arg Count in $0602
    lda #$00                 ; Set the "Working Arg" to #$00
    sta $0603                ; Store the "Working Arg" to $0603
    lda #$00
    sta $0604                ; Out Buff Offset
        
    ;; We're going to put an output string in RAM, starting at $06010
    ;; First, post the current address
    lda VWLDASMCUROCVEC + 1
    jsr PFBYTETOASCII
    lda DWBTHRES ; 72
    jsr pfciohobufappendbytestart
    lda DWBTHRES + 1 ; 73
    jsr pfciohobufappendbytestart
    
    lda VWLDASMCUROCVEC + 0
    jsr PFBYTETOASCII
    lda DWBTHRES ; 72
    jsr pfciohobufappendbytestart
    lda DWBTHRES + 1 ; 73
    jsr pfciohobufappendbytestart
    
    lda #$3a ; ":"
    jsr pfciohobufappendbytestart
    lda #$20 ; " "
    jsr pfciohobufappendbytestart
    
    ;; Second, copy the Nmemonic
    lda $0601
    tay
    lda dfmnemreflut,y
    jsr pfciohobufappendbytestart
    iny
    lda dfmnemreflut,y
    jsr pfciohobufappendbytestart
    iny
    lda dfmnemreflut,y
    jsr pfciohobufappendbytestart
    ;;
    ;; We would put a decoration here if appropriate
    ;;
    ;; Add a space
    lda #$20
    jsr pfciohobufappendbytestart
    
    ;;
    ;; Convert the OpCode to ASCII Hex
    ldy #$00
    lda (VWLDASMCUROCVEC),y
    sta DBBTHSRC
    jsr PFBYTETOASCII
    lda DWBTHRES ; 72
    jsr pfciohobufappendbytestart
    lda DWBTHRES + 1 ; 73
    jsr pfciohobufappendbytestart
    ;;
    ;; Add a space
    lda #$20
    jsr pfciohobufappendbytestart

    ldy #$01 
pfpocdasmarglooptop:
    cpy $0602 ; If we're already at the "length" value, dump out.
    beq pfpocdasmdone
    
    ;; FIRST ARG
    lda (VWLDASMCUROCVEC),y
    sta DBBTHSRC
    jsr PFBYTETOASCII
    lda DWBTHRES ; 72
    jsr pfciohobufappendbytestart
    lda DWBTHRES + 1 ; 73
    jsr pfciohobufappendbytestart
    lda #$20
    jsr pfciohobufappendbytestart
    
    ;; SECOND ARG
    iny
    cpy $0602 ; If we're already at the "length" value, dump out.
    beq pfpocdasmdone
    lda (VWLDASMCUROCVEC),y
    sta DBBTHSRC
    jsr PFBYTETOASCII
    lda DWBTHRES ; 72
    jsr pfciohobufappendbytestart
    lda DWBTHRES + 1 ; 73
    jsr pfciohobufappendbytestart
    lda #$20
    jsr pfciohobufappendbytestart
    
    ;; THIRD ARG
    iny
    cpy $0602 ; If we're already at the "length" value, dump out.
    beq pfpocdasmdone
    lda (VWLDASMCUROCVEC),y
    sta DBBTHSRC
    jsr PFBYTETOASCII
    lda DWBTHRES ; 72
    jsr pfciohobufappendbytestart
    lda DWBTHRES + 1 ; 73
    jsr pfciohobufappendbytestart
    lda #$20
    jsr pfciohobufappendbytestart
    
pfpocdasmdone:
    lda #$0d
    jsr pfciohobufappendbytestart
    lda #$0a
    jsr pfciohobufappendbytestart
    lda #$00
    jsr pfciohobufappendbytestart
    lda #$ea
    jsr pfciohobufappendbytestart
    ; Restore the registers
    pla
    tay
    pla
    tax
    pla
    
    rts
    
;;;;;;; END "PROOF OF CONCEPT" DISASSEMBLER

pfbdasmclcdmsg:
    ;.asciiz "P: R65 DisASM"
    .asciiz "P: R65 CrapDASM"
    
    .byte $00,$00,$00,$00, $00,$00,$00,$00, $00,$00,$00,$00, $00,$00,$00,$00
    .asciiz "DEADBEEFdeadbeef"




; Lookup Tabels:  
;   Opcode to Mnemonic Lookup (dfopcdmnemlut)
;   Opcode to Arg Count Lookup
;   Mnemonic Reference (dfmnemreflut)

    .org $2000


;;;;; MNEMONIC BY OPCODE LOOKUP TABLE
; OpCodes are one byte each.
; OpCode is offset from start of table
; Value at offset is offset from start of dfmnemreflut containinf the Mnemonic
dfopcdmnemlut:
    .byte $30,$84,$f0,$f0,$f0,$84,$08,$f0,$d0,$84,$08,$f0,$f0,$84,$08,$f0
    .byte $10,$84,$f0,$f0,$f0,$84,$08,$f0,$48,$84,$f0,$f0,$f0,$84,$08,$f0
    .byte $6c,$04,$f0,$f0,$0c,$04,$a8,$f0,$d4,$04,$a8,$f0,$0c,$04,$a8,$f0
    .byte $f0,$04,$f0,$f0,$f0,$04,$a8,$f0,$4c,$04,$f0,$f0,$f0,$04,$a8,$f0
    .byte $b0,$44,$f0,$f0,$f0,$44,$7c,$f0,$c8,$44,$7c,$f0,$68,$44,$7c,$f0
    .byte $18,$44,$f0,$f0,$f0,$44,$7c,$f0,$50,$44,$f0,$f0,$f0,$44,$7c,$f0
    .byte $b4,$00,$f0,$f0,$f0,$00,$ac,$f0,$cc,$00,$ac,$f0,$68,$00,$ac,$f0
    .byte $1c,$00,$f0,$f0,$f0,$00,$ac,$f0,$54,$00,$f0,$f0,$f0,$00,$ac,$f0
    .byte $f0,$bc,$f0,$f0,$dc,$bc,$d8,$f0,$a0,$f0,$8c,$f0,$dc,$bc,$d8,$f0
    .byte $20,$bc,$f0,$f0,$dc,$bc,$d8,$f0,$9c,$bc,$c0,$f0,$f0,$bc,$f0,$f0
    .byte $78,$70,$74,$f0,$78,$70,$74,$f0,$98,$70,$88,$f0,$78,$70,$74,$f0
    .byte $24,$70,$f0,$f0,$78,$70,$74,$f0,$58,$f0,$c4,$f0,$78,$70,$74,$f0
    .byte $3c,$34,$f0,$f0,$3c,$34,$40,$f0,$a4,$34,$90,$f0,$f0,$34,$40,$f0
    .byte $28,$34,$f0,$f0,$f0,$34,$40,$f0,$5c,$34,$f0,$f0,$f0,$34,$40,$f0
    .byte $38,$b8,$f0,$f0,$38,$b8,$64,$f0,$94,$b8,$80,$f0,$f0,$b8,$64,$f0
    .byte $2c,$b8,$f0,$f0,$f0,$b8,$64,$f0,$60,$b8,$f0,$f0,$f0,$b8,$64,$f0

;;;;; ARGUMENT COUNT BY OPCODE LOOKUP TABLE
; OpCodes are one byte each.
; OpCode is offset from start of table
; Value at offset is number of additional bytes to read for this OpCode
dfopcdarglut:
    .byte $01,$02,$00,$00,$00,$02,$02,$00,$01,$02,$01,$00,$00,$03,$03,$00
    .byte $02,$02,$00,$00,$00,$02,$02,$00,$01,$03,$00,$00,$00,$03,$03,$00
    .byte $03,$02,$00,$00,$02,$03,$02,$00,$01,$02,$01,$00,$03,$03,$03,$00
    .byte $00,$02,$00,$00,$00,$02,$02,$00,$01,$03,$00,$00,$00,$03,$03,$00
    .byte $01,$02,$00,$00,$00,$02,$02,$00,$01,$02,$01,$00,$03,$04,$03,$00
    .byte $02,$02,$00,$00,$00,$02,$02,$00,$01,$03,$00,$00,$00,$03,$03,$00
    .byte $01,$02,$00,$00,$00,$02,$02,$00,$01,$02,$01,$00,$03,$03,$03,$00
    .byte $02,$02,$00,$00,$00,$02,$02,$00,$01,$03,$00,$00,$00,$03,$03,$00
    .byte $00,$02,$00,$00,$02,$02,$02,$00,$01,$00,$01,$00,$03,$03,$03,$00
    .byte $02,$02,$00,$00,$02,$02,$02,$00,$01,$03,$01,$00,$00,$03,$00,$00
    .byte $02,$02,$02,$00,$02,$02,$02,$00,$01,$02,$01,$00,$03,$03,$03,$00
    .byte $02,$02,$00,$00,$02,$02,$02,$00,$01,$00,$01,$00,$03,$03,$03,$00
    .byte $02,$02,$00,$00,$02,$03,$02,$00,$01,$02,$01,$00,$00,$03,$03,$00
    .byte $02,$02,$00,$00,$00,$02,$02,$00,$01,$03,$00,$00,$00,$03,$04,$00
    .byte $02,$02,$00,$00,$02,$02,$02,$00,$01,$02,$01,$00,$00,$03,$03,$00
    .byte $02,$02,$00,$00,$00,$02,$02,$00,$01,$03,$00,$00,$00,$03,$03,$00

;;;;; MNEMONIC TEXT LOOKUP TABLE
; Mnemonics are all 4 bytes long - 3 character and a NUL ($00) terminator
dfmnemreflut:
    .byte $41,$44,$43,$00,$41,$4e,$44,$00,$41,$53,$4c,$00,$42,$49,$54,$00
    .byte $42,$50,$4c,$00,$42,$4d,$49,$00,$42,$56,$43,$00,$42,$56,$53,$00
    .byte $42,$43,$43,$00,$42,$43,$53,$00,$42,$4e,$45,$00,$42,$45,$51,$00
    .byte $42,$52,$4b,$00,$43,$4d,$50,$00,$43,$50,$58,$00,$43,$50,$59,$00
    .byte $44,$45,$43,$00,$45,$4f,$52,$00,$43,$4c,$43,$00,$53,$45,$43,$00
    .byte $43,$4c,$49,$00,$53,$45,$49,$00,$43,$4c,$56,$00,$43,$4c,$44,$00
    .byte $53,$45,$44,$00,$49,$4e,$43,$00,$4a,$4d,$50,$00,$4a,$53,$52,$00
    .byte $4c,$44,$41,$00,$4c,$44,$58,$00,$4c,$44,$59,$00,$4c,$53,$52,$00
    .byte $4e,$4f,$50,$00,$4f,$52,$41,$00,$54,$41,$58,$00,$54,$58,$41,$00
    .byte $44,$45,$58,$00,$49,$4e,$58,$00,$54,$41,$59,$00,$54,$59,$41,$00
    .byte $44,$45,$59,$00,$49,$4e,$59,$00,$52,$4f,$4c,$00,$52,$4f,$52,$00
    .byte $52,$54,$49,$00,$52,$54,$53,$00,$53,$42,$43,$00,$53,$54,$41,$00
    .byte $54,$58,$53,$00,$54,$53,$58,$00,$50,$48,$41,$00,$50,$4c,$41,$00
    .byte $50,$48,$50,$00,$50,$4c,$50,$00,$53,$54,$58,$00,$53,$54,$59,$00
    .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
    .byte $3f,$3f,$3f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00


...and that's all I have to say about that.

Thursday, December 9, 2021

Updates, Distractions, and Failures

 Updates, Distractions, and Failures

I dropped my phone over the last weekend and spidered the screen.  That was a disappointing failure.  New phone should be arriving today.  Apologies for the potato photos that follow.

PCB Update

I put in an order for 4 new boards weekend before last, and they showed up this past Tuesday, which was cool.  In that order were:

  • COREplus r0.2
  • SystemIO r0.2
  • ITX CORE Daughter Card (a.k.a. the CORE Mezzanine) r0.1
  • ATX Power Adapter/Switcher r0.1

New boards!

All the boards arrived, and appear to be manufactured as designed.  That's good.  Thanks, JLCPCB!

I assembled one of the COREplus r0.2 boards, and it works.  Power-on Reset works without bodges, and the blinkenlights work.  So, that's good.

COREplus r0.2 - BLINKENLIGHTS!

I did some continuity checks on the SystemIO r0.2, and it turns out I messed that up.  The silkscreen issue with the "future peripherals" headers has been resolved, which is great, but it looks like I messed up on the RS-232 fixes, so all 5 ports still have the reveresed TXD and RXD lines between the MAX232s and the respective DB9 connectors.  I DID fix the problem in the schematic, but, apparently, I got distracted and never updated the PCB in KiCAD.  That has been remedied, and so, in r0.3, there should be no bodges required (for that, at least).  A mistake I hope never to make again.

I assembled one of the ITX CORE Daughter Card r0.1 boards, and it appears to be working-ish... the CPU, RAM, and ROM are all appearing to do stuff.  ...that is, once I put the clock oscillator in the right way (after cooking 3 of them -- not my proudest moment).  Unfortunately, hooking up a Jenny-O with the 6551 daughter card is, so far, not yielding communication.  I'm investigating.

ITX CORE Daughter Card r0.1 - Can it be saved?

I have not yet assembled the ATX Power Adapter/Switcher r0.1.  Might get stuck in to that this week.  It is not my highest priority at the moment.

CoreROM update

I've been working on a disassembler for inclusion in the CoreROM.  The way it would work is you put a start address and an end address in some special spot in RAM, and it will pick out the opcodes, match them to the mnemonics, recognize how many arguments that opcode should have, see if there's any "decoration" (like ",Y" or ",X" or " A"), and display the mnemonic, the decoration (if any), the opcode and the arguments (if any).  This has been slow going.  Putting together the lookup tables to get the opcodes and argument counts manually was a total pain, and I think I messed it up.  I went back to the drawing board, and wrote a Python tool to build the lookup tables.  That seems to have worked a treat, but I think I'm having a problem with a subroutine call maybe nuking a register somewhere along the way.  Debugging continues.

RIBBBIT65 ITX update

As I was poking around on DigiKey and Mouser, I found IO connectors I think I'm going to use, which is good.  I'm looking at double-stacked DB9Fs for the general purpose RS-232s, a single DB9M for the console, and double-stacked DB25Fs for the 2 general purpose VIAs.  While I was on Mouser's site, I discovered that they sell WDC's product line -- like the whole thing, apparently.  Looks like they have the W65C02, W65C22, and W65C51 in PLCC.  I poked around a little more, and discovered that, even in THT sockets, they are quite a bit smaller than the DIP40s and DIP28s I've been using so far.  I can fit almost 3 PLCC44s in the space of one DIP40 (in terms of board real estate).  If I go that route for the WDC chips and the EEPROMs, and SMT for the MAX323s and RAM, I might be able to fit the CORE and SystemIO on one MiniITX board.  It will certainly be more expensive than using dual-wipe sockets on DIP chips as I have been so far, but in a Mini-ITX form factor, that might be excusable.  I'd probably have to do a mezzanine card for the "Pageable ROM" and maybe a 3.5" External Bay thingy (prolly 3D printed) for the Cartridge Slot as options, but that's still pretty cool.  I'd be curious to hear your thoughts.

So, as of early December, that's where we are.


Sunday, December 5, 2021

RIBBBIT65: Why Is?

RIBBBIT65: Why Is?

The RIBBBIT65_COREplus

First and foremost, the RIBBBIT65 is an autodidactic exercise, wherein I learn how computers work at the "machine language and bus signal" level.

You see, I was at just about the right age to be in the target demographic when home computers started taking off -- the late '70s, early '80s.  It was really neat.  A friend of mine who was very, very smart, and was fortunate enough to have positive and encouraging parents, got a computer... I think it was for Christmas... an Atari 400.  ...and I was *fascinated*.  He got really, really good with the programming... so much so that he'd started not just writing little machine language subroutines that he'd call from BASIC... no.  He got an Assembler/Editor cartridge and was writing whole programs in Assembly.  At this point I had no computer.  I would shoulder surf and he'd show me programs he'd written in BASIC, and I could kinda make sense of them.  I could *get* BASIC.  I could probably make a computer do things.  

Well, another Christmas, another computer.  I don't recall if it was the *next* Christmas, but it wasn't long after the Atari 400 hundred showed up, that his parents had gotten him an Atari 800 (With a floppy drive!) as an upgrade, since he'd outgrown the 400.  I mean, fine... anyone could outgrow 16K or RAM... but 48K?  I'd like to see you try.  Well, his 400 found its way to the basement of their house and stayed there for a while.  

At this time, I was more or less a fixture at their house (I was more ubiquitous than the paint on the walls), and we would often play in their basement (because... outside?  what's that?!).  On the way down and on the way up, I would see that Atari 400 sitting there... unused.  Lonely.  Finally, I got up the nerve (and scraped together a little cash) and asked my friend's dad if I could buy the old 400...with its cassette drive.  $30 later, it was mine.  

Soon, I was writing BASIC like a banshee.... I guess.  I don't know much about banshees.  Anyway, I was printing, "Hello world" on the screen and flashing colors and doing all sorts of basic stuff.  It was neat.  ...but there was something about sprites and machine language that made them.... beyond me... somehow.  Maybe it was the fact that Atari BASIC supported them, kinda, but I didn't really get a good idea of the how of it.  I don't know if it was a cognitive thing or a psychological thing... but my young thinkymeat was having none of it.

Time and a half went by, and I'd upgraded my rig to an Atari 800XL with a floppy drive, and I was doing some cool stuff with that, but I never really got into Assembly.  Eventually, I made the leap into PCs.  That was 1991, and I've been getting farther and farther from the bare metal ever since.

In the intervening years, I've actually settled into a career in IT.  I've become a Linux nerd.  I've picked up several languages, but in the back of my mind, there was a little bugaboo; a tiny voice in the dark, telling me I didn't really get it.  ...not really.  It was that sad little 400 in the basement.

In 2016, not long after starting a job with a 3-hour round-trip commute by rail, I decided I would undertake a project to "get" machine language.  I decided I would write a CPU emulator.  Strictly speaking, it ended up being more of a "machine language interpreter"... but, it worked.  I wrote a monitor program (in bare Z80 machine language... not Assembly.... the actual opcodes) that was a little under 2K.  Why yes, the train was a terrible soul-crushing thing.

I got a couple "retro computer" type kits, and they were neat, but there was always something lurking in the background.... telling me I didn't really get it.  ...not really.  Most of these machines, like the RC2014, are kinda limited in scope, and while others have done cool expansions to them, I was hitting a roadblock.  The "working" part of the system was a sort of barrier.  For fear of breaking what worked, I didn't dare muck about.

Then, in 2020, I caught wind of Ben Eater's excellent series of videos about building a 6502-based computer from the ground, up.  Like Sir Robin at the Bridge of Death, after seeing Galahad's triumph, I thought, "This is something I could do."  I ordered Ben's 6502 kit, and got cracking.  I was having some trouble keeping all the wiring straight on the breadboards, and I was getting frustrated... I didn't know whether the problem was my wiring, the breadboards, or faulty parts.  From a number of sources, I'd become aware that there was a decent Open Source "Electronic Design Aid" -- KiCAD, and there were board houses out there that could do low-cost prototype manufacturing... so I put ham and cheese together, and went about re-implementing Ben Eater's design in KiCAD, and getting some boards made.  After finding and fixing the error I'd made on the board (there's always one, isn't there?), it was great.  I could actually do things.  I could write programs in Assembly, burn them to an EEPROM, and they'd actually work.

At this point, I'd arrived at the same sort of frustrating point I was at with the "retro computer" kits.  If I was going to move forward, I'd have to take the risk of wrecking it.  But, there was one significant difference.  I had made everything that worked, and I had spares.

I was finally free to think creatively and solve problems (which, I readily admit, had been solved countless times before, far more elegantly, by numberless people).  Like so many other projects which had engaged and held my interest, I had a basic set of essentially indestructible tools, a practically limitless supply of resources, and only the laws of physics to constrain me.  I could play.  I could try things out.  I could fail.  

So, I thought about the itches that needed scratching.

One thing that bothered me about the commercially-available "home computers" was that they were kind of closed black boxes.  Between FCC regulations, product safety regulations, building down to a cost, and various other pressures, machines like the Atari 8-bits, and the Commodores were kind of closed off and inaccessible to me.  Here's your feature set.  Like it.  The Apple ][ seemed more open, but was obscenely expensive, and, therefore, off-limits.  Many of the retro kits were even more constrained.

I wanted a lab computer.  Something I could pull apart and rejigger as I saw fit, to serve whatever purpose I had in the moment.  I wanted a machine that would afford me a lot of IO possibilities, because who knows what I might want to do with it?  Something like one of those old Radio Shack "hundred and one electronic projects" kits, but not lame.  I decided it should have a good, broad set of base peripherals - A console, some serial ports, a couple VIAs, I2C and SPI, storage, so that you could stand up a really usable computer... or pare it back if need be, to save space or power, or whatever. I also thought it should have some expand ability so an end user could put in whatever they want.

I wanted to go through the process of building up an operating system.  What kind of masochist would subject himself to such a thing?  This kind, apparently.  Device drivers, APIs and so on.  I wanted to build those things, so I could really understand what's going on under the hood.

People have asked me about graphics and sound and what games I want to be able to play on it.  For me, the goal is not to play games on the RIBBBIT65.  I have a Nintendo Switch Lite for that.  The RIBBBIT65 *is* the game.

So, today, the RIBBBIT65 is on its way.  I have a good, stable core machine, and an IO platform on which to build something useful.  I have a decent Monitor program, and I'm working on an IO handler to abstract the various underlying peripherals.  There are design aspects which folks have told me remind them of the BBC Micro, which I suppose is flattering, as that's a highly-regarded machine for its time.  

I have a plan to do a version of the RIBBBIT65 in a Mini-ITX form-factor to allow more "hands off" use of the machine, as well as unifying a "bench-top" version, where the guts are all accessible, but it mechanically fits together better than the boards I've done so far.

I'm thinking of doing a hand-held "pendant"-style console device for interacting with the R65 Monitor, with, say, a 24-key keyboard, and either a character LCD or 7-segment LEDs to show addresses and data bytes.  It would speak a stripped down dialect of the monitor command set (for example, "page dump" wouldn't really work on a 6-digit LED)

I'm not just building a computer, I'm finally building understanding.  The RIBBBIT65 is on the verge of being a mere byproduct... an artifact whose significance lies in the research and trial and error that bought me the understanding to build it in the first place.  This is far more satisfying than any work I've done for money in the last 20 years.  It's certainly not for everyone.  But it is for me.


RIBBBIT65: What Is It?

RIBBBIT65: What Is It?

There are a lot of ideas out there in the world about what a computer should be, and what a computer should be able to do.

Certainly a computer should be able to execute specified commands in a specified order, retrieve and store data, and be able to perform arithmetic and logical operations on that data.  It should be able to accept some input, and provide some output.  Its execution of instructions should be able to be altered either by data values or input received.

Beyond that, the intended application goes a long way toward dictating what the specifications and requirements are which will drive the design.

So, what is the RIBBBIT65, beyond being a computer?  What kind of computer is it?

The RIBBBIT65 is an 8-bit microcomputer, based around the Western Design Center's W65C02 microprocessor family.

It is intended primarily as general purpose computer with an eye on learning.

The computing ecosystem is radically different today than it was when the MOS 6502 was first introduced in 1975.  Today, our computers have so much spare horsepower, we can emulate whole computer systems in our web browsers.  Almost everybody who could read this post has a computer of some kind and access to the Internet.  Today, you really don't need "the actual hardware" to enjoy a completely reasonable emulation or simulation of using old hardware, if that's your interest.

I'm not going to lie, though.  There are some of us, for whom the simulation is insufficient.  Some of us want to poke pins with probes.  Some of us want to talk to the CPU on its own terms.  There are some times when the simulation and the emulation are not what is needed.  Sometimes you actually need the hardware.

There are people out there who have done amazing work, re-implementing Commodore, Sinclair, and Atari systems with blends of new and old hardware, and I applaud their efforts.  Reverse-engineering a VIC-II or an ANTIC can't be an easy task.  For me, though, with each ASIC and ULA there is a definition of borders and an imposition of constraints.  With every piece of "other people's software" between me and the CPU, the machine itself becomes more diffuse and meaningless.  

I wanted a chance to work down on the bare iron, and stand up a computer.  A system.  I wanted the feeling of discovery and triumph that came from wrangling a box of rattly parts and wires into a working machine with peripherals and a workable but simple interface.  Something that would allow me to demonstrate, tame, and use most of the core functionality from the dawn of the microcomputer age.  

I have mixed feelings about things like floppy disks and CRT monitors.  Aesthetically, I find them appealing.  I like the idea of them -- the close relationship between the abstract and the concrete... between ethereal electrical fluctuations and real, physical phenomena.  Functionally, I feel they were good for their time, but I have no practical use for them today.

I had struggled for a long time with the conceptual leap required for me to grok machine language.  Ben Eater's "Hello World From Scratch" video straightened most of that out for me.  I finally saw a path to the kind of machine that interested me.

What kind of machine is that?  It's the RIBBBIT65, of course.

The RIBBBIT65 is a general purpose computer.  It's not a games machine or an industrial controller -- not by design, anyway.  Initially, I just wanted to make a board that would give me a good base-line 6502-based system that I could experiment with, that only required that I knew the 6502 itself, the basic layout of the memory map (e.g. where RAM, ROM, and IO are).

RIBBBIT65_COREplus

The RIBBBIT65_COREplus board satisfies that need for me.  It's got all the basic functionality, and conforms to a fairly straightforward model - 32K ROM, 32K RAM.  You want to do more with it, you can hang stuff off the bus.

The RIBBBIT65 CoreROM is currently in development, but at this stage, it has a working monitor program, and a framework for an abstracted IO handler and interrupt handler.  The CoreROM is divided into 4 8K segments, with one (the lowest 8K segment) being set aside as ROM that can be paged-in and -out as needed.

The RIBBBIT65 ROMxpander is still in early stages of development, but the intent is to provide 3 32K user-installable ROMs (intended to changed infrequently) which are each broken up into 4 8K segments, which can be paged in for the lower 8K of the CoreROM.  One possible application would be one ROM chip would contain up to 4 programming languages or tools, while another might contain up to 4 productivity tools.  The ROMxpander is also planned to accept an 8K "ROM cartridge" with the ability to quickly and easily switch ROM-based programs.

RIBBBIT65 SystemIO

The RIBBBIT65 SystemIO board provides a set of peripherals and related functionality to let the RIBBBIT65 interact with the world.  It has a serial console, which nearly all modern "retro-computer" kits have, but it also has 4 additional general purpose RS232 ports.  It has 2 general purpose W65C22 Versatile Interface Adapters, and a third for driving an LCD character display.  There are plans for storage devices, SPI & I2C adapters, and an interrupt controller to allow multiple devices to send interrupts to the CPU (provided the software is setupt to handle them properly).  Space has also been set aside for a "character addressable video display adapter" on the SystemIO bus, which could allow something on the order of Sinclair ZX Spectrum graphics, full-screen editing, and so on.

The RIBBBIT65 UserIO board is, at this stage, mostly just conceptual, but it is intended to leverage the SystemIO board, and provide an additional 16 ports for user-defined peripherals, with interrupt handling for upto 7 of them.

Finally, the RIBBBIT65-ITX (in development) is intended to provide a subset of RIBBBIT65 functionality in a Mini-ITX form factor to permit use in a variety of applications and settings, in an enclosure of the user's choosing, and connecting to industry standard ATX power and front-panel connections.

Caravan (Part 1) - A New Plan For A New Place

My partner and I are looking for a new place to be.  Being the computing-dependent nerd that I am, I want to be able to have all the service...