Thursday, December 19, 2013

Mac Linux USB Loader version 2.0

This consumer preview release includes loads of new features including:

  1. Enterprise, my new UEFI boot loader that is far more customizable. You can view more information here.
  2. Updates to localizations. Added a traditional Chinese localization (done by a third party user) and updated Spanish localization. For credits for localizations, see this file.
  3. Big fixes and other changes.
If you want to download it, you can get it here. Please note that this is still beta, so it may be buggy. You can also email me if you have problems.

Sunday, November 24, 2013

A Sneak Preview of Enterprise

So, after a long, hard month of serious development (before this was a rather lackluster and on-and-off effort) I am pleased to show some screenshots of Enterprise, my custom UEFI boot manager program that I wrote about at length in this post. However, there are some (small) details that are different in the plan versus the implementation, and that's of course because I've found a better way to do things. So, here's are some screenshots, as promised, with comments:

This screen (which may receive minor tweaking) allows the user to select one of two basic options: starting the Linux distribution immediately or, in case there's issues with the video card, etc, to customize Linux kernel boot options.

This is what the boot options screen that I just mentioned looks like. You can toggle a variety of boot options (up to 9 is supported with this approach) that have a variety of functions. Some of them make troubleshooting easier, while others facilitate installing Linux to your Mac. I plan on adding more before the final release. Please note that not all options are supported by all distributions.

Love it? Hate it? Have suggestions? Drop me a line. I'm shooting for a release date of the 30th of November and I'd love to get some feedback.

Thursday, October 17, 2013

Enterprise Developing is Rolling...

I am happy to announce that, after a long interim, development on Enterprise is going full speed ahead. Hopefully, there won't be any more long delays in development. I know that this is a much-needed program, due to many bug reports detailing the flaws with Mac Linux USB Loader's current firmware solution, and so hopefully it should be in a somewhat beta-testable state soon.

What's currently working is the initial menu and the kernel boot options configuration panel (from where, you'll be able to add options like nomodeset and acpi=off to the kernel boot procedure).

What still needs to be done is processing Enterprise's configuration file - currently it checks for the existence of such a file, but doesn't read its content - it could contain song lyrics for all it mattered - and passing everything to GRUB, which will load Linux from the supplied ISO file like at present.

Screenshots will be coming soon, but will take some setup to capture, as Enterprise runs before any operating system, and thus any potential for screen capturing.

Friday, August 30, 2013

Implementation Details of Enterprise, my Custom UEFI Booting Solution for Linux on Intel Macs

My repository on GitHub holding the source code for my program Enterprise is currently sparse on commits - no updates in over a month. But before you accost me for being lazy, listen up, for I have not been lazy, nor has the project been abandoned. I simply have been using this time to figure out exactly how I'm going to implement the program instead of simply throwing code together like before.

So, what do I have in mind? Well, listen up.

My booting solution for booting Linux distributions via EFI is a three-stage loading process, involving (at least) three files instead of the present two (two EFI executables and one ISO file of your preferred Linux distribution). These programs will be executed in sequential order. This works out as follows:
  1. The user boots into the USB drive made by Mac Linux USB Loader. Enterprise will then perform some hardware checks to ensure that you actually booted on a Mac. It will then display a menu similar to those found in gummiboot or GRUB. I'm looking at rather basic options at this point - the options will be to boot normally, boot with certain options (like no graphical X desktop and/or disabling kernel mode setting), or reloading and/or dropping into an EFI shell.
  2. If the user chooses to boot the operating system, we then write out a configuring file detailing exactly what is needed to boot Linux on the current hardware. Then we pass control off to GRUB, which is another EFI executable in the same directory. GRUB reads this configuration file and boots the Linux distribution included in the installed ISO file.
  3. GRUB loads the kernel and RamDisk from the ISO using loopback. Together the kernel starts up the remainder of the operating system.
This approach will ultimately yield itself to be a more viable alternative to the current solution, which works with hard coded kernel locations inside of the ISO (however, loopback support will still be required, as this is required for GRUB to boot from the ISO file - there isn't really any way around this). Additionally, it will allow me to add support for more distributions with relative simplicity.

For those of you who want to see the directory structure, here's what it will look like:

I know many of you have been waiting very patiently for a solution. Tails, Knoppix, Backtrack, and Arch Linux are all distributions that I've been requested to support. I assure you that I am working as fast as I can to get these distributions working with Mac Linux USB Loader. I have no idea when this solution will be ready for beta testing, but everything should be on track now.

What do you think of this setup? Comment below. If you prefer to communicate via email, I can be reached here.

Thursday, July 18, 2013

How to Code UNIX Daemons - Part One

In continuing with my time-honored tradition in bringing you the absolute latest in small code samples, here's an example of how to write a UNIX daemon. For the unfamiliar, daemons are background backgrounds that are typically started when the system starts up and have one specific task - typically ranging from serving web pages (the Apache web server, https, is a daemon, as is sshd, which listens for ssh requests on remote servers you can ssh into).

So, without further ado, here's the code sample:

 #include <unistd.h>  
 #include <fcntl.h>  
 #include <stdlib.h>  
 #include <string.h>  
 #include <stdio.h>  
 #include <syslog.h>  
 #include <sys/types.h>  
 #include <sys/stat.h>  
 int main(int argc, char *argv[]) {  
   // Set our uid to root so we get root permissions.  
   // Fork off.  
   pid_t pid;  
   int current_arg = 0;  
   pid = fork();  
   if (pid < 0) {  
   if (pid > 0) {  
   // Open a syslog so we can post messages, as daemons shouldn't access  
   // stdout.  
   openlog(argv[current_arg], LOG_NOWAIT|LOG_PID, LOG_USER);  
   syslog(LOG_NOTICE, "Successfully started daemon\n");  
   // Create a new process group.  
   pid_t sid;  
   sid = setsid();  
   if (sid < 0) {  
     syslog(LOG_ERR, "Could not create process group\n");  
   // Set our working directory to / so we know where we're writing files  
   // from. Also good practice.  
   if ((chdir("/")) < 0) {  
     syslog(LOG_ERR, "Could not change working directory to /\n");  
   // Close the standard streams like stdout so we're not attached to the  
   // console (and thus killable with Control-C).  
   // Now mimic some daemon activity. A real daemon would actually do  
   // something here, such as monitor CPU temperature or something...  
   do {  
     syslog(LOG_NOTICE, "Sending a message\n");  
   } while (1);  
   // Close our access to the syslog.  

Put this into a text file, and then compile it with your C compiler. You then go into the terminal, run your program, and… it exits immediately - what gives?

The truth is, something did happen - you just don't notice. Thanks to our fork() call, we split off from the main process and run in the background.

In the second part of this series, we'll write a more complicated daemon program. See you later!

Sunday, July 7, 2013

Mac Linux USB Loader v1.1 Consumer Preview

For all of you wondering what the last month or so of coding has meant for Mac Linux USB Loader, you are in luck! I am, as of now, officially releasing a consumer preview of version 1.1 of Mac Linux USB Loader! You can download it here on SourceForge.

Version 1.1 is mainly a small release with bug fixes, but there is one important new feature that I'm beta testing right now: the automatic USB device blesser. On OS X, a drive can be "blessed" to instruct the firmware to boot it - it can be on any drive at any path, and not just at /efi/boot/. Mac Linux USB Loader uses this feature of Macs in an important new way: it allows your Mac to automatically boot your USB stick whenever it is plugged in - no more holding down the Option key is required.

This feature remains optional and can be accessed via a new option called Modify Boot Settings on the main panel:

After you click the Modify Boot Settings option, the following sheet will pop down:

Just select your USB drive that has an installation of a Linux distribution created by Mac Linux USB Loader, press the Bless button, enter your administrator password, and viola! - when you restart your Mac with the USB stick in the drive, it'll boot up automatically into your installed Linux distribution. Of course, the Unbless button does the exact opposite.

Again, if you want to try out this feature, you can download the preview here. Please note that this is an unstable release, and if something goes wrong, I assume no liability*.

* - Worst case scenario: your boot priorities are screwed up, in which case, just Option boot into OS X and from Terminal type (you'll need your root password, which by default should be your admin password):

sudo bless --mount / --setBoot

Sunday, June 30, 2013

Mac Linux USB Loader Starred 50 Times on GitHub!

Mac Linux USB Loader was recently starred for the 50th time. Thanks everyone for your continued support - it lets me know that this tool is needed and keeps me going on development.

Also, thanks to everyone who posted articles on Mac Linux USB Loader, added it to Softpedia, and wrote about it on Wikipedia. You guys are the best!

Tuesday, June 11, 2013

Xcode 5

Apple just yesterday revealed the interface to the next iteration of Xcode 5, Apple's premier development IDE. It can, unfortunately, sometimes break compatibility with older Xcode versions. But a lot of things are hopefully much easier now. I look forward to trying it and I hope you all try it out.

Monday, June 10, 2013

A Demonstration of the UNIX fork() Call

UNIX's fork() call is a fantastic way to have one executable divide itself into two processes, each of which can perform different code from a single codebase. It is also useful for apps that should be started from a command line but shouldn't be vulnerable to being killed with Control-C or the death of the shell. This is how daemons work in UNIX/Linux/OS X. I believe (though I may be mistaken) that this is the basis of Google Chrome's multi-process browsing feature.

 // fork.c  
 // Created by SevenBits on 4/14/13.  
 // This demonstrates how to fork a process. Basically, what happens is, one  
 // process will fork itself, creating a cloned process. The return value of  
 // the fork() call can be used to direct one process to perform one task,  
 // and the clone to perform another! Inter-process communication is also  
 // possible.  
 #include <stdio.h>  
 #include <unistd.h>  
 #include <stdlib.h>  
 int main() {  
   printf("We're going to fork ourselves. This will spawn multiple processes,");  
   printf(" which will each count from 1 to 100 in a different process.\n");  
   pid_t pid = fork();  
   int i;  
   switch (pid) {  
     case -1:  
       printf("ERROR! Something went wrong!\n");  
       return 1;  
     case 0:  
              for (i = 0; i < 100; i++) { // This runs in one process.  
                printf ("A: %d\n", i);  
     default: // This runs in another process (the parent).  
              for (i = 0; i < 100; i++) {  
                printf ("B: %d\n", i);  
   return 0;  

I officially place this code in the public domain. Do whatever.

Friday, May 31, 2013

Mac Linux USB Loader 1.0 Finally Released!

This, my friends, is the window of an application's final release. Mac Linux USB Loader is now at 1.0! Read the release notes here!

Development will continue as usual. Sorry 1.0 took so long, but you know how it goes. :) Well, see you at 2.0!

Thursday, May 9, 2013

Linux, OS X, and Windows... oh my!

This post is being written in lieu of a serious update in a while. First, an update on Mac Linux USB Loader. As indicated by my lack of commits, I haven't really continued coding the application in a while. This is because I've decided to take a hiatus from coding on it so I can focus on my personal life as well as on my other projects. I have lots of programs sitting my Code folder on my hard drive and some of them, like Enterprise, my Linux EFI boot loader, and Invasion, my first person shooter, have development levels akin to abandonment.

It's always difficult when a program isn't being developed. It leaves those who rely on the project in the dust and perhaps unable to perform their daily tasks. Eventually the program gets dated and it reaches the point that no matter how good the application is (or was), nobody can use it anymore. I have been a victim of this myself when looking for good development tools and libraries. Sometimes, a tool just too beneficial to let die gets picked up by another author who works on it. But many die alone.

Looking back on my own really old code projects, I've seen this myself. Old games I've worked on for a few days and then scraped, pieces of code that are now outdated, etc. I've written programs for OS X, Windows, even Linux... Even a project you're super thrilled about can meet its day. It's unfortunate, but true.

I hope to pick up some additional projects for the Mac App Store. I have a few ideas already, but I'm keeping them a secret. I do have some ideas for all of my old code, however. One of these days, I'm going to grab a bunch of old code that I've written or that has been written by others, and I'm going to look at it on this blog. Some of my old programs will go open source as well with a kind of scrap pack that I'll open source and put on GitHub. It'll be downright terrible code, but maybe somebody can learn from it.

Sunday, April 7, 2013

Mac Linux USB Loader 1.0 Release Preview is Out!

The 1.0 release preview of Mac Linux USB Loader is out! It's totally feature complete. You can expect 1.0 out within a couple days.

Monday, April 1, 2013

Mac Linux USB Loader: 1.0 Looming

The 1.0 release of Mac Linux USB Loader will be out very soon, within the next 2 to 3 days. Although I didn't make my initial target of a March release, the additional time figuring out Sparkle has allowed for a more stable final product.

Release notes will be coming very soon! I'll let everyone know when it's out via this blog, and if you told Mac Linux USB Loader to automatically check for updates, you'll know as soon as you start the application.

Tuesday, March 19, 2013

Mac Linux USB Loader is Running Behind Schedule

Due to small issues, Mac Linux USB Loader is running behind schedule in terms of development, as I have not picked up the code in several days. Rest assured, though, that everything will turn out fine as I am still aiming for the 1.0 release in March. The problems are lying mainly with Sparkle, the framework I'm using to update the application, not detecting the server I'm using to issue updates.

The 1.0 release will be code signed and will run on Mountain Lion without the default security warning.

Monday, March 4, 2013

Small Update to Mac Linux USB Loader

Mac Linux USB Loader is now using Sparkle for updates, which will enable automatic updates of the application. In particular, it will enable smooth upgrading from the consumer preview to the release preview and then to the final release, as well as all releases after that.

I hope to see downloads to the program increase. Again, if anyone wants to contribute to the application, patches are always welcome.

Saturday, February 16, 2013

Mac Linux USB Loader: Nearing Closer to First Release!

Mac Linux USB Loader, my flagship tool for installing a Linux distribution ISO non-destructively to a USB device, has a reached a point where I consider it to be stable enough for end-user use, although I am still not yet ready for a 1.0 release. The tool, which copies an ISO file of a Linux distribution to a USB device along with firmware which makes it boot, will likely have its 1.0 release in March. Therefore, I will calling this release the 1.0 Consumer Preview.
As implied by the name, the tool does still have some rough edges and possibly some bugs. However, I consider it to be entirely stable. It is designed to work with OS X Lion and Mountain Lion, though the tool has only undergone extensive testing on the latter and only compiles on that OS X version.

As the below screen will show, the application has a newly revamped preferences window:
The installation window remains largely the same, though it has undergone some cosmetic changes:
Well, there you have it. I look forward to releasing the tool very soon.

Saturday, January 19, 2013

Should ESRB ratings be mandated by law?

Following the unfortunate events in Connecticut, a Democratic congressman has called for support of a bill that would make it law for all video games sold to carry a rating by the ESRB. I feel this legislation is a horrible idea and will likely generate controversy. Not all that long ago, the Supreme Court passed a ruling giving full first-amendement rights to video game and digital content publishers.

One such section of the bill reads as follows:


    (a) Conduct Prohibited- It shall be unlawful for any person to ship or otherwise distribute in interstate commerce, or to sell or rent, a video game that does not contain a rating label, in a clear and conspicuous location on the outside packaging of the video game, containing an age-based content rating determined by the Entertainment Software Ratings Board.
    (b) Requirement of Retailers to Post Ratings Information- Not later than 180 days after the date of the enactment of this Act, the Federal Trade Commission shall promulgate rules requiring all retail establishments engaged in the sale of video games to display, in a clear and conspicuous location, information about the content rating system of the Entertainment Software Ratings Board. Such rules shall prescribe the information required to be displayed concerning the basic age-based content ratings of such Board.

I would hate to see the progress in that area be squashed by a bunch of liberals. You can find a link to the article here. You can find information on the bill here.

Wednesday, January 16, 2013

A Quick Update on Mac Linux USB Loader

Mac Linux USB Loader (which I wrote about in this blog post) is coming about quite nicely.

Rather than explaining to everyone in a long, horrible post of every user interface change I've made, I feel it would be more effective to show you with a YouTube video.

I sort of rushed it, I'll admit, and that's why the screen is cropped and the video is laggy (my computer is a 2008 MacBook Pro, so it's not the best). But it does show off the user interface of the application, which it does just fine.

I hope to make another video at some point that's better, detailing how to use the software, etc. This will come along closer to the first major release, due hopefully in March (but we may get lucky, who knows?).

Also, I want to take the time to thank all the people who starred my GitHub repository, forked my code, and wrote reviews on their websites. You have no idea how appreciated that is. I never imagined it would get to the level of modest success it has. Thank you. Really.