An unexpected Windows?

by Matt 4. December 2007 11:07

Hey, good timing. I'd wanted to follow up on this and point out a few links and stuff, and hot on the heels of looking at how Windows can run UNIX programs comes the news that the UNIX-based OSX has some vestigial code to handle Windows programs. It doesn't seem to do anything too interesting at the moment, but it does recognise the Windows PE executable file format, and it even appear to try and load Windows dlls. Rumours abound that it's the first steps to getting OSX to be able to natively run Windows applications.

I love this idea - it's kinda obvious and counter-intuitive at the same time. Conventional wisdom states that you simply can't run a Windows binary on UNIX - they are different OS's, after all. But it's also just x86 code, so why shouldn't you be able to run it?

Of course, it's going to be more complicated than just running x86 code - there's a whole bunch of system services that need to be available, including COM, the registry, the file system layout, the clipboard, etc.

But it's not a new idea. Wine has been running Windows apps on UNIX-like machines for ages. Wine isn't like Interix. It's a compatibility layer, and works in a number of different ways. They have reimplemented a load of Win32 dlls that retarget the calls to the underlying UNIX OS, so you don't need Windows installed (they've even implemented DirectX!). Or you can optionally use native Windows dlls. Or simply recompile against their libs to get source code compatibility. But binary compatibility is the main draw.

A similarly herculean effort exists in the other direction - Cygwin. Their home page nicely states what it is, and what it isn't. It's different to Wine, in that it's a source code compatible UNIX environment. You can't take a UNIX binary and just run it (just as in Interix). And it's different to Interix in that it's a compatibility layer built on top of Win32, rather than it's own subsystem, and so it inherits the constraints of the Win32 platform, constraints that Interix can avoid. A nice example of which is fork. Fork creates a copy of a process, including address space. Win32 has no such concept, but (and Google is failing me for backup, here) Interix has full support for fork, because the Windows NT kernel has full support for fork. Similarly, NTFS was designed to support POSIX requirements, such as group ownership, hard links and of course, case sensitivity. These concepts aren't available to Win32, so also aren't available to Cygwin apps.

Cygwin has it's drawbacks, but it has good things too. By running in the Win32 subsystem, it has access to GDI, and so a port of the X Windows Server is possible. Interix can't display graphics, and so has to rely on a full Win32 port, such as Xming. But most important is the simple fact that Cygwin Actually Works. This is huge in and of itself. It's very popular, and has a massive range of ports, and autoconf support means porting should be very easy. In fact, it's so popular that it has better support of ported apps than Interix, and should really be considered the de facto standard for running UNIX apps on Windows.

So why do I prefer Interix? Well, that's easy. It's cooler in a far more geeky way. Cygwin's clearly done incredibly impressive stuff, but (with the greatest of respect) it's a big hack. Interix is a much cleaner way of doing things. Take how the Windows file system is exposed, for example. In Cygwin, you get to your standard driver letters (C:, D:) via /cygdrive/c or /cygdrive/d, and network paths, such as \\server\share\dir are available as //server/share/dir. Interix exposes them in a slightly more UNIX friendly /dev/fs/C, /dev/fs/D and /net/server/share/dir. A minor thing perhaps, but I like it.

(But then I also like Cygwin's /proc/registry.)

Right, quick link-fest. The Interop Community site is a semi-official site that has a bunch of forums, faqs, tech notes and provides a package management system for a whole heap of extra utilities, including recent versions of the GNU utilities (and it's managed by Rodney Roddick, one time Interix dev). Alternatively, you can download packages from NetBSD or Debian. Another previous dev has a great techy white paper for download. And there's even a blog.

And now I'm back off to my command line.

Ctrl-D.

Tags:

Comments (21) -

cabernet
cabernet
4/26/2011 3:06:03 AM #

I really love the information here on your website.

Reply

Kirby Richey
Kirby Richey
5/12/2011 2:50:48 PM #

It is a particularly appealing write-up.  It is very educational and also you have obviously done your preparation leading up to crafting this unique write-up.  I will need to keep coming back and browse your upcoming articles.

Reply

casinos en lignes
casinos en lignes France
7/19/2011 11:18:32 AM #

Aw, this was a in genuineness warm-hearted post. In hypothesis I would like to put in writing like this additionally � taking things and manifest venture to force a  very ample article� but what can I claim� I procrastinate alot and around no means seem to manipulate something done.

Reply

best suv reviews
best suv reviews
7/20/2011 10:32:37 PM #

Per il tuo bambino scegli Moncler. Una scelta di capi, estivi ed invernali, eccezionali. Tuo figlio sarà sempre alla moda e potrà muoversi in totale comodità.

Reply

suv comparison
suv comparison
7/20/2011 10:39:49 PM #

hi!,I like your writing so so much! proportion we communicate extra about your post on AOL? I require a specialist in this area to unravel my problem. May be that's you! Taking a look forward to see you.

Reply

best hybrid cars 2011
best hybrid cars 2011
7/22/2011 3:58:28 AM #

I wonder if he cheated on her? I remember he cheated on his previous wife with JLO so it wouldn’t be surprising.

Reply

direct loans consolidation
direct loans consolidation
8/2/2011 8:53:36 PM #

Is it ok if I quote your article in my monthly newsletter? I would think this article suits my topic perfectly. Well ya, thanks for posting this article.

Reply

philix
philix United States
11/20/2015 6:33:32 AM #

Good Web Site

Reply

Jared Teteak
Jared Teteak United States
1/15/2016 4:34:22 AM #

Well good for you! I have a lot but one I just thought of was when you lick a crease of paper so that it'll rip in a straight line and it actually tears in a frayed straight line rather than rips awkwardly. I love that bleachy taste and that bleachy satisfaction.

Reply

Cornelius Styborski
Cornelius Styborski United States
1/15/2016 4:58:42 AM #

Thaaaat IS awesome! lol hehe

Reply

Jose Bacone
Jose Bacone United States
1/15/2016 8:31:20 AM #

The dolphin saving you one is the best one!

Reply

Jamison Gerraro
Jamison Gerraro United States
1/15/2016 8:32:28 AM #

Congrats! This is such a great website, I know it will translate well into book form. Which is AWESOME!

Reply

Wilton Megeath
Wilton Megeath United States
1/15/2016 8:54:40 AM #

Congrats! So glad to see this site getting the recognition it deserves, the world can always use a little more awesome.

Reply

Lauren Krings
Lauren Krings United States
8/25/2016 4:13:46 AM #

Hi I'm appreciating the time and energy you put into your blog and informative information you did. It’s awesome to come across a post every once in a while that isn’t the same out of date rehashed information. Cool read! I’ve bookmarked your site and I’m including your RSS feeds to my Bing account.

Reply

Deetta Norat
Deetta Norat United States
3/27/2017 3:27:58 AM #

This is a awesome website with some great information

Reply

Luanne Chiem
Luanne Chiem United States
5/22/2017 7:52:23 PM #

Thank you for this video

Reply

Laurette Emmerich
Laurette Emmerich United States
5/22/2017 8:04:32 PM #

Thank you for this video

Reply

Jackie Paga
Jackie Paga United States
6/10/2017 6:29:35 PM #

check it out

Reply

eliminar acne
eliminar acne United States
10/14/2017 7:21:56 PM #

Thanks for sharing excellent informations. Your website is very cool. I'm impressed by the details that you've on this website. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for more articles. You, my pal, ROCK! I found simply the info I already searched everywhere and just couldn't come across. What a perfect website.

Reply

Carmen Milito
Carmen Milito United States
7/20/2018 8:18:21 AM #

good stuff. I will make sure to bookmark your blog.

Reply

Louise Heverin
Louise Heverin United States
7/21/2018 9:17:04 AM #

sound like you know what you?re talking about! Thanks

Reply

Add comment

biuquote
  • Comment
  • Preview
Loading

Rel=Me

Month List

RecentComments

Comment RSS