Showing posts with label PowerPC. Show all posts
Showing posts with label PowerPC. Show all posts

Sunday, April 10, 2016

Pimp My Quicksilver: Part V: PCI USB 2.0

With the CPU upgrade out of the way, I decided to step back and tackle a smaller upgrade.  I purchased a Syba SD-NECU2-5E1I 6-Port USB 2.0 PCI Card with NEC chipset, which as many of you may know are known to generally work really well with G4 and G5 PowerMacs running OS X. It cost me a whopping $6.29.

My particular 2002 Quicksilver only comes with 2 available USB 1.1 ports which happen to be on the backside. These 2 ports are about enough for just a keyboard and mouse. (Aside: Apple claims these were dual channel USB ports and with the 2 ports available on the included keyboard gave you a total of 4).  Of course you could probably connect an externally powered hub, but not only would you still be limited to the slow speeds (which would in fact be slower if all devices on the hub saturated the available bandwidth which had a theoretical maximum of 12 Mbits/s), but you would then likely end up dealing with other power-related connection issues from using a hub.

So for a couple of dollars I decided to make the jump to add some additional USB ports that were 2.0 to add additional connectivity choices in the future for such devices as flash drives, USB Bluetooth, external hard drives, charging my mobile devices, etc.  As I mentioned, the card I purchased had a total of 6 USB ports. There are 5 ports available on the outside and one port only available internally.  More on that in a moment. If 6 ports is too much for you, there are also 2 and 5 port variations available as well.

Installation was simple enough and a quick check from within both Debian and OS X gave me signs that the new card was recognized properly (I was not too worried).


Running lspci -v | grep NEC shows us the card is available and working in Debian.
0001:10:12.2 USB controller: NEC Corporation uPD72010x USB 2.0 Controller (rev 04) (prog-if 20 [EHCI])
    Subsystem: NEC Corporation uPD72010x USB 2.0 Controller
    Flags: bus master, medium devsel, latency 16, IRQ 52
    Memory at 80080000 (32-bit, non-prefetchable) [size=256]
    Capabilities: <access denied>
    Kernel driver in use: ehci-pci


Currently, the only 2 devices I have planned to plug into these newly available USB ports are a D-Link Bluetooth 2.0 USB adapter and a 1 TB Seagate External HD for backups. Here is a shot of the installed card.


As you can see from the photo, the 5th outside USB port on the end is nearly cut off from being accessible, but I am able to safely plug in most cables and devices without any issues.  Honestly, I would not have been too upset if I could not, as again, there would have still been 5 other USB ports available. I tested the ports out with an external HD, flash drive, keyboard, and mouse without any issues in either Debian or OS X Leopard.  My plan is to install the bluetooth adapter in the internal port as it is not a device i would need to be add/remove on a regularly frequent basis.

Wells that is all I am going to cover with this one. Kind of boring, but definitely a useful and worthwhile upgrade for any G4 PowerMac in my opinion.  If you would like to know about anything else regarding this upgrade, feel free to drop me a comment or shoot me an email. On a side note, each of the 4 PCI slots on this QS has a dedicated bus bandwidth of 33 MHz and is 64-bit, so I still have 3 left to fill at this point!

On the upgrade purchasing front, I have picked up a 430W Thermaltake TW2 Power Supply (may go higher Wattage in the future), a 20-24 pin Startech ATX adapter for the upgraded power supply connectivity, a couple of shorter 18mm blue SATA cables, a NF-F12 120mm Noctua Fan (read great things about these all over the web), and a Sonnet Tempo PCI Firewire card, which I will be covering next.  I  contacted the individual who used to make the QS ATX adapters, but he no longer has any available and is not interested in making any more unfortunately. That means I will be using the instructions on this page to try and create one myself.  No small feat, but I will try to make the most of it and use it as a needed learning opportunity.

Wednesday, April 22, 2015

An Applet a Day Keeps the Doctor Away

I'm subscribed to the Debian PPC mailing list (if you aren't yet, you definitely should be!) and recently read about a "new" Gnome (both a gtk2 and 3 version) battery menu applet for our PowerPC portables as well as a version of it that was ported to C.

You can read more about the applet here and the C code can be downloaded from Github here.  The version written in C is actually relatively straightforward code to read through. As another user mentioned, it is kind of cool to see how a menu applet can actually be written and works.

Once you've downloaded the zip file, unpack it by running the following command inside the folder where you downloaded the zip, such as your user profile's Downloads folder.
unzip mac-battery-applet-master-master.zip

Change directories into the unzipped folder and run:
make install

This should copy the Linux PPC executable to your /usr/local/bin folder so go ahead and type mac- and it should auto-complete the command to mac-battery-applet for you. Hit enter and you should see a small battery icon appear in your task bar/panel as can be seen from the screen shot below.


Hovering your mouse over the icon brings up a small pop-up of sorts that gives you the remaining estimated battery capacity and number of minutes of runtime until the battery is depleted.

Of course, you don't want to manually run this every time you reboot or power on your PPC laptop, so go ahead and add it to the necessary startup configuration for your desktop environment.  For LXDE, I added the line @mac-battery-applet to my autostart file located at /etc/xdg/lxsession/LXDE.

There are numerous battery icon files for showing the percentages of remaining capacity and they exist for both when the laptop is on battery power and when it is charging.  When the laptop is plugged in and charging a small + symbol appears on the upper right hand side.  A function called build_icon_file_name creates the necessary filename and it uses the code in files.c to construct the path for the corresponding file for that % of battery based on the built filename.   There is a lot more to it all, but pretty cool I think overall.  Some might prefer to have more granular results, but I think the 10% increment icons are an okay trade-off.  Ideally, I might do 5% increments, but that could become quite tedious when creating the icon files.  

Reading through the README, it says there is currently no Debian package for this applet, but the author states he would be more than willing to let someone else tackle that project. I've personally never done this, but perhaps it would be worth it to finally use it as a chance to learn all that does go into building a Debian package if it is even that much?  I've heard arguments on both sides.

Anyways, there is much more valuable information in the links I provided, including possible future updates to the applet, such as custom icon themes, so I encourage you to check those out. Did I mention this was done on a recently purchased 1.42 GHz G4 iBook? Yeah, I am stoked. I'm almost done with the memory upgrade and tests on the G4 QS.  Look for it in the next couple of days.

Sunday, February 22, 2015

The Time [Capsule] Machine

No posts for the past couple of weeks as I've been trying to track down an I/O error occuring on my OWC SSD, but that's a story for another day.  I'm positive it's the drives cable and not the drive itself.

Coincidentally, the errors started right after I had completed some configurations to mount my Apple Time Capsule as a CIFS volume on my Wheezy install, which happens to be the subject of this post.  About 5 or 6 years ago, my girlfriend (now my wife) and I invested in an 500 GB Time Capsule, model A1254, we could use to back up both of our Macs.  At the time, I only owned a white 2008 2.4 GHz Penryn MacBook (my first Mac) and had just started using it only a couple of months prior.  OS X Leopard had just come out and one of the major touted features was that of Time Machine; the quick and easy way to back up any Mac.  Because of those two reasons, we decided it would be useful to backup our more important school work.

Fast forward to present day, and I have since upgraded the drive in the Time Capsule (TC) from a 500 GB HD, to a 1TB, and eventually to a 2 TB 3.5" hard drive.  I'm having hard time remembering what brand I installed and the RPMs. I have also recently replaced the internal power supply as the Time Capsule finally kicked the bucket one day, but I had been expecting it as the handy little machine had been chugging nonstop 24/7 365 for almost 5 years.  The little guy is currently the backup device for my wife's iMac (she is a photographer), the backup for our MacBook Pro, and the backup for my OS X Leopard install on the G4 PowerBook.  It may seem like a bad idea having all of these eggs backups in one basket, but I also routinely make bootable clones of each of my systems using SuperDuper, a utility I know many are familiar with along with Carbon Copy Cloner.

If you don't currently own a Time Capsule, I'd encourage you to check them out as they can be quite useful in several different regards.  The first is that it can act as a networked storage device for storing your files or backups, create its own Wi-Fi network supporting even 802.11n (which was only in draft at the time) or bridge an existing Wi-Fi network and extend the signal by acting as another available access point (AP).  Other notable features include NAT firewall, MAC address filtering, and RADIUS authentication support. Some of the newer models obviously offer newer wireless protocols and features, but I'd save some cash and go with an older model such as the one we own.  Replacement parts are cheap and it is relatively straightforward to gain access to the Capsule's innards. I should also add it also contains a single USB port for you to attach yet another external drive and I currently have an external 1 TB Seagate attached to the USB port.  And last not but not least, it contains 3 Gigabit LAN ports and a single Gigabit WAN port for reliable wired connectivity. 

Anyways, I want to use it as a backup source for my Debian install as well. I haven't quite narrowed down what I want to deem worthy of backing up, but I'm positive it will consist of my etc directory as well as my home directory.  Eventually I'll look into what existing backup utilities are available and review them on this blog, but for now, I will write simple shell scripts to back up a few things I find important and necessary. I also plan to create a bootable clone of my Wheezy system onto an external HD.

After a bit of online research and light reading, I discovered the most common way of mounting the TC was using the Common Internet File System (CIFS), although mounting as an AFP share was possible as well if you installed the netatalk utility. I wanted to keep things fairly simple and since mounting it as a CIFS share was feasible without the need for installation and configuration of additional software, I went that route.  I should add here that another part of this set up is that I want access to the disk share to be secured via account authorization instead of having it freely available for anybody to mount and peruse.  In short we need to complete the following tasks:
  1. Set up an dedicated account for Debian to use for access
  2. Determine Time Capsule's IP Address or Hostname
  3. Mount the network share using the mount command.
  4. Optionally configure it to be mounted at startup
So let me describe the necessary steps to set this up using Apple's Airport Utility in OS X. I'll be doing this from Airport Utility v5.6.1, which also happens to be the last version made available to OS X Leopard.

  1. Select and authenticated with your Time Capsule as well as select the option to make changes (versus restoring the unit to factory settings).  
  2. Skip the option to change the TC's name and access password or change it if you feel the need
  3. The second screen you reach after hitting Continue is the place where you can edit and update your Time Capsule's disk sharing settings. Select the option to Change these settings.  Under the Secure Shared Disks: option, select the option With accounts from the drop down menu. 
  4. Now you should be able to click the + to add as many accounts as you would like.  For each account you should set the username, password, and set the account to have read and write access.  Obviously you can select the other available permissions as well if the need is there.
  5. Under the option, Airport Disk Guest Access, I'd recommend Not Allowed since you are taking the time to set up account based access.  
  6. From there, go ahead and click Continue repeatedly until you come across Finish where you can apply your changes to the Time Capsule.
Now that is out of the way we can work on actually mounting the share. Before we can do that though, we need to know the TC's IPv4 address or DNS hostname, which you can obtain using a number of different methods such as using Apple's Airport Configuration Utility in OS X, your router's DHCP table available from its web interface, or using a utility such as Angry IP Scanner.

Onto step 3.  As mentioned, we need to use the well known mount command to make the share available for use.  Now, there's a plethora of information available in this command's man pages, but eventually I constructed the following command:

sudo mount.cifs //192.168.66.7/Data /media/Backup -o username=MyUser,password=MyPass,uid=1000

Let's break this command down piece by piece so we're aware of exactly what it is accomplishing for us.
  • mount - the command keyword telling Debian we are wanting to mount another filesystem available via a directly attached device or network share
  • //192.168.66.7/Data - the IPv4 address and mount point of the share you created on your Time Capsule
  • /media/Backup - Destination folder for mounted share.  This could be anywhere you wanted, but I'd keep it either under /media or /mnt
  • cifs - tells the system the share is of type CIFS
  • -o - specifies you are providing an additional list of options
  • username= - the user created with access to the TC share
  • password= - password of the user above
  • uid= - sets the owner of the filesystem share.  In my case, I set it to 1000 as that is my user account id.
Last but not least, let's add the necessary addition to our /etc/fstab file so the new CIFS share is mounted automatically when the system boots.  A lot of what you see here is almost exactly what was used to originally mount the share, so no surprises here.  Note the / at the end of line 2.  Merely a means to indicate the command continues on the next line.

# Mount CIFS Backup Share
//192.168.66.7/Data /media/Backup /

cifs /username=MyUser,password=MyPassword,uid=1000 0 0

Save the changes and reboot to the awesomeness.

Simple enough am I right?  Luckily, there's a lot of documentation and other blog posts about this exact same topic, but hopefully all the information here helps you get the job done in one fell swoop.  If you want to make this work with your own Time Capsule and run into any issues, let me know and I'd be glad to help.  Given that my blog is dedicated to making the most out of our older aging hardware, I thought this would be an excellent way to continue using an older network storage device to store or backup your files for you on a still supported PPC OS.

I do have an update on the 1400 PB coming down the pipe.  And yes, the Clang post is coming too.  I'm just slow moving and always more nervous about posts regarding coding. :) Anyways, in the words of Joe Dirt, "Keep on keeping on."

Friday, December 19, 2014

Am I Getting Hot or Cold?

Yes. A post on monitoring your PowerBook's temperatures when running Debian or similar variations of Linux. As mentioned in a previous post, I am a big fan of Conky, which I utilize to show me several pieces of information regarding my PB and other PowerPC systems at any given time. Conky shows me such things as CPU, battery, and memory usage, as well as the capacities of each plus disk space usage across all partitions, up and down network statistics on all interfaces, and top process CPU consumers. I should note that right now, when completely idle with no GUI applications running, Conky states CPU is at 1%, which I see as very ideal. Usually it's Conky taking up a majority of that 1% of CPU.

The only thing I was missing was a way to monitor temperatures that are reported by the machine's included sensors. PowerPC portables have a history of running quite warm. Obtaining this same information in OS X is incredibly easy using a dashboard widget such as iStat Pro. Still being incredibly new to many things Linux and even PowerPC, I had to start doing a little bit of research to see if or where this information could be stored for retrieval. After perusing the different Conky options, I came to the conclusion that the desired information could not be natively retrieved using any existing Conky options as most deal with the (ugh) Intel architecture.  If I'm wrong, please let me know either through the comments belows or via email if you don't feel like publicly shaming me.

One way to start was to run the lsmod command, which would provide me with a list of loaded kernel modules.  One of those sure had to be doing something temperature/fan related?  Well, a few stuck out at me including, ic2-powermac, although it was not being used by anything, but I ran into this module when doing some research online.  The other one in particular was therm_adt746x, but again was not being used by any drivers. I'll be doing some more reading of these modules in the near future.

Luckily, I also discovered a couple of the sensors and output I could retrieve from various files under the /sys/devices/temperatures folder. I simply did a search of the file system using locate temperature. There were only two sensors listed along with a few other configuration files that I have yet to investigate any further.

For each sensor, there were 3 relevant text files (actually 4 for sensor1): sensor[#]_limit, sensor[#]_location, and sensor[#]_temperature. Sensor 1 also included a sensor[#]_fan_speed file. I ran cat on each of the 3 files (again 4 for sensor1), just to obtain some sort of idea of what information it would provide. Here is a quick overview:

  •     fan_speed – provides the current speed of the fans in RPMs
  •     limit – specifies the upper limit of the temperature that the sensor can reach before I assume either you start to have issues or the fans kick in
  •     location - specifies the location that the sensor is monitoring the temperature for
  •     temperature – this file provides a single number, which happens to the latest temperature reading in degrees Celsius (converting this to Fahrenheit should be trivial)
According to the locations, one sensor was for the CPU_BOTTOMSIDE and the other PWR_SUPPLY_BOTTOMSIDE. My understanding (again please correct me if I am wrong) is there should be other additional sensors on the PowerBook that we could pull values from. If there are, I'd love to figure out how to do just that. For example, on the OS X side, when looking at temperatures in iStat Pro, it also provides temperature values for CPU top, battery, trackpad, and HD. Perhaps there is some additional documentation somewhere covering this sort of information?

Great, so how can I customize Conky to pull in these values and output them to the grid of information I have running on my desktop? Well, one of the first ideas that came to mind was using a shell script that essentially grabs the temperatures and fan RPM values from the corresponding files and assigns each to a variable that can then be output by Conky. Perhaps there is an easier way to do this?

Yes there is. Here is where exec object comes in handy. This particular object will let you specify a shell command you'd like to run and output.  If you want to have the command ran at your own set intervals, use the execi command instead, but be aware that the interval value you set must be lower than your configured update_interval (mine is set to 1.0 second) for Conky.  So for each sensor I added the following line:

Bottom CPU Temperature: ${exec cat /sys/devices/temperatures/sensor1_temperature}

Battery Temperature: ${exec cat /sys/devices/temperatures/sensor2_temperature} 

According to the man pages for Conky, running shell commands within Conky tends to be more resource intensive.  Personally, I have seen a small average of about a 1% increase in CPU consumption, but that could be to other configuration changes I've made recently to the PB.  These two additional lines in my Conky configuration file worked and do as they are intended, so in some ways a success.  Here's a screenshot:


One last thing I would like to share about Conky.  If you want to disable any sort of flickering Conky may be experiencing, add double_buffer yes to your list of options. Makes everything look like it is running much smoother. I was going to post a link to my conky.conf file somewhere, but decided if somebody was interested in taking a look at it, I send it to them via email.

I know I've barely scratched the surface on how all of these sensors work, but it's a start. One thing I haven't quite figured out is how often the temperatures are being updated in those specific files, so the quest for answers and understanding continue!

Hopefully you enjoyed this post and can use it as a starting pointing for doing your own temperature/fan speed monitoring on your PowerPC machine(s) or even as a gateway to other great ideas for information that can be displayed by Conky. 

I still have yet to finish the post on my PowerBook 1400CS (waiting on a few more parts) as well as the introduction to Clang on PowerPC. The latter is a post I am taking extra care to refine before I put it out there in the wild.

Thursday, September 25, 2014

Me Daily Apps

So I thought it might not be a terrible idea to discuss the software I currently use on my Debian Wheezy systems.  Perhaps you'll find something here you been looking for your whole life. Maybe not. Doesn't matter.

First of all I use the LXDE (Lightweight X11 Desktop Environment) for my desktop environment.  I know there are more feather light options, but I found LXDE to be the best fit for my needs.

The biggest app I use is Kupfer.  I use it all the time to open files (which open in the default associated app), folders, apps, HTTP links, you name it.  Basically just about anything you can think of in one way or another.  Huge thank you to Zen over at the PowerPC Liberation blog for introducing me to this tool.  It saves me several (and I do mean several) seconds of time from switching back and forth from the trackpad to the keyboard.  I prefer to stick with just keyboard commands, but I'm not opposed to the trackpad by any means either.  Depends on the task at hand.

I have most of my other commonly used apps in my "natively" running dock that automatically shows and hides as I hover over it, similar to the OS X dock.  For the GUI filesystem browser, I use the default File Manager that is included with the LXDE desktop environments (if I'm not in a terminal, which is usually the case).  I wouldn't mind test driving alternatives, but I just haven't made time for it.  It does what I want it to and I don't have any issues, except that I can't seem to get the mounted Lubuntu partition from showing up in the side bar along with the OS X partition. Nothing in the File Manager's preferences  helped, but I'm still digging around on the system. Let me know if you know the way.

For my browser, I also use the default Iceweasel that is a fork of Firefox.  The only add-on I use with it is XMarks for syncing my bookmarks between different systems.  As a webkit alternative, I use Midori as it is incredibly quick, smooth and lightweight in terms of resources. I've used a few others, but nothing that I thought was worth keeping around.  If an app is not going to serve a purpose for me, I make sure to not keep it around and take up valuable bytes of space.

For my PDF/document viewer, I use the cleverly named Evince.  It handles PDFs pretty well and it supports several of the expected features associated with a PDF viewer.  Speaking of documents, I also have the LibreOffice suite installed to be able to create and edit documents, spreadsheets, and presentations.  I've actually come to enjoy using these more than regular old Microsoft Office suite.

As discussed already in one of my previous articles, I use an RSS feed aggregator by the name of Liferea.   For FTP, I use the well known FileZilla, which is actively maintained and updated on a regular basis. Along with that I use Transmission and for media I run both VLC (some of you may gasp at that) and Audacious for music playback.  Eventually, I'll make use of a better suited piece of software for video playback, but haven't spent too much time looking into it. What I don't have or use is any form of streaming radio, although that would be worth having.  I'll have to research that further.

I have Hotot installed as my Twitter client, but I don't use Twitter as much these days and this application no longer runs on PPC.  And for the final nail in the coffin, it is no longer being maintained or updated by anybody.   In fact, it doesn't currently work on any of my machines, so it shall be soon tossed into the nothingness

For coding, I rely heavily on vi in the color coded LXTerminal and Geany. Geany supports a multitude of languages including the most commonly known ones such as C, C++, Python, etc. For compilation (or is it compiling?), I am currently using GCC 4.6.3 and am just starting to make use of the Clang compiler (more on that in the future... you can learn along with me! :) ).

Oh and lastly, on a entirely separate note, if you haven't heard by now, there is a monster vulnerability in bash associated with the handling of environment variables that has been around for far too long.  Debian has already pushed out security fixes for this, so make sure to run  sudo apt-get update && sudo apt-get upgrade on your system to receive the patches.  You are set up to receive security patches and updates right? Lord have mercy on you if you aren't.

That's it for this article.  Once again, I droned on a tad bit with nontechnical opinionated words (sounds like several big name tech writing companies these days).  Hopefully you read about an app or two here that might be just as useful or more useful to you on your own PPC Linux system.  I didn't quite cover all the apps I am using, but it's a pretty decent start. Let me know what you are using in the comments below.  And of course, suggest any new topics or questions if you have any.