Portal und andere Spiele …

Sa, 22 Mai 2010 00:02:46 +0200

… werden jetzt ja dann wohl in größerer Zahl auf Mac OS Portiert, und damit bleibt zu hoffen, dass man sie dann leichter auf Linux portierbar beziehungsweise emulierbar/virtualisierbar sein werden, denn die Grundlagen beider Systeme sollten doch näher verwandt sein.

Jedenfalls stiefelte ich heute Windows auf meinem neuen Denkblock. Konfigurierte Ubuntu auch gleichzeitig so, dass es virtualisierbar ist unter ebendiesem Windows, sodass nicht nicht mehrere Logs und Feuerfuchsprofile maintainen muss. Lief auch alles wunderbar.

Steam startierte und brauchte lange um Portal herunterzuladen und nachdem es dieses endlich fertiggetan hatte stürzte es erstmal gepflegt ab. Nach einem Neustart und dem versuch, Portal zu starten, klärte es mich auf, dass es meinen Grafikchip nicht kennen würde. Durchaus möglich, es ist nicht der Neueste, und dementsprechend Überrascht war ich, als dann das Spiel doch loslief und ich mit relativ wenigen aber eben immernoch daseienden Rucklern anfangen konnte zu spielen.

Die Ruckler waren nervig, und so wollte ich die Bildqualität heruntersetzen, was zu einem prompten Absturz führte, und vor einem kompletten Systemneustart schaffte ich es auch nicht das Spiel wieder zu starten. Danach stellte ich alles wieder um, in der Hoffnung, danach würde das Spiel wenigstens wieder im vorherigen Zustand sein. Was soll ich sagen, das Spiel hängte sich auf und lastete einen Prozessorkern voll aus, sodass ich mich gezwungen sah, es zu keksen.

Erst dann wurde mir plötzlich klar, was ich da eigentlich gerade tue: Ich versuche ein Windows-Spiel unter Windows zum Laufen zu bringen. Ich, der ich garnicht Windows verwenden will, und Windows nur boote, weil ich ein Spiel spielen will, strenge mich an, damit dieses Spiel funktioniert. Überhaupt gibt es wenig Gründe für mich, ein Windows-System zu starten. Ich habe mein Ubuntu – und wenn mir das nicht mehr gefällt habe ich Arch Linux. Und wenn mir selbst das nicht gefällt werde ich auf Solaris oder ein BSD umsteigen.

Ich muss mich also auch noch anstrengen, damit ein Spiel, das ich zumindest theoretisch gekauft haben könnte, unter einem kooperativen System läuft. Interessant. Selbstverständlich überlege ich mir nun also zweimal, ob ich mir wirklich eines der kostenpflichtigen Spiele kaufe. Ich hatte schon mehrere Spiele im Sinne, oft auch ältere, nur ist bei denen nie so klar ob sie unter Wine wirklich gut laufen – und bei etwas älteren Modellen ist selbst nicht klar ob sie auf einem modernen Windows gut laufen.

Ok, bevor ich gleich damit anfange, was ich am Verhalten der Spielehersteller alles nicht verstehe, erstmal eine Liste mit Dingen die ich verstehe – nur des guten Willens wegen:

  • Ich verstehe, dass sie ihre Spiele – wenigstens am Anfang – nicht Opensourcen. Kopierschutzmaßnahmen werden durch Open Source nahezu unmöglich. Außerdem steckt in einem Spiel mehr Interesse als bloße Software. Es ist ein Gesamtkunstwerk und man will freilich nicht dass Leute es bereits umschreiben bevor sie es überhaupt sinnvoll gespielt haben.
  • Ich verstehe, dass sie DRM-Maßnahmen ergreifen wollen. Ich finde es nicht gut, vor allem, weil die ganzen DRM-Lösungen so beschissen implementiert sind, aber ich verstehe es.
  • Ich verstehe, dass den Spieleherstellern OpenGL ohne diverse Erweiterungen nicht ausreicht.
  • Ich verstehe, dass Spielehersteller nicht die Portierung auf Betriebssysteme bezahlen wollen, die nicht hinreichend verbreitet sind.

Ja, so viel kann ich verstehen. Jetzt kommt dann mal, was ich nicht verstehe:

  • Ich verstehe nicht, dass sie nicht wenigstens Teile ihrer Spiele oder der verwendeten Spieleengines soweit offenlegen, dass die Geeks sich das Spiel entsprechend selbst portieren können. Der Hauptanteil des Unportierbaren sind wohl die direkten Hardwarezugriffe auf den Grafikkartenspeicher, beziehungsweise die niedrigstufigen Aufrufe der Grafikbibliotheken. Diese kann man ersetzen. Man kann jedenfalls der Wine-Community (die immerhin für eine Portierung auf mindestens 4 zusätzliche Betriebssysteme arbeiten würde) die Arbeit erleichtern durch Zusatzangaben.
  • Ich verstehe nicht, warum die ganzen DRM-Maßnahmen so beschissen programmiert sind. Wie wärs mit: Der Maschinencode ist Verschlüsselt und kann nur mit einem entsprechenden Schlüssel entschlüsselt werden. Und das auch nur indem man ihn meinetwegen irgendwo in den heap speichert und dann an eine definierte Speicherstelle springt. Irgendwas von der Form „ich schau regelmäßig im Internet nach ob du mich spielen darfst“ sollte man jedenfalls leichter wegcracken können. Letztendlich kann man alle Kopierschutzmaßnahmen aber irgendwie umgehen, wenn man ein irgendwie offenes System haben will – und damit meine ich nicht Betriebssystem sondern schon sowas von Wegen nicht so einen komplettgeschlossenen Krampf wie das iPhone oder sowas (und selbst das wird gejailbreaked …).
  • Ich verstehe nicht, warum Spielehersteller und Hardwarehersteller Microsoft so dermaßen in den Arsch kriechen, dass sie sich auf DirectX einlassen. Ich sage nicht, dass DirectX irgendwie extrinsisch schlecht ist, aber es ist intrinsisch schlecht weil nicht Portabel. Als Spielehersteller will ich mich doch nicht Abhängig machen von der Grafikbibliothek eines bestimmten Unternehmens, und schon garnicht von dessen Betriebssystem, an dem dieses Unternehmen wild rumbasteln kann ohne mein Einverständnis. Gleichermaßen will ich das doch als Hardwarehersteller nicht. Im Grunde ist der einzige Sinn von 3D-Grafikkarten auf Heim-PCs, dass man mit ihnen Spiele spielen kann. Das heißt, die Spiele wollen im Wesentlichen an die Grafikkarte, die Grafikkarte will im Wesentlichen an die Spiele, Windows ist nur ein Kleber dazwischen, und die Schicht soll möglichst dünn sein. Wieso tun sich nicht die verschiedenen Spiele- und Grafikkartenhersteller zusammen und machen eine eigene Infrastruktur auf – ich meine, sie müssen doch eh Treiber schreiben, so viel mehr Aufwandt kann das doch nicht sein. Vor Allem das Ganze dann einigermaßen Portabel aufzubauen sollte doch gehen. Immerhin ist doch die Rechenleistung selber selten der Flaschenhals, sondern eher die Grafikleistung.
  • Ich verstehe nicht, wieso jemand Spiele auf Macs portieren will. Einen Mac kauft man sich nicht um Spiele zu spielen. Man kauft ihn sich um mit Mac OS X zu spielen.

Jedenfalls werde ich jetzt also weiterhin lieber versuchen, das Ganze unter Wine zum Laufen zu bringen. Ich glaube die Zeit ist sinnvoller investiert. Spielen kann ich eh vergessen im jetzigen Zustand.


Package Managers

So, 14 Feb 2010 18:43:43 +0200

A myth about Linux which hardly goes away is that the installation of software is much harder than under commercial operating systems. Of course, the installation of a Linux-System itself is a hard nut to crack. Firstly, you have to chose your distribution – which can become one of the hardest tasks about the linux installation at all. Then, after choosing one distribution, making it run and support all the hardware you have is a complicated (and sometimes – expecially for new or extremely cheap hardware – even impossible) task. But installing actual software is usually no big deal. Every distribution has its package manager with a lot of packages, and mostly it either takes one short shell command or a few klicks in a friendly GUI to install the software you want.

Its just that … most people changing from a commercial desktop-os to a linux distribution expect that they have to download the software they want from somewhere. And they expect the software to take care of its own updates. And they are trying to do the same under Linux, and – since compiling and installing software by hand is really complicated for a newbie – they fail.

On the other hand, the package management systems are very convenient for both users and developers, and many commercial software is already distributed in package form, and some vendors (like Sun) even maintain package-repositories for dpkg and rpm for some of their Linux-Software.

Meanwhile, the installation process under Mac OS X is complicated and chaotic. You (mostly) have a dmg-Image, which (mostly) contains anything you need to install – sort of. Sometimes you just have to copy one app-file somewhere else where you can run it, sometimes you have to open (and run) a pkg-file and go through dialogs, sometimes you have to open the app to download the rest of the software, sometimes the app installs itself and then runs as the ordinary app, etc. Sometimes, you get a zipped pkg-file. Sometimes, you get a zipped dmg-image. Sometimes, you get a sitx-archive. Sometimes its enough to just delete the app-file to uninstall it, sometimes there are special uninstallers which you have to find and run, sometimes you have to manually delete directories.

I could tell similar stories about Windows, but at least under Windows, most software either comes with an installer that registers itself so Windows can find the uninstaller, or installs an uninstaller somewhere in its menu-folder, or doesnt need to be installed at all and can just be run directly.

Well, the situation is definitely not better, if not even worse than under most Linux-Distributions. But nevermind, at least both Windows and Mac OS X have some central registry for installed software to register. And both do have an integrated update mechanism for themselves. I wonder why then every software searches for updates itself. Why doesnt Microsoft or Apple just define a default protocol for upgrade searching, and provide a central update-search mechanism for all the installed programs?

Like – just downloading an RSS-Feed and passing it to some defined procedure or so?

Well, Windows seems to have an integrated package management for its components, at least there is some „pkgmgr.exe“ – but I dont actually know whether its just for Windows-Components or can be used for other software as well. In the latter case, I dont understand why so many software packages (Firefox, Adobe Reader and Flashplugin, Java RE, Apple BootCamp, etc.) have their own update scanners instead of using this one.

And many of the installers and update scanners are either not working properly, or getting on my nerves trying to remind me that the software they are upgrading is installed. And some of them are just linking to upgraded versions which install themselves, etc. – I think thats really annoying.

But well, also the existing package managers on Linux, Solaris, FreeBSD, etc., lack of some features I always waited to see. One thing we could learn from Windows and the app-Files from Mac OS X is to put anything you need into one directory, localized nearby the application itself, and thus not producing that much problems with colliding dependencies between versions (and architectures) of software. Having some sort of copy-on-write-hardlink for this would also make it possible to install one library into many directories without significant loss of space.

And – something I also dont like – often you have postinst and postrm scripts which are running binaries. There is nothing wrong with this, but on the other hand, these scripts tend to do a lot of complicated stuff, and if they fail, the package management itself cannot really undo what they have done, and their postrm-scripts get confused. Its nothing bad to have postinst and postrm scripts (in fact, in some cases it is necessary), but a good package system should provide a lot of additional possibilities for dependent configuration settings, etc., to make this unnecessary for as many cases as possible.

Well, package management is a complicated thing, and a solution for it always has to balance between not having a dependency handler at all and having a turing complete solution which gets easily confused or ist likely to be unusable. The main difficulty is – as far as I saw so far – to make the packaged software integrate itself in the package management. Is this really such a hard task for commercial software on a commercial OS?


Randomly Found Software: Unetbootin – generating bootable USB-Sticks under Windows

Sa, 13 Feb 2010 02:19:00 +0200

So far, I always had to use some VM under Windows to create bootable media with linux or something. For example, I just had the problem to set up an USB-Stick for my thin client with some Linux with a running X-Server. But under Windows, well, I wouldnt even be able to edit the contents of that stick with a hexeditor. Searching for something else, I found Unetbootin on some Ubuntu-Site, which described how to set up a live usb-stick under windows.

This software can download the proper files to set up such a stick (and a variety of other distributions). I downloaded Xubuntu myself and passed the .iso-file to it.

Well, for some reason, sometimes it fails. But now finally it worked and I am currently writing this through rdesktop on that stick. Nice.

On the other hand, I still wonder how one can access Block Devices in Windows programmatically. I already found NT-IFS for Filesystem Creation and some Driver SDK for Block Devices (I think). But I just cannot find an API for listing and accessing block devices.


Randomly Found Software: Mintty

Mi, 30 Dez 2009 00:20:05 +0200

I already knew that there is such a software, but finally now I found it again: Mintty – an alternative Terminal Emulator for Cygwin.

Per default, Cygwin uses Windows‘ cmd.exe, which is a bit harder to use, especially when it comes to resizing and copypasting. That is, normally I use xterm, but therefore, have to start Cygwin/X, even for small programs that run in the console. Seems like Mintty aims to solve this problem, and seems like it does well so far. You can copypaste and use it like an XTerm, without having to start an X-Server.

Installing is comparably hard, as I couldnt find a binary download, I had to compile it under cygwin and copy it into the cygwin-path and adapt my cygwin.bat – and still, a cmd.exe is opening in the background – I can close it immediately, but its not nice that it opens anyway. Thats the new content of my cygwin.bat:

@echo off

C:
chdir C:\cygwin\bin

mintty -e bash --login -i

Anyway, this is a piece of software I will certainly use more often when using Cygwin. On the other hand, I am currently using Mac OS X mostly – so this is unlikely.


BootCamp-Windows under VirtualBox

So, 27 Dez 2009 20:31:58 +0200

Now my VMWare Fusion Testing-Period is over. What a pity. Well, I was thinking about buying it, because its an excellent piece of software, especially because it supports BootCamp-Windows on-the-fly. But with a price of $80 (or $35 for an older version for students) it is not really cheap. I thought it has a good support for 3d-graphics, DirectX, etc., but it only supports a few games – as VirtualBox and Parallels does. It seems to heavily depend on the used solution and how it is implemented. Of course, Parallels and VMWare Fusion are supporting a lot more games, but on the other hand, well, I am not sure if thats worth it.

Since I wanted to reorganize my whole system setup in the next days, I risked losing data and tried to virtualize my BootCamp-Windows with VirtualBox. And so far, it seems to work perfectly – I tried it with Windows 7.

The first problem I had was to determine which Partition Windows actually is.

$ mount

was telling that /dev/disk0s3 was mounted on /Volumes/BOOTCAMP, i.e., this is my device. So first,

$ sudo umount /Volumes/BOOTCAMP

unmounted the device. Then well, the device belongs to root – so

$ sudo su -
# VBoxManage internalcommands createrawvmdk \
 -filename win7bootcamp.vmdk -rawdisk /dev/disk0 -partitions 3

This command creates two files win7bootcamp.vmdk and win7bootcamp-pt.vmdk. Copying them into my home-folder and chowning them to my user-account makes these files readable (and writable) for VirtualBox in the user-mode. But, of course, it doesnt make the Device itself accessible. Therefore, I had to do

# chown username /dev/disk0s3

before starting VirtualBox. This – of course – is highly dangerous, since any usermode-process can access that Partition now. Now I started VirtualBox, and created a new VM with the Boot-Disk set to this win7bootcamp.vmdk. Then I started it and waited until it boots. As soon as VirtualBox has opened the device /dev/disk0s3, I changed it back to

# chown root /dev/disk0s3

From this time on, no other usermode-process should be able to access it again, but VirtualBox – since it has to keep it open – wont lose the ability to access it.

Ok, so far thats the procedure to actually get VirtualBox using the BootCamp-Partition. It booted – slowly. Actually, during the boot period, it seemed like VirtualBox would freeze, but it was only frozen for a few seconds. But after that, it really worked well. Windows Quickly recognized the new Hardware and installed Drivers for all it could find. I waited for this, but didnt restart, but installed the VirtualBox Guest Extensions. Then I restarted. W00t4ge – it worked perfectly (except that I couldnt restart – because VirtualBox seemed to close /dev/disk0s3 while rebooting, which means that I had to chown it again – i.e., restarting doesnt work, you have to shut down, and then boot it again).

Ok, but now, with all that new drivers and stuff, it works under VirtualBox, but does it also work when booted natively? – Yes. It does. It works perfectly so far, for me. To boot it under Mac OS X, I always have to do the procedure of

$ sudo chown username /dev/disk0s3

starting VirtualBox and Booting Windows, and then

$ sudo chown root /dev/disk0s3

again. Well, its less convenient that Parallels and VMWare. But its enough for me, and its better that paying 80$ for features I wont use. I wonder why VirtualBox doesnt support this per GUI. I mean – its comparably easy, it shouldnt be too hard to implement a GUI for that.

Just a Disclaimer: I was just trying this, because I couldnt find any tutorial or website describing how to do this or whether its possible at all. I didnt use it for a long time, and I cant say anything about a possible data loss. So if you are trying the same thing, well, you are doing it at your own risk.


VMWare Fusion – die wahrscheinlich erste Mac-Software die ich mir kaufen werde…

Sa, 28 Nov 2009 03:14:49 +0200

… Denn wie ich schon schrub benutze ich atm hauptsächlich Windows. Und ich bin mir relativ sicher, dass das noch häufiger der Fall sein wird, bzw. dass häufiger die Notwendigkeit bestehen wird, mehrere Betriebssysteme zu nutzen. Denn es gibt immer, für so ziemlich jede Aufgabe, irgendeine Sache die mich an irgendeinem der drei Betriebssysteme wirklich nervt.

Nun kann man aber VMWare so wunderschön nutzen um BootCamp-Partitionen virtuell zu Booten, die man aber auch gleichzeitig nativ booten kann. Ein klarer Vorteil zu VirtualBox – wo man das zwar auch hinbekommt, aber nicht ohne erheblich größere Anstrengungen (aber vielleicht schreibt ja irgendwann mal jemand sowas).

Momentan renne ich die Testversion. Mal schaun wo ich günstig eine Lizenz kaufen kann.

Sobald ich Zeit habe richte ich mir dann vielleicht unter Windows noch einen VMWare Player ein, sodass ich eine Linux-VM unter beiden Systemen verwenden kann. Auf ein natives Linux muss ich dann leider verzichten, aber ich denke, das kann ich auch ganz gut, denn Linux ist so modular eingerichtet, dass es die Vorteile der Virtualisierungslösungen auch wirklich ausnutzen kann. Außerdem ist es ohnehin nicht ganz trivial Linux auf dem Mac nativ laufen zu lassen – es geht, und ich fand es auch ganz gut, aber es kann, wie man mir sagte, der Hardware schaden, da Apple der Software ziemlich viel Einfluss überlässt – was ich persönlich übrigens sehr unschön finde, denn Softwarefehler passieren nunmal immer wieder.

Dabei fällt mir zufällig wieder eine Idee ein, die ich als enthusiastischer Informatik-Erstie (oder Zweitie) mal hatte: Einen POSIX-Layer für die Java-VM. Im Moment wird ziemlich viel für die Java-VM entwickelt, und sie ist recht gut optimiert, es gibt sogar C-Compiler dafür. Und mir geht es häufig so, dass ich lieber ein ineffizientes Programm habe, als gar keines. Nun, ein POSIX-Layer für Java, auf dem man viele Programme compilieren kann, das würde einem die Möglichkeit geben, sehr viele Software quasi plattformunabhängig zu compilieren. Ich meine damit soetwas wie „Cygjava“ – die Speicherung von Java Bytecode in ELF-Dateien, eine Syscall-Infrastruktur, und was eben sonst noch so dazu gehört. Kann das mal bitte jemand Programmieren?