C++ in Xcode on Mac OS X

I have begun dabbling some with C++, since a good part of my senior project is to be written in the language. Earlier today, I messed a bit with Microsoft Visual Studio 2008, which was fine. This evening, I wanted to mess a bit with Apple's Xcode, its free IDE. The following video was helpful in getting me started.

68HC12 Evaluation Board

Yesterday I spent over five hours in lab working on four different projects in assembly language. The software my class uses for writing assembly is Freescale's CodeWarrior 12. I installed a freely downloaded copy on my Windows laptop so I can code at home. This works wonderfully in the IDE's Full Circuit Simulation (FCS) mode; however, FCS does not simulate the evaluation board we use (shown below). It will not allow access to hardware ports or even allow faking of the ports. For example, if you wish to output a one-byte value to the LEDs, you send the value to port $0248; FCS will simply not allow any data to go to $0248. You can go to $0248 to see the value at the address but you cannot edit it in FCS.

20140927-062305.jpg

If CodeWarrior is set to our evaluation board, it requires the evaluation board be physically present. Otherwise effectively nothing can done. This results in trying to write everything in FCS and using substitute ports since the actual hardware ports are verboten. I sometimes write my hardware assignments this way then duplicate the code, set it for evaluation board then go back through it to tediously revert every substitute port to the required hardware port.

Years ago I bought a license for Metrowerks' CodeWarrior, which was the alleged top IDE for programming for Macintosh. I did very little with it.

Dead MacBook Pro

Not long before I left Japan, I bought a MacBook Pro. It has been a good machine. Last year I began running Windows 7 in Boot Camp on it after partitioning the hard drive.

Problems began to appear when booted in Windows. Certain sites would crash Windows fairly reliably. Video would sometimes crash it. There were warnings about a need to update the Nvidia graphics drivers, but doing so was difficult; the one time I did, the crash was so bad I had to reinstall Windows 7. When booted into Mac, however, problems were fewer.

Then I upgraded to OS X 10.9. That was a disaster! The Mac crashed constantly, always with the same warning about a graphics CPU or something. Eventually I took the machine to the local Apple Store once an attempt to restore it from a backup failed. It turned out there had been a recall due to faulty graphics chips. However, I was told the program had ended because most of the problems were ultimately attributable to software conflicts; regardless, the recall had ended only a few weeks before I came in. I was also told people running Windows in Boot Camp seemed to be having more of these kernel panics, so I quit running Boot Camp. They were able to get my machine running, so I ran with it.

Until a few days ago when the crashing began occurring multiple times per day. I booted off backups on both USB and FireWire drives to restore from the respective backups, but the MacBook Pro crashed a few times during restoration. Eventually it would not even boot from OS DVDs.

On Friday the 12th, I lugged the MacBook Pro back to the Apple Store. This time the diagnostic tests showed one of two graphics chips were not responding. Since the chip itself cannot be replaced, I need a new logic board, which alone costs around $900, an Apple quote. However, because my problem seems tied to the recall problem, I should be able to have everything done for $310. I left the machine with them and returned home. They will contact me in another day or two if some other problem is found. Otherwise, the MacBook Pro should be back and working inside a week.

Too bad it did not crash over the summer instead. In the third week of classes has been inopportune, to say the least.

Onward with 32-bit Windows 7

Just as the past term's finals week began, my partitioned Mac laptop failed rather spectacularly: It could no longer find its own hard disk, neither the Windows 7 nor OS 10.8 partitions.

For a nominal fee, a friend sent me an old HP laptop he had sitting around. It is only a 32-bit machine and had Windows Vista on it, so I bought a 32-bit student version of Windows 7. It was a bit unsettling to see 154 critical updates waiting as soon as I upgraded the OS. Today I found another 104 updates that are currently downloading.

Perhaps the current updates will resolve the highly annoying problem I am encountering where a new folder creation or folder rename request will not show up in the Explorer window unless I go up/down the folder hierarchy then return to where the request was made. How clunky!

Hard Disk Wipe

Yesterday I returned home from class to find my MacBook Pro unresponsive. I did manage to coerce it into booting, but it would abruptly restart about 3 minutes after the booting process was complete. The charging indicator stayed green, never the orange of charging; the battery indicator turned into a X.

Today I took the 2010 MacBook Pro to the Apple Store here in Indianapolis, where they ran tests to find the file hierarchy was destroyed. That might be why the Mac would not even countenance Alsoft's Disk Warrior, on which I once relied. Problem identified, I brought the Mac back, wiped the hard disk, partitioned it again, and installed the free Mac OS X 10.9, Mavericks. It still sucks: three kernel panics alone tonight with only the basic system installed and Microsoft Office 2011. It seems Macericks itself is the problem.

DriverQuest

In the Macintosh world, things tend to work. Updates don't cause failures normally, although one current instructor lost the use of his video camera, or significant functionality, after upgrading to OS 10.8. That's been quite unusual in my experience. Apple has done a decent job of telling me what will no longer be supported if I upgrade or update, thus letting me make a choice.

It now seems I made a mistake by allowing Windows to install an update that broke USB flash memory support. Trying to find out what has happened inside Windows is challenging.

Windows' own updates sometimes don't install, or they break something. A faulty Intel USB file can be deleted, but it's seemingly impossible to replace it.

Two lessons have been learned:

  1. Do not ever use Windows, if you have other options. Macintosh and Ubuntu are robust.
  2. Do not install Microsoft updates, as they'll probably break something.

I'm deleting my Boot Camp partition and reinstalling everything again. Thanks, Microsoft, for causing me to waste hours of my time over your flaws.

Windows 7 Update Failures

I have been trying to apply some Windows 7 Home Premium updates from within Windows on my Boot Camp partition.

One kept failing, so I finally sought help online. A forum post said I should download the update directly, which I tried to do, but that required Genuine Windows Validation. I downloaded the proffered application, which when opened, said I needed a newer version; however, no newer version could be found. Gah.

Then I discovered that what was needed was not Chrome but Microsoft's own browser, IE: no other will work for validation, a "feature"-type "bug," perhaps. So I opened the update link in IE and downloaded it. Installation successful!

The other update, however, wouldn't work through Windows' own updates, so I downloaded it directly, thinking that's I had found the key to Windows' updates.

Once downloaded and run, however, I got a message that said the update isn't applicable to my machine. It would be nice if Microsoft's own updated tool knew this.

What a buggy OS.

Windows 7 Stuff

Beginning steps in Microsoft Visual C++ Express 2010, which is working well. It reminds of JBuilder, what I think the IDE that I used for Java was called. My current course is for C programming, which I will likely enjoy. Writing, debugging, and tweaking until success can ultimately be quite satisfying.

As I run Windows on my MacBook's Boot Camp partition, I've had to buy some antivirus and firewall software. I also installed Apache OpenOffice, which I've used for years on the Mac. Yet it is awkward to run both OSes on one machine, especially when I wish to jump from one to the other.

Boot Camp 4, Windows 7 Installation

Today I received my copy of Windows 7 Home Premium. I had already printed out the Apple manual for Boot Camp, which allows me to create a Windows partition on my Intel Mac to boot into Windows as needed. Much of the software I'll need for engineering is Windows-only so I had no choice: Boot Camp or a second laptop; I have chosen Boot Camp for the time being.

How I went about installing Windows on my MacBook Pro:

  1. I backed up my Mac using SuperDuper!
  2. I ran Boot Camp Assistant and set my Windows partition to 100GB
  3. Using BCA, I downloaded the Windows Support files and burned them to a CDR within BCA--nice
  4. The Mac booted in Windows, so I fed in the Windows installer and ran it
  5. I ejected the Windows installer disk then installed the Windows Support files
  6. Finished installing Windows with few more restarts
  7. Windows 7 on my Mac!

So far, I have not yet tried to install anything third party, although Visual C++ Studio Express is downloading now.