Saturday, December 29, 2012

More on EFI...

Considering it has been awhile since my last post, I figured I'd write a post to discuss the current status of my tool, Mac Linux USB Loader. The tool essentially copies an EFI binary to the USB stick which boots Linux from the ISO. How simple. In theory, I suppose, yes. In reality? Whole other ballgame.

Perhaps it would be worthwhile to discuss exactly what EFI applications are composed of. EFI programs are very special in that the operating system never executes them. They are run by the computer's firmware itself, independent of the operating system, which effectively makes them truly platform-independent programs. Platform independent programs have existed before; they can be created in Java or C#/Mono. From a technical standpoint, EFI programs are also different from traditional programs in the sense that they must be compiled using a cross-compiler, as no native development tools exist for EFI. This is understandable, considering EFI is firmware: it runs before the operating system, and EFI services are often terminated by the OS upon completion of the boot process.

Therefore, development of EFI programs is exponentially more difficult. First off, EFI programs are written in C, and you cannot rely on any of C's standard libraries to help you. If it's not in the EFI libraries, you either need to write it yourself or find an equivalent function that is already implemented.


// hello.c

#include
#include

EFI_STATUS
efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
{
    InitializeLib(image_handle, systab);
    
    Print(L"Hello, EFI!\n");
    Print(L"You have a working EFI shell.\n");
    
    return EFI_SUCCESS;
}


As you can see from the above example program that I wrote, printing output using printf() is not possible. You have to use a function in the EFI libraries provided by gnu-efi, a EFI toolkit available for POSIX platforms (Mac, Linux, et al) that does the job of TianoCore, the official EFI toolkit that is only available for Windows.

So, why does the firmware for Mac Linux USB Loader need to be implemented in EFI? Simple. OS X's boot manager, accessed by pressing the option/alt key after the boot chimes, only detects EFI programs that are on external drives at the special path* of /EFI/BOOT/BOOT.EFI. So  on a machine with 64-bit firmware (all recent Macs), that file needs to be called BOOTX64.EFI.  And because OS X is not loaded, whatever program is there needs to be written in EFI.

Operating system loaders are not the only programs written in EFI. Oh no. There are EFI shells, which are like bash on a UNIX machine, except they can execute EFI programs like the one above.

More on EFI coming up soon. Happy new year, all (except to you folks not using the Gregorian calendar ;) ).

* - Well, not entirely. A file can be "blessed" with the ability to boot. OS X's boot loader does this, as it is located at /System/Library/CoreServices/boot.efi, which is not located in that special path. But I'm not discussing this further.

Monday, December 3, 2012

A Method to Boot Linux from Flash Drives via EFI on Macs and Why I Hate the EFI Support in Linux

Linux and Macs are like estranged cousins who are always a little antsy around each other. While they can trained to play together, deep down there is a deep resentment of each other. This relationship is not inherently by fault of either Linux or Apple; rather, the issues seem to lie with the hardware and firmware on Mac computers.

Sadly, the situation does not look like it will fix itself anytime soon. Macs require booting via EFI, which for all intents and purposes is horrible on the Linux platform. The only real way to boot Linux via EFI is unfortunately by hacks: GRUB 2, the rudimentary and ubiquitous Linux boot loader used on practically every installation, has working but poor EFI support, and other software like ELILO is not much better.

EFI is going to be way more common now than it was in the past largely due to Microsoft's decision to require UEFI firmware on all new PCs shipping as Windows 8 certified. So the Linux community finds it necessary to get a working EFI boot solution going quickly, but, as the video below demonstrates, everything is not all roses and unicorns:


So, what is to be done with PCs (and Macs) that are now booting via EFI? Well, I have one solution for   a common issue faced by Mac users: booting a Linux distribution from a USB drive without using rEFIt or rEFInd. Fedora seems to have something going, as shown by the following video below, which demonstrates Fedora booting natively on a Mac via EFI:

Sadly, Ubuntu and its derivatives do not have any native or supported way to boot via EFI on Mac platforms. So, I have created a tool called Mac Linux USB Loader to do just that! Open source (license pending) and on GitHub, Mac Linux USB Loader is a free application that copies a selected Linux distribution's ISO file and copy it and an EFI boot loader to the thumb drive of your choice. Best yet, it is non-destructive, which means that unlike other tools, you do not have to erase your thumb drive: all your data is preserved and untouched.

The tool has been successfully used to boot Linux Mint 14.1 from a 2 GB thumb drive. In theory, this shouldn't be restricted to Ubuntu; the only real requirement is that the distribution supports loopback. If you want to try the tool, fork the repository on GitHub and then compile the code in Xcode (binary releases will be released when the code is cleaned up a bit). Please note that the tool is in beta, is buggy, and may not work. You have no warned.

Give it a try and leave your comments/questions/thoughts in the comments below.

Tuesday, November 20, 2012

Linux Mint 14 Released Today!

The next release of the flagship Linux Mint operating system is out today, adding many features to the already well rounded Linux Mint distribution. Linux Mint is a popular Linux distro that includes codecs, Flash and Java out of the box and includes other proprietary software as well.


I did have some (slight) issues. I was affected by a bug that makes Linux Mint use the wrong video driver for the desktop, using software rendering instead of the onboard video card on my Linux testing machine. This has been fixed and Linux Mint 14 has been re-released. If you for some reason cannot update the system, here's a hack: to fix this, place the following in the file /etc/X11/xorg.conf as root at the end of the file:

Section "Device"

    Identifier "Configured Video Device"

    # Add this line to force the driver
    Driver "intel"

EndSection


Mint 14, all in all, was excellent. They enhanced the quality of the desktop background, themes, and wallpapers, and made improvements to the Cinnamon desktop.

Linux Mint 14 Nadia comes in two flavors and can be downloaded from the links below.

Happy thanksgiving all and happy holidays!

http://blog.linuxmint.com/?p=2216 -Download Link
http://www.linuxmint.com/rel_nadia_whatsnew.php - What's New in Linux Mint 14
http://linuxmint.com/rel_nadia.php - Release Notes



Thursday, November 1, 2012

A Command Line Incinerator is Now on GitHub!

A command line version of my file incinerator is now open source and on GitHub, however I have yet to choose a license for it. So if you want to contribute to making my programs a success, hop on over to my GitHub profile and improve, fork or patch my code.

Happy coding!

Please note the OS X application version of the utility will not be going open source just yet, as I still have some cleaning up to do in preparation for a near total rewrite with improved features. Stay tuned!

Monday, October 29, 2012

Ubuntu 12.10: What's there not to like?

The operating system Ubuntu has long been known for providing a safe, sleek, and elegant solution to users looking for easy to use Linux. Ubuntu 12.10 provides all that and more and gives users a convenient set of new features. Let's look at my top five favorite features of Ubuntu:


  1. Ubuntu gives users the ability to create web apps from inside the included Firefox web browser. Now there is no longer any need for remembering the URLs of some websites like Google Docs: simply visit the site, and Ubuntu will ask you if you want to install the app for faster access. Simply click Install and pin the resulting app to your Launcher and you're ready to go! This is new in 12.10.
  1. You can, from within the Dash, search for music and books with live results from your query. Don't like the privacy issues that you feel might arise? Just turn off the setting in the system preferences. This is new in 12.10.
  2. Ubuntu 12.10 adds support for EFI booting with a signed boot loader. These steps are necessary to allow Ubuntu to boot on PCs running Windows 8 with its secure boot feature.
  3. While certainly nothing new, Ubuntu One is a cloud service made by Canoncial, the same folks who make Ubuntu. They offer a large variety of intelligent services that are similar to Apple's iCloud.
  4. Finally, the new Ubuntu release reorganizes the desktop and Launcher and increases the special  effects of the desktop by enabling drivers that perform 3d calculations for the desktop on computers with integrated video cards. This means that running Ubuntu on computers with Intel graphics looks better than ever, and of course if you have things like nVidia graphics it looks even better!
I hope you enjoyed the post. You can subscribe to the RSS feed for up to date information and post comments below. Alons-y!

Thursday, October 11, 2012

File Incinerator on OS X: Nearing Completion

My file incinerator utility is nearing completion! The application now fully incinerates files, shows icons of the files being incinerated, and has many bug and security fixes. You can comment on this application in the comments below.

It is written in Cocoa and Objective-C with some C/C++ for the file incineration itself. There are some limits to the file size that this utility can erase, but it should work for most text documents, etc.

KNOWN BUGS:

  1. The "Check for Updates" menu item does not work properly.
  2. Applications as .app app bundles cannot be erased using this tool. Regular UNIX executable files do work however.
You can download this application by clicking the link below. Please note I am not responsible for any damage done with or by this tool.


Download

Tuesday, August 21, 2012

File Incinerator on OS X: Public Beta now Open!

My file incinerator, a utility that incinerates files that are selected from the users hard disc, is in the process of being converted to Cocoa in Mac OS X. Yes, this means eventually a Mac version will be available for download.

However, I really should note that it is a GUI only. The actual code that incinerates the file is not quite working yet, so it will take some take to successfully port it.

I was pleasantly surprised at how OS X handled the majority of the low-level tasks like the Spotlight and About box. Xcode, Apple's official development environment, does a good job setting the low-level stuff up for you so you can work on bigger and better things.

The public beta is open to anyone who wishes to try the application. Just click here to download a ZIP file containing the app. Because it is not signed with a developer certificate (I am not yet a member of the OS X developer program), it will not work under Mountain Lion under the default security settings.  Control-click the app, and then click Open, to grant the app a one-time security exemption.

You can install it globally to the Applications folder on the root of your hard disc, but if you have a personal Applications folder in your home directory, you can install it there so other users don't use a beta program.

Friday, July 27, 2012

Product Review: Notepad++

Imagine a super fast, sleek, and easy to use text editor that doesn't give you shit. Well, Notepad++ is it. Sleek, elegant, and easy to use, it is exactly what I like to use everyday. Inspired by Scintilla, the editor component, but written in pure Win32, Notepad++ is perfect for code editing, HTML webpage coding, and other tasks that require plain text.


Although it is only available for Windows, it runs very fast on platforms such as Linux and Mac OS X through the use of software emulation layers like Wine. For instance, it runs fairly well under OS X:


It offers support for many programming and markup languages: from ActionScript to Matlab to Fortran to C, Notepad++ does any task for me (did that seriously just rhyme)? To get the lowdown on Notepad++ go over to their website at their website. And to download it, click here.

Wednesday, July 18, 2012

Invasion Website is Live!

I have just finished putting a page on my fantastic new webpage for my game, Invasion. If you would like to try it, feel free to hop on over to the following URL:

http://www.theinvasiongames.com/

Hope to see you there!

Saturday, June 16, 2012

Beginning a FreeBSD based Operating System

Luckily for users of the computer world today, there are many different types of operating systems. While there are lots of different types out there, I feel that none of them are really that interesting to learn about. For this reason, I am embarking on an endeavor to create my very own operating system, to learn about and experiment with.

Rather than going through the arduous process of writing a custom system kernel, I will be doing something different. I recently downloaded FreeBSD (http://www.freebsd.org/), a command-line only UNIX based operating system, and will be modifying it to create my own operating system. I will using FreeBSD instead of the more popular Linux for the following reasons:

  1. It already has a proven foundation as a part of Mac OS X and 
  2. its licensing is less restrictive than the GPL frequently used under Linux.

I'll start by installing FreeBSD to a computer and configuring the network connection. From there I'll install the X Window System and a lightweight desktop environment with a custom, modified window manager and my own program launcher. From there I'll come up with a use for it and then distribute it.

Sounds simple, yet the project will test my abilities. Hopefully if all goes well then version 2.0 will be better, faster and capable of more heavy lifting. My goals for the project are:

  • Create a functional operating system with two parts: a desktop environment and an edition with only a command line;
  • Allow both versions to inter-operate, that is, an administrator on one edition can boot another user from the system, showing the usual message on the command line environment and a "Shutdown Warning" dialog box for users of the desktop;
  • Tweak the desktop enough so it is useable by users coming from all kinds of backgrounds: Mac or PC - this may mean adding to capability to allow switching from a panel based interface like Windows and most Linux desktops to one with solely a Dock-like application and panels that displays stuff like the system time;
  • And finally, create an operating system that ships with the best software that is needed to perform nearly all tasks - a web browser, file manager, etc. A few of these are already implemented in open source software.
Screenshots and development information will be posted as needed, and when it is available. Eventually, but not in the near future, beta testing will commence. I'll see you there.

Tuesday, June 12, 2012

Mac Attack!

I recently obtained a MacBook loaded with a copy with Mac OS Lion (10.7). I will hopefully send more information on it in the near future. It's set up with Xcode and ready for development work! Software porting, here I come!

Sunday, May 27, 2012

Invasion: Alpha 3

Here is the ultra-fabulous alpha version three of my FPS video game, Invasion. It contains bug fixes, improvements and increases general ease of use. There is a build for both Windows and Intel-based Mac OS X computers (using OS X 10.6+ and/or Windows 7 is recommended). Unfortunately, Linux is currently not fully supported due to restrictions in the underlying game engine.

DOWNLOAD 

Unity Forum Topic


Details:
  1. Improves on overall performance and security
  2. Upgraded Unity Engine version
  3. Improved Windows executable size (may have increased memory requirements)
  4. Light mapping
  5. Overall scene improvements; upgraded character voices on 2nd mission; other fixes
Screenshots:


Tuesday, May 22, 2012

The New Linux Mint!

The team behind Linux Mint, a user-oriented Linux distribution, has released recently version 13, codename Maya, of their Linux distribution. Upon downloading the 32 bit edition, I jumped right in in a few days.

I'm very impressed. Linux Mint, based on the technology of Ubuntu, the third most popular operating system in the world, Linux Mint replaces the slightly buggy Gnome 3 desktop in version 12 with a new, streamlined interface. Here's a picture of the new desktop after I added a new panel to the top of the screen and changed the default desktop image:

As with previous versions, you can have multiple workspaces, emphasized by the workspace switcher at the top-left of the desktop. Simply click, and you have a new workspace. It's like having multiple monitors in one monitor.

One thing I love about Linux is your ability to customize where everything is. Oh, sure, in Windows and OS X you go get a certain amount of customization, but Linux, being owned by no one and for the world to share, caters to whatever you like. Want the widgets on the top, like they are in OS X? I'll move the clock, just to demonstrate:
And the interface for adding changing where everything goes:

Linux Mint, being free software, is contributed to by many of people from around the world, hoping to create the ultimate desktop OS, and is currently the number version of Linux on the market (http://www.distrowatch.com).

And this is just the Gnome desktop. You can install others, like KDE (an alternative to Gnome) and Xfce (a small, lightweight desktop) to name a few, from packages available once Linux Mint is installed.

Linux Mint can be the sole operating system on a computer, or partitioned to play along with Windows and OS X. In fact, the CD version (containing less applications so it can fit on a standard CD-ROM), contains a Windows installer so the Linux Mint can be tried and then removed from Add and Remove Programs if it doesn't suit your needs. No partitioning necessary.

Linux Mint is available in the form of an ISO image file at its official website. Linux Mint 13, the one reviewed here, can be found here, this is a direct download link to the version I used.

Wednesday, April 18, 2012

Simple Document Viewer: A Help Utility for My Projects

Considering I’m starting a large toolkit of tools for computer users, I’d figure I’d start by posting about my newest complete utility: a Simple Document Viewer designed to view online help for the rest of my toolkit in a fast and efficient manner. It renders pages in basic HTML, sadly CSS is not supported. I was going to add the Firefox renderer in, but that’s too large for my purposes here.

Here’s a screen capture:

screenie2

As you can probably see, its GUI is more sophisticated and involved than that of my simple File Incinerator tool. It consists of the standard back and forward navigation buttons, as well as an HTTP address bar. This address bar, however, is most likely going to be removed and replaced with a label showing the current address. The drop-down options dialog box is used to view the About text as well as choose the application of which help will be displayed.

Any comments on how the GUI looks will be much appreciated and welcome in the comments form below.

Thursday, April 12, 2012

Mint Linux: The Open-Source Future!

I just downloaded Linux Mint, one of around 300 active Linux distributions, onto a Live CD which I can boot from. I played with it, and really love it. I think that Linux is a fine and dandy OS. The first time I used it, I went like lightning. It did go a bit slower the second time, because I tried to download a bunch of stuff from the built-in package manager, even though it was running on a DVD.

I had to plug it directly into my Internet, and when I did, bang! Firefox was the fastest I’ve ever seen it. On my first run-through, I also played music directly from my Windows drive, which was great.

I’ll post screenshots in the future. You can download Linux Mint at http://linuxmint.com/.

Thursday, March 29, 2012

Invasion Alpha 2 Released!

DOWNLOAD

The download link is above. Thanks to MediaFire for providing hosting! Also, you can see the Unity forum topic if you want to post there.

Saturday, March 24, 2012

File Incinerator

Have you seen large pizza vans with small, opaque windows? That same van has been following for ages? Getting that weird feeling from your gut someone’s watching?

You need File Incinerator, a new tool by me. It securely shreds file so there’s no trace of them on your disc. Soon enough, you’ll want to get rid of something securely: only something my tool can do for you.

So Why Do I Need It?

Excellent question. When you delete a file, it isn’t actually gone. Using tools like Recuva, it is possible to go over a seemingly empty disc and potentially recover loads of files.

So It Removes any Trace of the File on My Disc?

Indeed it does, though this is not guaranteed. Due to the way the operating system handles files, it may be possible for some file data to remain – but likely not. So in all honesty, you probably have nothing to worry about.

Where Can I Find It?

You can find a command line version for Windows and Macintosh computers in the attached archive. A graphical user interface (GUI) version is nearing completion for Windows, but has not been started for Mac OS X.

Is This Illegal?

No. Incinerator works by writing over the selected file with random pieces of information equal to the size of the old file. All technology utilized in this software is legal, but how you use it is up to you. Just keep in mind I’m not responsible for how you use it.

Can I See Screenshots of the GUI?

Sure:

screenie1

A screenshot of the basic, beta version of the GUI. The progress bar is not functional as of this time.

I hope you enjoy what you see.

What Are Your Planned Features?

Here’s a short list of planned features and how likely they are to be added:

  1. Secure Empty Recycle Bin: Emptying the recycle bin only regularly deletes the file, so anything in there will be recoverable. Incinerator will soon be able to overwrite all files in the recycle bin. Likelihood: Excellent
  2. Ability to customize the deletion process through the GUI. This can already be done through the command line version as a command line argument passed to the program (up to 32 iterations is supported). Likelihood: Good
  3. Ability to incinerate the file, but not delete it (i.e allowing you to inspect its contents in a program like a Hex Editor). Likelihood: Good

Download:

You can download the files below in this ZIP archive.

 

Thursday, March 22, 2012

Invasion Coming Along!

Invasion is coming along nicely and the next build will be here soon! Screenshots will be posted very soon – hold on top of your hats!

Thursday, January 26, 2012

Invasion Alpha Was a Success!

So far, the alpha I released on this blog had over 87 downloads and 271 views on that blog post! We received a lot of information regarding the game and what we should be doing, as well as what bugs can be fixed and the like.

In short, I am pleased how well this has gone, and in the future I hope to very shortly release the next chapter – the next alpha version – of the FPS. In the next alpha release, the map will take place in an underground sewer location. And no assets will be reused from the Unity sewer tech demo; it will be all a custom map. :)

Here’s a few photos of the new map in progress. Please note there is no light mapping just yet, and the scene looks sort of plain because shaders haven’t been applied yet.

screenie4

A large room, with a siren.

screenie5

One of the many long and expansive corridors.

At some point or another, most of the gun models will be revamped, and some scrapped totally and replaced. Also, a video will hopefully be uploaded at one point or another, but no guarantees. I’m going to keep you updated like this because it’ll awhile before the next build distribution.

If you don’t like the quality of the maps, suck it up; They’ll look a bit better later with tweaks and visual improvements.

Friday, January 20, 2012

Alpha 1 of Invasion Released!

Hello, everyone on the Internet and beyond. Another small post today where I’m going to discuss my FPS game that is currently in development with Unity Beta 3.5. The game’s overall concept I cannot yet disclose, but rest assured it is worth the wait.

The release is in the Alpha version and may contain bugs. There is only a single level, but aware there is more content than what’s in the download. I simply didn’t wish to put it all in there. For example, one feature in the works is the ability to drive on the backs and tanks and copters.

To download, please use the following link:

Download-Now-button

Thanks, and if you have any comments, please either comment here or on the Unity forums, if you’re a member. Some screenshots follow:

 

screenie1screenie2screenie3

Saturday, January 14, 2012

Drumroll Please…

The public beat of the First Person shooter project I’m working on will be open soon! Check back frequently for updates, as a public beta will be open soon!

Wednesday, January 4, 2012

Self-Deleting Executable

I wrote a program the other day.  When you run it, it deletes itself.  Yay, but not as easy to accomplish as you might like.  So, with that in mind I’m going to give you all the source code to such a marvel.  It only works on Windows because it utilizes Window’s libraries.

 

   1:  /*
   2:   * This program produces an executable file that, when run, deletes itself from the hard disc.
   3:   * Author: SevenBits
   4:   */
   5:  #define WIN32_LEAN_AND_MEAN
   6:   
   7:  #include <windows.h>
   8:  #include <tchar.h>
   9:   
  10:  int CommitSuicide(char *szCmdLine)
  11:  {
  12:      //Define variables.
  13:      HANDLE hTemp;
  14:      char szPath[MAX_PATH];
  15:      char szTemp[MAX_PATH];
  16:   
  17:      static BYTE buf[1024];
  18:      
  19:      STARTUPINFO si;
  20:      PROCESS_INFORMATION pi;
  21:      UINT ret;
  22:   
  23:      //Open a temporary file.  Copy ourselves into that file.
  24:      GetTempPath(MAX_PATH, szTemp);
  25:      lstrcat(szTemp, "suicide.exe");
  26:   
  27:      GetModuleFileName(0, szPath, MAX_PATH);
  28:      
  29:      CopyFile(szPath, szTemp, FALSE);
  30:   
  31:      hTemp = CreateFile(szTemp, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE, 0,
  32:          OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, 0);
  33:   
  34:      //Create a process using the temporary executable. This will cause
  35:      //the file's handle count to increase, so we can close it.
  36:      ZeroMemory(&si, sizeof(STARTUPINFO));
  37:      ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
  38:   
  39:      ZeroMemory(&si, sizeof(STARTUPINFO));
  40:      si.cb = sizeof(STARTUPINFO);
  41:   
  42:      lstrcat(szTemp, " ");
  43:      lstrcat(szTemp, szCmdLine);
  44:   
  45:      ret = CreateProcess(0, szTemp, 0, 0, FALSE, NORMAL_PRIORITY_CLASS, 0, 0, &si, &pi);
  46:   
  47:      //Close our handle to the new process. Because the process is
  48:      //memory-mapped, there will still be a handle held by the OS, so
  49:      //it won't get deleted. Give the other process a chance to run..
  50:      Sleep(100);
  51:      CloseHandle(hTemp);
  52:   
  53:      return 0;
  54:  }
  55:   
  56:  //Don't start the file in main() but here, as this program can avoid the overhead of a main() function.
  57:  int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, PSTR szCmdLine, int iCmdShow)
  58:  {
  59:      char szPath[MAX_PATH];
  60:   
  61:      //
  62:      //    Parse the command line:
  63:      //    Normally, we should not be run with any parameters.
  64:      //    We re-spawn ourselves with the current module's path.
  65:      //
  66:      if(szCmdLine[0] == '\0')
  67:      {
  68:          // Spawn a duplicate process, and tell it to delete us.
  69:          HMODULE hModule = GetModuleHandle(0);
  70:   
  71:          GetModuleFileName(hModule, szPath, MAX_PATH);
  72:   
  73:          CommitSuicide(szPath);
  74:          
  75:          // Exit normally
  76:          return 0;
  77:      }
  78:      //    This is where we pick up execution second time we run,
  79:      //  When a filename has been specified on the command line
  80:      else
  81:      {
  82:          // Give the calling process time to exit...
  83:          Sleep(200);
  84:   
  85:          // Delete the file specified on command line.
  86:          DeleteFile(szCmdLine);
  87:   
  88:          // Exit normally. When we close, this executable will be automatically deleted.
  89:          return 0;
  90:      }
  91:  }    



Innovative? No.  Something new? No. But it’s a lot harder to do for beginners than one might think.  Feel free to use this code for whatever you desire.