Category Archives: Tech_Friday

Tech Friday: New MacBook with Leopard OSX 10.5

In the Pournelle tradition, “we do these things so you don’t have to”… and contrary to advice to clients, I’ve remixed my operating systems, and gotten an Apple Macintosh, a MacBook. This is the little laptop with a 13.3 inch screen.

It was fun to place the order last Friday and then watch the machine wing its way over from China to Anchorage Alaska, and then down to the lower 48 over the course of the next couple of days on the FedEx tracking site. I was told that the unit would come with the latest version of the Mac operating system installed. It wasn’t, but there was a CD enclosed, and the first thing I did was to do an OS update, which went without a hitch. Now I’ve been reading on-line discussions about the update, but since I had zero experience with Mac operating systems since the first Mac was introduced about twenty years ago, I was blissfully ignorant about all the changes. My baseline is simply the latest and greatest…and my early experience has been favorable.

There are still a few hold-overs from the earliest Macs. The startup sound is the same. The finder “logo” with the two faces is still the same. I wonder if someone, somewhere, has a digital recording of the first Mac floppy drives as they sort of clicked away. I can still remember that sound.

The OS comes with an embarrassment of riches. Like Ubuntu or other Linux distributions, there are enough applications in there to keep you busy (and unproductive) for days. So far the only things I’ve added are the iWork suite (word-processing, presentations and spreadsheets), and an upgrade from the standard GarageBand recording software called Logic Express. I also installed the Cisco VPN client for our university’s wireless network. A second power brick for the office is $70.00.

Frankly my first impetus for the change was to solve a hardware problem. My Dell Inspiron is falling apart, and the keyboard never worked the way it should.

The MacBook hardware is quite complete. It includes an integrated microphone and camera. There is integrated Airport wireless networking which works flawlessly. Integrated BlueTooth, (haven’t tried it yet…need to get one of those nerdy headsets). A FireWire port. Two USB ports. External microphone input, and headset output. All this is wrapped up in a sleek black package which weighs a little over five pounds.

Of course the underlying OS is Unix, so all the Unix command-line goodies are available. And Boot Camp, which allows you to set up a dual-boot Mac/Windows is now out of beta and integrated directly into the Mac OS. So, even if I relegate the Mac to “personal” use, I’ll still be able to use it with Windows XP or Vista.

Looking Back: Database Development with Microsoft

Many careers require you to update or reinvent yourself on a regular basis. Expert programmers turn into beginners again every three years or so as their software tools, methodologies, and paradigms change.

So I certainly wasn’t surprised when after several months away from the Microsoft Visual FoxPro page I ran across an announcement from (April 2007 no less):

We are announcing today that there will be no VFP 10. VFP 9 will continue to be supported according to our existing policy with support through 2015. We will be releasing SP2 for Visual FoxPro 9 this summer as planned, providing fixes and additional support for Windows Vista.

The oddly-named FoxPro has had a good run. I started using it I think around 1988 when I first took a job at the University of Vermont in their Continuing Education division, setting up Novell networks and maintaing a couple of FoxPro applications that had been written over the previous couple of months. FoxPro really started out as a complier for dBase code. DBase was one of the first, if not the first relational database programs created to be used with desktop computers. DBase, an interpreted language, was slow and quirky, but if I recall, I actually got a couple applications going with it. Some years after dBase was created, Clipper came out. Clipper could compile dBase code into machine language which could then be run natively on the computer without an interpreter. Clipper had no user interface to speak of, you still had to do the development in dBase, then take the dBase files and run them through Clipper by running batch files.

FoxPro was developed by David Fulton as an improvement over Clipper. It included a user interface for development and allowed you to create one for the end-user. It was less expensive than dBase or Clipper and had terrific performance. I started with version 2.0 right after it had come out, and by the time they were up to version 3.0 they had a program to create sophisticated user interfaces with overlapping windows. The programs would work in both Windows and Unix, and at one point there was support for the Macintosh.

More on this ancient history is available on the FoxPro Wiki.

[pause to take unsolicited spam phone call in heavily accented English from Ravi via what must be a bad VoIP connection to solicit IT services]

Fox Software was bought by Microsoft in 1992. For awhile they maintained a DOS version, but they were keen on developing a version for Windows. This appeared to be before Access or SQL-Server had any major marketing traction. There were other desktop databases, and Microsoft may have felt that they needed to have a dog (er, fox) in that particlar fight. In particular, one competitor was Borland Paradox, which had a terrific user interface and query system. Borland was also competing with development tools and languages.

FoxPro-for-Windows, renamed Visual FoxPro, became a major development system for deploying desktop database applications. Paradox never made an effective transfer from DOS to Windows, although it still exists in the WordPerfect suite.

FoxPro isn’t dead though. There is a conference happening in October, and as the announcement says, there will be support until 2015. Version 9.0 will receive some updates to help it integrate well with the dominant Microsoft dot-net technologies. For interactive querying and data manipulation, it remains a wonderful tool.

Disk Partitions

I am reminding myself of how disk partitions work, and how they can be manipulated. The impetus for this is an attempt to load Windows XP Embedded (XPe) on my target machine, an ASUS Pundit. Using Acronis Disk Director Suite, ($49.00) I created a separate small partition for the XPe installation. The problem then was trying to figure out how to boot the extra partition.

Partitions can be marked several ways
a. Active Primary – this is the boot partition. There can only be one of these on a disk.
b. Primary – This can be either a bootable partition, or not.
c. Extended – A physical partition that can be further subdivided into other partitions.
d. Logical – A subdivision of an extended partition.

The upshot for the test machine is that I want to have two partitions; one for the original Windows and software installation, that includes all of the necessary application software and a second testing partition for the Windows XPe image which contains all the applications and drivers already burnt into the XPe image.

Also, I need to be able to designate one partion or the other as the boot partition. This is done by marking the partiion as “Active”, and insuring that the boot drive letter is designated drive C:. The first part, designating the partition as the boot partition, seems to work fine within the Acronis program. Changing the drive letter, on the other hand, does not seem to be so intuitive as it involves a registry edit.

The drive letter desgination is important, because many programs rely on the designated drive letter to find their own executables and data.

To boot the XPe partition, I changed it to the “active” partition, and then renamed the drive letter to C: A final change involved changing the Boot.ini file which is present in the root directory of the partition. This file looks like this:


[boot loader]
timeout=0
default=multi(0)disk(0)rdisk(0)partition(1)WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)WINDOWS="Microsoft Windows
XP Embedded" /fastdetect /noexecute=AlwaysOff

and it gets modified to change partition(1) to partition(2) in both instances, so that the boot designated boot partition is indeed the 2nd partition on the drive. I recall from my distant MCP days, that although disk drives are numbered beginning with 0, the partitions are numbered beginning with 1. The diagnostic for this is that if you have already designated the second partition as active, but still boot into the “wrong” partition, it means that the OS files that are loaded are the ones that are pointed to be the boot.ini. To make this even more confusing, there is the notion of the “system” partition and the “boot” partition. This is a distinction which I think is only talked about when dealing with Microsoft operating systems. Perversly, the names seem to be reversed….it is the “system” partition which contains NTLDR and boot.ini. and the “boot” partition which contains \Windows, and \Windows\System32, and all the operating system binary files.

In 99% of the cases, of course these files are are all on the same partition and in most cases there is a single partition on a drive anyway.

Building a Windows XPe Test Environment

Back in May I worked through a Microsoft Virtual Lab online that created a test target environment for a Windows XPe device.
Today, I’m attempting to build my own version of a target device using Microsoft Virtual PC, following instructions from MSDN, How to Demonstrate Windows XP Embedded.

Continuing with the “virtual” theme, I was pleased to see instruction for creating an image on a Microsoft Virtual PC.
If you have never used this, it is available now as a free download, and it is great for trying things out without trying to scrounge another PC someplace. An essential developer’s tool, Virtual PC can be used to try different operating systems, (including non-Microsoft O/S’s), program builds, simulated client environments, virtual networks with multiple workstations, you name it.

But back to Windows XPe. I’m a newbie, so there were several non-obvious issues that I noted in the MSDN instructions.

The procedure describes using the Windows Preinstallation Environment. This is the equivalent of a DOS boot disk with a bunch of command-line utilities that you can use to prepare disk drives, copy drivers, and so forth. Windows PE has been around awhile, it appears to have been initially designed for use by “white box” computer system builders who wanted to configure hardware before installing Windows. So, essentially what you are doing to prepare the virtual PC is the following:

1. Create a new virtual PC and virtual hard drive for the embedded XP application.
Be sure the networking setting is set for “shared networking”.

2. Boot this new virtual PC using the first CD from the Windows XPe Evaluation Kit. This CD 1 contains the boot image for Windows PE. It will boot up the virtual PC and come to a command line with X: as the drive letter. The X:, in this case refers to the CD drive NOT the disk drive that you created for the virtual PC. This is because…you have to partition and format the virtual drive, per the instructions above in the MSDN article.

3. The article then describes the process of running TAP, the “Target Analyzer Tool” which captures the configuraton of the hardware that you are running on. This creates a file called devices.pmq

4. You need to get the devices.pmq to your host machine, either by running TAP with the output switch or copying the file to a share. This is a little confusing in the instructions; here is how I interpreted it.

a. Create a folder on the host machine called C:\Windows Embedded Images”

MD "C:\Windows Embedded Images"

b. Share this folder with a name XPe

NET SHARE XPe="C:\Windows Embedded Images"

c. On the virtual machine, Map the Z: drive to the shared folder using the IP address of the host machine as the server name.

NET USE Z: \\192.168.0.102\XPe

You may have to supply a name and password for this, (actually, this is a good thing..); I had to use my admin name and password to get in.

d. On the virtual machine drive C:, copy the devices.pmq to the shared folder

COPY  C:\ devices.pmq Z:

After completing this portion of the instructions, I continued on with the discussion of the compnent designer. This is one of the tools included in the Microsoft Windows Embedded Studio

1. Go to File Import, and choose the devices.pmq


The import function takes a few minutes to run. (10 or more). Once it is completed and you close the import dialog, you’ll get a first look at the component tree with the imported devices shown on the right.

Photo: c:\componentdesigner.png

2. Ok, moving right along the next step is to “finalize” the component.


This screen shot matches the one in the MSDN article.

3. Saving this file (from File|Save) creates an sld file.

4. Now the sld file needs to be imported into the Windows XPe component database using the Component Database Manager. This step is described in the MSDN document.

Finally, you get to build the Windows XP image using the Target Designer. This is where the components are chosen for the Windows image. Of course, the componet that you’ve just created needs to be added, as it contains all of the information about the target hardware.

The instructions say you should update the User Interface Core Component, but as this wasn’t added yet, I first added this manually. My guess is this would get added if you updated the dependencies before this step. By changing these, you have the opportunity to manipulate the user environment, similarly to the way you can set options using group policies.

Then, when you do the Dependency check, hundreds of components will be added. This step takes several minutes. When it completed, it showed that there were 10430 components included.


When all dependencies are resolved, you then build the run-time image. This took about 3 minutes, resulting with an image of 129.0 mb compressed, and an estimated uncompressed size of 179 megs. Not something that will fit on a floppy disk!

Doesn’t this look familiar?

As part of the process of installing this on to the virtual machine, the instructions call for using the Microsoft Resource Kit utility RoboCopy. This is XCOPY on steroids. Not only does it copy files and directories, but it preserves any attributes and settings on the files and directories. I did the copy. Occasionally it would stop because it claimed the network connection was down. I don’t think think so….as it copied from the the same physical machine. But in the end it looked OK.

This shows the result of the copy operation, and the root directory of the target machine. Recall that this is a command window within the Windows PE Environment (the graphic backround image), appearing in a virtual PC (the title bar and toolbar). Let’s see if the XPe image will boot!

The first boot agent starts. This writes the registry, installs system security, registers components, registers class installers, installs hardware devices, in short, completes the process of installation. Once configured, it forces a reboot again, and Voila! We’re into a session of XP embedded.

Embedded Hardware and Software Resources

Beginner’s (that’s me!) Information:

ASIC
Application Specific Integrated Circuit

FPGA
Introductory information for Field Programmable Gate Arrays (FPGA)
http://www.fpga4fun.com/FPGAinfo1.html
http://en.wikipedia.org/wiki/Field-programmable_gate_array
http://www.fpgacentral.com/
http://www.openfpga.org/

Programmable digigal logic chips.
Are “volatile”, program has to be reloaded when the unit is turned on.

Article/Blog about working with FPGA development kits
http://svenand.blogdrive.com/archive/11.html

CPLD
Complex Programmable Logic Device (technology of the 1980’s
More complex than a PAL, less than an FPGA
Non-volatile mmemory
Useful for providing “boot loader” funcitionality
http://en.wikipedia.org/wiki/CPLD

Microsoft Windows Embedded Developer Center
Articles and resources from the MSDN library regarding Windows embedded.
http://msdn2.microsoft.com/en-us/embedded/default.aspx

Embedded Technology Journal
http://www.embeddedtechjournal.com/

Nuts and Volts Magazine
http://www.nutsvolts.com/

Circuit Cellar
http://www.circuitcellar.com/

Windows XP Embedded….just like Novell

I’m dating myself here…but I remember about twenty years ago when the Novell NetWare operating system was compiled from components. In the earlier case, the operating system was linked to include object files for specific networking hardware. I recall provisions for up to a dozen different hardware manufacturers and topologies, including ArcNet, Ethernet, IBM Systems Network Architecture, and something called OmniNet. The linking and build process used 30 or more floppy disks, and the process was fraught with errors and mixups. The target hard drives were tested with the infamous CompSurf program (for Comprehensive Surface Test), and this could take several hours to run if the disk was a large one, like 40 megabytes. We would routinely let these tests run overnight, and hope in the morning that our disk would have a clean bill of health.

So it is interesting to build a Windows XP embedded image, which basically gives you 1200 possible components that can be selected to build a version of Windows XP that will run on embedded hardware or for a dedicated device. This is displayed in the Microsoft Virtual Labs, which create a virtual PC environment ActiveX control that shows up embedded in an Internet Explorer Window. Pretty slick actually. And, as the second picture shows…it is just like real life. Here is what I ended up with after working through ninety minutes of the lab when I attempted to reboot the virtual machine.

Martin Geddes: Cold on VoIP? Exactly

Martin Geddes is sceptical.

I ought to explain why I’ve suddenly gone cold on VoIP.

It’s just I’ve watched my own behaviour. I’ve grown tired of the inconsistency of PC VoIP calls, and instead I’ve reverted to using landlines, mobiles and Jajah (for callback). But I’m still using IM to set up many of those calls!

The problem isn’t unique to any one client — they’re all proving unsuitable for business use with clients (which is most of my telephony needs covered).

The worst of all seems to be Skype conference calling. We probably would rate the quality as “unacceptable” for 50% of the attempts. When it’s good, it’s great. But that isn’t what I’m after.

He goes on to talk about how softphones don’t work very well.

Another problem with PCs is they’re just lousy telephones. When you hibernate Windows XP on my HP laptop, all kinds of audio settings seem to go wrong and the volume buttons stop working. Bluetooth is hopelessly unreliable, and who wants another wireless headset device to remember to charge up (and bring the charger when you travel)? Or to have to rush to fish out a headset and plug it in when a call arrives?

Before I get accused of plagiarizing the whole piece, you can read the full post.

There are a couple of issues here:

VoIP qua VoIP is really a very broad spectrum of technologies, encompassing softphones, free calling, replacing million dollar hardware PBX switches with open source software switches, and new applications. Martin’s definition for purposes of his discussion, if I read his article correctly cites two problematic applications; softphones on PCs, and conference calling on Skype.

I agree with his scepticism. My own interest in more in Asterisk/Trixbox and replacing the traditional circuit switched phone line infrastructure with packet switched calls over the internet. While I have made a couple of calls from my laptop, it seems a little bit silly to do so when I’ve got my $15.00/month cell-phone handy. So if softphones don’t work I’m personally not going to slit my throat.

But, the internet calls thing, is more problematic. Clearly, we are at the mercy of the internet when placing such calls… once your packets get outside your own local area network, they are flung out on the storm-tossed seas of the public internet. And, as we all are getting what we wished for with network neutrality, our packets are being treated like everyone else’s packets. So, your 911 call’s packets might be held up by an image of Johnny Depp, or even the whole movie.

One solution of this so far, as been “quality of service”, which is a euphemism for “prioritizing packets”. If people played nice, then, every router on the net would be smart enough to know that some packets are more equal than others, and voice and media packets in particular need to be forwarded before eMail and ftp packets. And indeed, if I’m making VoIP calls from my Trixbox while downloading those bloody updates for Windows, call quality goes down the tubes, (and this is with me, placing a single call, and downloading from a single workstation on my LAN).

The second solution, and really the only one at this point, has been to provide enough bandwidth so that whatever the exigencies of packet transfer there is enough slack in the network so that most of the voice packets will arrive, in the correct order. In buildings that use VoIP phones, the best practice is to run a separate set of 10BaseT cabling for the softphones. Mind you, this is a separate subnet from the data network that is currently in place. (Note: Someone will argue that this already in place, because we’ve got the existing two or four pair wiring in place for the telphone…)

So, is it responsible of us to suggest for a non-profit that they should:
1. Invest in new desk phones at $125.00 for each desktop location
2. Double their cable infrastructure
3. Purchase a quality of service router that at least will prioritize packets moving in and out of their own location
4. Purchase a dedicated server, with attendant UPS backup and management
5. Figure out how all this goes together.

when it may not work. Specifically, that you won’t be able to rely on 99.99% availability when placing internet calls, and you won’t be able to ensure that 99.99% of inbound calls to your internet-brokered phone lines will reach you.

when you can go to Best Buy or Amazon and get a Panasonic key phone system with six phones for $2500 or so, which you can forget about once it is installed.

I’m just asking.

Trixbox and FreePBX

In one of those serendipitous moments, I found that by upgrading one thing, I fixed another thing.

One of the nifty things that you can do with VoIP is add a virtual number to your system. The number can be located pretty much anywhere, as long as your “voice ISP” has a block of numbers available in the locale that you want to have the number.

In my case, I wanted to have a local number available in Albany, New York which is area code 518. So, I logged into the VoicePulse web site, chose the location and selected a number from the ones available. VoicePulse charges US$11.00 to set up a number, and then $11.00 at the beginning of each month for the number.

That should have solved the issue. I was able to verify almost immediatly that my credit card had been charged. But when I called the number I’d get the “the number you have dialed is not in service” message, which follows the three high-pitched tones.

What to do? First, of course, send a note the VoicePulse tech support. They called back and asked for a transcript of the SIP debugger in Asterisk. So, I logged into the Trixbox with my SSL terminal program, logged on to the Asterisk command line, and then activated SIP Debug.

AsteriskBox$ asterisk -vvvvvvvvvvr
AsteriskBox$ sip debug

This gave me a transcript of all the SIP commands, and it was obvious that indeed the call was getting as far as the Trixbox, but was being rejected for some reason. So, I figured it had to be an issue with inbound routes in the Asterisk configuration. These are configured using FreePBX. Poking around on the FreePBX forums, I found that the version I was using was still a release candidate, and indeed other people had had problems with inbound routes. So, an upgrade was in order, and excellent instructions were given on the forum. And indeed, now the inbound number works.
I now have a “local presence” in Albany, even though I’m in Vermont.

Erasing your Hard Drive – Really

How to REALLY erase a hard drive by Robin Harris

Who Knew? Turns out there is a way to do a full erase on a hard drive already built into the firmware on the drive.

So what’s the magic?
Something called Secure Erase, a set of commands embedded in most ATA drives built since 2001. If this is so wonderful, why haven’t you heard of it before? Because it’s been disabled by most motherboard BIOSes.

Secure Erase is a loaded gun aimed right at all your data. And Murphy’s Law is still in force. But hey, if you’re smart enough to read Storage Bits, you’re smart enough to not play with Secure Erase until you need to.

I use Boot ‘N Nuke myself, which he also mentions.