<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>G33K @ Work</title>
	<atom:link href="http://www.geekatwork.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geekatwork.de</link>
	<description>Basteleien eines Geeks</description>
	<lastBuildDate>Mon, 12 Jul 2010 08:38:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>OS Development Demo Code</title>
		<link>http://www.geekatwork.de/2010/07/12/os-development-demo-code/</link>
		<comments>http://www.geekatwork.de/2010/07/12/os-development-demo-code/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 08:36:14 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[OSDev]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[interrupts]]></category>
		<category><![CDATA[low level]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[pit]]></category>
		<category><![CDATA[sigint]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">https://www.geekatwork.de/?p=274</guid>
		<description><![CDATA[A while ago, I wrote some demo code to demonstrate vari [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I wrote some demo code to demonstrate various things you need to do to write your own operating system.<br />
In May 2010 I held a lecture and workshop about this code and the concepts at <a href="http://events.ccc.de/sigint/2010/wiki/Hauptseite" target="_blank">SigInt conference in Cologne</a>, Germany.</p>
<p>I just thought that this code may be interesting to other people who did not attend this conference.<span id="more-274"></span></p>
<p><a href="http://github.com/G33KatWork/SigInt10OSWorkshop" target="_blank">The demo code</a> includes mainly x86 specific stuff and it is truly demo code, so don&#8217;t just copy it into another project. Even if it works at first sight, it it is highly likely to break sooner or later <img src='http://www.geekatwork.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The code contains samples for:</p>
<ul>
<li>A small &#8220;Hello World&#8221; bootsector in realmode</li>
<li>A sample how to enable the A20 gate. This works at least in QEMU</li>
<li>Loading a barebone-kernel written in C by GRUB</li>
<li>Switching to protected mode and writing to the textmode framebuffer</li>
<li>Handling interrupts in protected mode using the old PIC</li>
<li>Configuring and using the old PIT (Timer)</li>
<li>Switching to longmode (64 Bit)</li>
<li>A multitasking demo how to do context switching</li>
</ul>
<p>The first two samples are completely written in Assembly and are loaded directly by the BIOS from a floppy drive. All other samples are mainly written in C spiced with some Assembly and are loaded from a FAT formatted floppy disk by a GRUB bootloader.</p>
<p>For those of you who speak german, here are the slides of the conference:<br />
<a href="http://events.ccc.de/sigint/2010/wiki/Fahrplan/events/3889.de.html" target="_blank">Talk</a><br />
<a href="http://events.ccc.de/sigint/2010/wiki/Fahrplan/events/3890.de.html" target="_blank">Workshop </a></p>
<p>If you do anything with this demo code, I would appreciate to hear about your project or experiences. Also, If there are specific questions or problems about/with this code which are not easily resolvable by Googling and using your brain, feel free to ask in the comments. <img src='http://www.geekatwork.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2010/07/12/os-development-demo-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vom Gendern und ASCII-Frauen</title>
		<link>http://www.geekatwork.de/2010/06/02/vom-gendern-und-asci-frauen/</link>
		<comments>http://www.geekatwork.de/2010/06/02/vom-gendern-und-asci-frauen/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 22:08:04 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[The usual rants]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[gender]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[longcat]]></category>
		<category><![CDATA[nerds]]></category>
		<category><![CDATA[sigint]]></category>

		<guid isPermaLink="false">https://www.geekatwork.de/?p=235</guid>
		<description><![CDATA[Es war einmal, nachts, kurz nach dem alljährlichen Ber [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">Es war einmal, nachts, kurz nach dem alljährlichen Berliner Congress in Berlin, ein Treffen in einem Hackerspace, dem C4, in Köln.</div>
<div id="_mcePaste">Nach ein paar Flaschen Mate, kommen einem die schrägsten Ideen um den Spieltrieb in sich zu befriedigen.</div>
<p>Als ich so schräg auf den Nadeldrucker in der Ecke schielte und fragte ob der noch funktioniere, wollte ich drucken. Nunja, das nächste anstehende Event war also die <a href="http://events.ccc.de/sigint/2010/wiki/Hauptseite" target="_blank">SigInt</a>. Wenn man etwas zusammenhackt will man das auch dem breiten Publikum präsentieren können. Nach einiger Zeit hatten wir dann die Idee eine <a href="http://encyclopediadramatica.com/Longcat" target="_blank">Longcat</a> zu drucken.<span id="more-235"></span></p>
<p>Nur der Bauch sieht dann doch etwas leer aus, wenn wir nur den Kopf und dann den &#8220;Körper&#8221; in Form von Strichen links und rechts am Papierrand drucken. Also was pappen wir da rein? Es gibt da doch dieses Twitter. Also gehen wir flott an die Twitter Suche und schieben alles was mit der SigInt zu tun hat in den Bauch.</p>
<p><strong> Spaß!</strong></p>
<p>Es waren Blödeleien und wir hatten beim Basteln viel Spaß. Deswegen machen wir das.</p>
<p>Als wir dann auf dem Event selbst waren lief das Teil natürlich noch nicht. <a href="https://wiki.koeln.ccc.de/index.php?title=Verpeilungsfaktor" target="_blank">Die übliche Vorgehensweise</a>: Man hat vorher Monate Zeit und tut nichts. Wenn man dann auf dem Event sitzt fängt man richtig an zu hacken.</p>
<p>Was konnten wir zu dem Zeitpunkt? Unser Mikrocontroller konnte mit dem Drucker reden und hat den Kopf und den Bauch gedruckt. Per serieller Schnittstelle nahm er Text an, der in den Bauch gedruckt wurde. Über diese Schnittstelle sollten über ein Script die Tweets zur SigInt an die Katze geschickt werden.</p>
<p>Durch die üblichen Fuckups funktionierte genau das natürlich nicht.<br />
Irgendwann in der Nacht, als es auf die Party zuging auf die wir auch noch wollten, hatten wir keine Lust mehr. Die Longcat war aber immernoch leer.</p>
<p>Aber&#8230; da gibts doch noch <a href="http://de.wikipedia.org/wiki/Ascii_art" target="_blank">ASCII-Art</a>. &#8220;Kennt wohl jeder hier&#8221;, dachten wir uns und was liegt da näher als was hübsches und historisches zu drucken?<br />
Hey, guck mal. Ein ASCII-Bild einer Frau. Drucken wir das doch.<br />
Nachdem wir dann endlich die ersten Zeichen im Bauch der Katze hatten machten wir den Drucker aus und gingen feiern. Den Rest machen wir dann morgen.</p>
<p><a rel="lightbox" href="http://www.geekatwork.de/wp-content/uploads/2010-05-23-01.06.13-e1275515946407.jpg"><img class="alignnone size-medium wp-image-239" title="2010-05-23 01.06.13" src="http://www.geekatwork.de/wp-content/uploads/2010-05-23-01.06.13-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>Und da nahm die Katastrophe ihren Lauf&#8230;</p>
<p>Am nächsten Tag war dann das Genderpanel. 5 Frauen die über die Probleme der Gleichberechtigung von Frauen in der Hackerszene diskutieren (sic!) wollten.</p>
<p>Wie sich dann im Laufe des Tages herausstellte, haben sie auch über unser ASCII-Bild geredet. Ich selbst war nicht im Genderpanel, deswegen habe ich das auch nur über dritte Personen gehört. Zuerst dachte ich, dass das ganze ein Scherz sei, bis mir immer mehr Leute darüber berichteten.</p>
<p>Was zum Teufel?</p>
<p>Es kam aber auch keiner zu uns und versuchte mit uns einen Dialog anzufangen. Wenn jemand gesagt hätte, das ihn/sie (OMG, jetzt fang ich hier schon an Texte zu gendern&#8230;) das stört, hätte ich wahrscheinlich erstmal wegen gewisser Unverständnis wie ein Auto geguckt und etwas gestutzt, aber wir fressen unseren Gegenüber wegen sowas ja nicht, solange wir nicht persönlich angegriffen werden.</p>
<p>Als ich dann später erfuhr, das wir wohl mehr oder weniger im selben Atemzug mit Hardcore Pornografie genannt wurden, wurde ich auch leicht pissig. Ich bin der Meinung diese Frauen im Genderpanel haben uns dazu benutzt zu provozieren. Erstmal nichts schlimmes. Sollen sie doch. Das bringt die Diskussion in Wallung, was auch definitiv passiert ist.<br />
Allerdings bitte ich doch darum, das wir nicht als Sexisten oder Frauenfeinde hingestellt werden, denn genau so kam das rüber.</p>
<p>Sie hatten einfach kein besseres Beispiel dazu. Ich glaube nicht, das das wirklich jemanden gestört hat. Sie brauchten nur irgendwas, um Leute zu denunzieren und aus einer Mücke einen Elefanten zu machen.<br />
Sie haben zwar nicht unsere Namen genannt, es war aber unvermeidlich, das jeder wusste wer wir waren, da wir den ganzen Tag neben dieser gedruckten Katze saßen.</p>
<p>Und was hat das mit Behandlung von Frauen zu tun? Nur, weil ich/wir ein ASCII-Bild einer Frau gedruckt haben, heißt das nicht das wir Frauen anders behandeln oder sie gar zu einem Sexobjekt degradieren. Es war ein ASCII-Bild. Nichtmal eine reale Fotografie einer Frau. Deswegen ist es so unverständlich für mich, wie sich da jemand angegriffen fühlen kann.<br />
Zumal die Frauen ja Gleichberechtigung wollen. Wenn wir also wegen den anwesenden Frauen kein Bild drucken, ist das dann noch Gleichberechtigung?</p>
<p>Um dann aber sicher zu gehen, das sich die Frauen nicht benachteiligt fühlten, haben wir uns dann doch ans Herz gefasst und auch einen Mann gedruckt. Sie appellierten ja wie gesagt auch, das wir sie gleich behandeln sollen.</p>
<p><a rel="lightbox" href="http://www.geekatwork.de/wp-content/uploads/2010-05-24-00.30.30-e1275515921206.jpg"><img class="alignnone size-medium wp-image-240" title="2010-05-24 00.30.30" src="http://www.geekatwork.de/wp-content/uploads/2010-05-24-00.30.30-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p>So viel zu meiner persönlichen Sichtweise zu der ganzen Sache.</p>
<p>Als zweites will ich hier noch kurz betonen, das dieses ASCII-Art seit Urzeiten zu unserer (Hacker-/Nerd-)Kultur gehört. MSPro hat das sehr schön in seinem <a href="http://faz-community.faz.net/blogs/crtl-verlust/archive/2010/05/28/plattformneutralitaet-gender-und-die-verdammte-der-realitaet.aspx" target="_blank">Post über Plattformneutralität</a> dargestellt.<br />
Und wer sich in solchen Kreisen bewegt, hat das nunmal zu akzeptieren. Selbst, wenn da Frauen gedruckt werden.</p>
<p>&#8230; und wenn das Farbband hält, dann drucken sie noch heute.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'G33KatWork';
var flattr_url = 'http://www.geekatwork.de';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'G33K @ Work';
var flattr_dsc = 'Basteleien eines Geeks';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2010/06/02/vom-gendern-und-asci-frauen/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Dumping the VMware BIOS</title>
		<link>http://www.geekatwork.de/2010/05/27/dumping-the-vmware-bios-2/</link>
		<comments>http://www.geekatwork.de/2010/05/27/dumping-the-vmware-bios-2/#comments</comments>
		<pubDate>Thu, 27 May 2010 00:48:18 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[OSDev]]></category>
		<category><![CDATA[BIOS]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[dumping]]></category>
		<category><![CDATA[extracting]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.geekatwork.de/?p=228</guid>
		<description><![CDATA[Sometimes, even if you don't want to install a pirated  [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, even if you don&#8217;t want to install a pirated Windows version, you may want to dump and modify the BIOS of a computer.<br />
Especially if you are developing some kind of an ACPI subsystem for your <a href="projekte/geexos/">own small operating system kernel</a>.</p>
<p>Doing this with real hardware is kinda risky and complex.<br />
But what about virtual machines like VMware? They have a BIOS, but how can we get our hands on it?<span id="more-228"></span><br />
As I&#8217;m using Mac OS X for all my daily work, I&#8217;m using VMware Fusion as a virtualization program.</p>
<p>The BIOS seems to be hidden inside the virtual machine monitor executable itself.<br />
To make our lifes easier, we are going to extract only the x86_64 part out of the universal binary with the following command:</p>
<pre class="brush:shell">lipo /Libary/Application\ Support/VMware\ Fusion/vmware-vmx -thin x86_64 -output /Users/user/Desktop/vm64</pre>
<p>Now, we have a Mach-O file with only one architecture, which is x86_64.<br />
It doesn&#8217;t matter if you are dumping the BIOS out of the i386 or x86_64 version of the binary. It should be the same for both architectures.</p>
<p>After that, we can extract the appropriate section in the Mach-O file which contains the BIOS itself:</p>
<pre class="brush:shell">segedit /Users/user/Desktop/vm64 -extract __VMWARE bios440 /Users/user/Desktop/bios440.rom</pre>
<p>And here, you go: bios440.rom contains your VMware BIOS.</p>
<p>After you modified it to your wishes, you can use a handy VMware feature which lets you specify a custom BIOS for a virtual machine inside its vmx-file.<br />
Just add this line to the vmx-file of the machine you want a custom BIOS for and place the rom file in the proper folder:</p>
<pre>bios440.filename = "bios.rom"</pre>
<p>Happy BIOS modding!</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2010/05/27/dumping-the-vmware-bios-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building and running your own Android</title>
		<link>http://www.geekatwork.de/2010/04/01/building-and-running-your-own-android/</link>
		<comments>http://www.geekatwork.de/2010/04/01/building-and-running-your-own-android/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 20:00:43 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[fastboot]]></category>
		<category><![CDATA[G2]]></category>
		<category><![CDATA[HTC]]></category>
		<category><![CDATA[Magic]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[SPL]]></category>

		<guid isPermaLink="false">http://www.geekatwork.de/?p=197</guid>
		<description><![CDATA[Almost a year ago I bought an HTC Magic (also known as  [...]]]></description>
			<content:encoded><![CDATA[<p>Almost a year ago I bought an HTC Magic (also known as the G2) phone as a replacement for my iPhone.<br />
I was quite happy with it since it had the newest Android 1.5 and there was also an update released by Google to get it to version 1.6.</p>
<p>Now, that there are much fancier phones out there, like the Nexus One and Motorola Milestone, there must be a reason for people to buy them. The consequence about that is that they are holding back any updates to Android 2.0 or 2.1 for older phones. At least that&#8217;s my impression.</p>
<p>I also ever wanted to build and run my own Android since it is open source. At least that&#8217;s what Google says.<br />
My first steps were quite disappointing since there was no device specific package for my G2 in the source tree. There was only one for the HTC Dream (G1).</p>
<p>Yesterday I wanted to give it another try and it was a success. I will post my steps here which are especially for the HTC Magic (or G2, HTC Sapphire, MyTouch 3G, Google IO &#8211; they are all the same) but it should be possible to do this with other phones as long as you have all the device specific blobs like the GSM Baseband layer or low level hardware drivers for your specific device.<br />
Also keep in mind that this won&#8217;t be a normal guide like &#8220;How can I root this phone?&#8221; I assume that you more or less know what you are doing. So don&#8217;t blame me when you brick your phone: Shit happens and I&#8217;m not going to fix it.<span id="more-197"></span></p>
<p>Also, be careful what phone you have. There are 2 versions of the HTC Magic. One is the PVT32A and the other is PVT32B.<br />
The A version has more RAM compared to B. The phone sold by HTC on their own is the A version. Almost all others are B versions. My phone is a B variant.<br />
Check <a href="http://wiki.xda-developers.com/index.php?pagename=HTC_Sapphire_Hacking#sec01" target="_blank">this site</a> for any further information.</p>
<h2>The SPL</h2>
<p>The SPL is the Secondary Program Loader. The Initial Program Loader, which runs before the SPL is responsible for the basic bootstrapping of the processor inside the phone. Most of the time it is located on some on-die ROM and loads the SPL from flash.</p>
<p>The SPL itself is responsible for all kinds of boot services like booting from flash or receiving and handling data from the USB port with the fastboot protocol, which can be used for several maintenance tasks.</p>
<p>Usually, if you buy an OEM phone, you will get a shipment bootloader. Development phones will have an engineering bootloader.<br />
The difference between those two is that with the shipment bootloader, you will not be able to write the flash directly from your computer over the fastboot protocol, which you definitely want if you compile/develop your own Android. So the first step is to install an engineering loader.<br />
You can get several SPLs <a href="http://forum.xda-developers.com/showthread.php?t=529019" target="_blank">here</a>. I installed the Crios  loader.<br />
Just put the zip file on your SD-Card, boot a <a href="http://www.cyanogenmod.com/downloads/recovery-image" target="_blank">modified recovery image</a> via fastboot and apply the zip file from your SD:</p>
<pre class="brush:plain">fastboot boot cm-recovery-1.4.img</pre>
<p>The fastboot utility is available <a href="http://developer.htc.com/adp.html#s2" target="_blank">here</a> or from your compiled Android in the out/host/&lt;platform&gt;/bin/ subdirectory.<br />
To get your phone into fastboot mode, turn it off and hold the &#8220;back&#8221;-key while turning it on.</p>
<p>After flashing the new SPL you will have the engineering bootloader with security turned off.</p>
<h2>Getting the Android sourcecode</h2>
<p>If you want to build your own Android you obviously need to get the sourcecode. I did all the work on a Gentoo Linux. I don&#8217;t know how to do it under Windows or Mac OS.</p>
<p>First I thought to take the CyanogenMod repositories but they won&#8217;t check out completely because there seems to be missing at least one repository on github.</p>
<p>To get the official Google tree, just follow <a href="http://source.android.com/download" target="_blank">this guide</a>.</p>
<p>Essentially you just install the required packages, get the repo client, do the repo init, repo sync and you should be done.</p>
<h2>Get the binary blobs</h2>
<p>For the Sapphire board package, you will need to get some binary blobs for the camera, WLAN, baseband and several other things.</p>
<p>You can download them on the <a title="http://developer.htc.com/google-io-device.html" href="http://" target="_blank">HTC page for the Google IO</a>. Just download the recovery image for Android 1.6 and put it into the root of your Android source tree.<br />
After that you need to change the directory to vendor/htc/sapphire-open and execute the unzip-files.sh which extracts the blobs from the downloaded zipfile and puts them into the appropriate places.</p>
<h2>Building it</h2>
<p>After you prepared your environment, get back to the root of the source tree and do a</p>
<pre class="brush:plain">source build/envsetup.sh
lunch</pre>
<p>to setup several environment variables and select the build target, which will be <em>aosp_sapphire_eu-userdebug</em> in our case.</p>
<p>After that you can just execute a</p>
<pre class="brush:plain">make -j3</pre>
<p>to start the build. You can adjust the number behind the -j parameter to your machine. If you have n cores, the number you normally use is n+1. This is not essential for a successful build, but if you have 2 or more cores, you should use them for the build.<br />
Now it&#8217;s time to ge some beautiful delicious black coffee or a cold bootle of <a href="http://www.club-mate.de" target="_blank">Club-Mate</a>, go for a walk or take a nap. This will take quite some time.</p>
<h2>Common errors during the build</h2>
<p>I ran into several erros while buildng. All of them were specific to my environment.</p>
<ul>
<li><em>no rule to make target `run-java-tool&#8217;</em> during build<br />
Solution: Just execute a <em>export PATH=$(java-config -O)/bin:$PATH</em> and the error you should be gone</li>
<li>Java 1.6 is installed.<br />
Solution: Do an <em>ACCEPT_LICENSE=&#8221;*&#8221; emerge =sun-jdk-1.5.0.22</em> and select the 1.5 JDK with eselect.</li>
<li>Building the emulator fails with something like <em>prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55:22: error: X11/Xlib.h: No such file or directory</em><br />
Solution: Do an <em>emerge libX11</em></li>
</ul>
<h2>Installing the built images on your phone</h2>
<p>After the build finished successful you will have everything in the <em>out</em> subdirectory.</p>
<p>Thanks to the engineering SPL, you can now install the built images using fastboot:</p>
<pre class="brush:plain">export ANDROID_PRODUCT_OUT="/path/to/android/root/out/target/product/sapphire-open"
fastboot flashall</pre>
<p>Be sure your phone is in fastboot mode.</p>
<p>After you flashed the images you should boot the recovery image, mentioned in the SPL section, again and wipe the userdata partition.<br />
This will cause a data loss. Anyway, you should have done a backup with nandroid in the modified recory image before messing around with your phone&#8217;s firmware <img src='http://www.geekatwork.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>The result</h2>

<a href='http://www.geekatwork.de/2010/04/01/building-and-running-your-own-android/about/' title='about'><img width="150" height="150" src="http://www.geekatwork.de/wp-content/uploads/about-150x150.png" class="attachment-thumbnail" alt="about" title="about" /></a>
<a href='http://www.geekatwork.de/2010/04/01/building-and-running-your-own-android/menu/' title='menu'><img width="150" height="150" src="http://www.geekatwork.de/wp-content/uploads/menu-150x150.png" class="attachment-thumbnail" alt="menu" title="menu" /></a>
<a href='http://www.geekatwork.de/2010/04/01/building-and-running-your-own-android/main/' title='main'><img width="150" height="150" src="http://www.geekatwork.de/wp-content/uploads/main-150x150.png" class="attachment-thumbnail" alt="main" title="main" /></a>

<h2>Next steps</h2>
<p>As you can see from the images above, all of the Google applications are missing. The next step would be to take them from an official Google image and put them on your phone. I think cyanogen already wrote a script for doing this for his builds. I haven&#8217;t checked this out yet.</p>
<p>Anyway, we have our very own Android 2.1 running.<br />
If you want to use it on a daily basis you should consider building a stable branch and using this instead of the master branch.</p>
<p>If you&#8217;ve got any questions or problems, just leave them in the comments and we will try to figure them out.</p>
<p><strong>Update:</strong> The cyanogenmod repositories do check out. I just used the wrong manifest repository.<br />
If you want to give it a try, just do a</p>
<pre class="brush:plain">repo init -u git://github.com/cyanogen/android.git -b eclair
repo sync</pre>
<p>instead of using the Google repository. <a href="http://wiki.cyanogenmod.com/index.php/Building_from_source" target="_blank">Have a look here</a> for more information.</p>
<p>General useful information, like adding your own target, creating keys for signing etc. can be found <a href="http://pdk.android.com/online-pdk/guide/build_new_device.html" target="_blank">here</a>.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'G33KatWork';
var flattr_url = 'http://www.geekatwork.de';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'G33K @ Work';
var flattr_dsc = 'Basteleien eines Geeks';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2010/04/01/building-and-running-your-own-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switch Hacking</title>
		<link>http://www.geekatwork.de/2010/02/02/switch-hacking/</link>
		<comments>http://www.geekatwork.de/2010/02/02/switch-hacking/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 12:18:33 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Elektronik]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Ethernet]]></category>
		<category><![CDATA[Switch]]></category>

		<guid isPermaLink="false">http://www.geekatwork.de/?p=130</guid>
		<description><![CDATA[Last week I stumbled upon tmbinc's blog entry series "W [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I stumbled upon tmbinc&#8217;s blog entry series &#8220;What&#8217;s inside&#8221;.<br />
<a href="http://debugmo.de/?p=134" target="_blank">This one</a> was especially interesting to me since I always wanted to buy a GBit switch (I never had one until today, really <img src='http://www.geekatwork.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).<span id="more-130"></span></p>
<p>I ordered this switch (a TP-Link TL-SG1008D) for just about 30€ including shipping and today I got my package. I opened it, checked if the switch works and voided the warranty.<br />
After opening the device it was clear that I got some other hardware compared to tmbinc. I don&#8217;t have this monster heat sink on top of a BGA chip. Instead there are two smaller LQFP-Chips with one heat sink each.</p>
<p><a href="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.06-e1265110298308.jpg" rel="lightbox"><img class="alignnone size-medium wp-image-117" title="2010-02-02 12.26.06" src="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.06-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>A closer look at my and tmbinc&#8217;s images relieve that my switch is actually revision 1.1 and tmbinc&#8217;s is revision 2.0.</p>
<p>I tried to remove the heat sinks with pliers but I didn&#8217;t want to damage my new toy.<br />
Also, I wanted to know how warm these chips get while using the device, so I took some ethernet cables, made some loops and inserted one cable into the ethernet jack into my laptop. As soon as Mac OS detected an active connection it broadcasted at least one package onto the line that was looping happily from one switch port to the next <img src='http://www.geekatwork.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
I let this thing running for about 10 minutes and the chips didn&#8217;t get very warm. I hoped that the glue would get a bit less sticky due to the heat, but there was just no heat. Seems that the heat sinks did a good job there. <img src='http://www.geekatwork.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  So I tried the exact opposite and put this thing into my freezer for a few minutes. After it got cooled down a few degrees I took my pliers and applied some force and look: They came off.</p>
<p><a href="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.23-e1265110848915.jpg" rel="lightbox"><img class="alignnone size-medium wp-image-120" title="2010-02-02 12.26.23" src="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.23-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>As you can see there are two Realtek chips on this board. The right chip is an RTL8214. The <a href="http://www.realtek.com.tw/products/productsView.aspx?Langid=1&amp;PNid=16&amp;PFid=47&amp;Level=5&amp;Conn=4&amp;ProdID=222" target="_blank">Realtek Website</a> says that this chip is just a quad-port gigabit ethernet transceiver.<br />
The other chip is an RTL8368S. Here the <a href="http://www.realtek.com.tw/products/productsView.aspx?Langid=1&amp;PNid=18&amp;PFid=43&amp;Level=5&amp;Conn=4&amp;ProdID=198" target="_blank">Realtek Website</a> tells us, that this chip is actually the switch controller for 8 ports, but it has only 4 transceivers, hence the second transceiver chip. On the pictures you can clearly see some bus between the two ICs.<br />
And look at the features: Per port-ACLs on Layer 2, 3 and 4, VLAN, Spanning Tree, 802.1x, QoS and several statistic counters.<br />
Unfortunately the datasheets for both chips don&#8217;t seem to be publicly available.<br />
&lt;rant&gt;I absolutely hate all this NDA crap&#8230; Those fscking ethernet chips are no rocket science that needs to be protected in such a way. SRSLY!&lt;/rant&gt;</p>
<p><a href="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.59-e1265111511977.jpg" rel="lightbox"><img class="alignnone size-medium wp-image-122" title="2010-02-02 12.26.59" src="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.59-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>On the upper side of the image above you can see a small <a href="http://www.datasheetcatalog.com/datasheets_pdf/2/4/C/0/24C08.shtml" target="_blank">IC with part number 24C08</a>, which is an 8KBit I2C EEPROM. I haven&#8217;t looked at the contents yet, but I suspect that this EEPROM contains the configuration for the switch controller, but I doubt that the contents will be of any help without a datasheet <img src='http://www.geekatwork.de/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Some closeups of the chips:<br />
<a href="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.30-e1265111971380.jpg" rel="lightbox"><img class="alignnone size-medium wp-image-123" title="2010-02-02 12.26.30" src="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.30-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.50-e1265112024789.jpg" rel="lightbox"><img class="alignnone size-medium wp-image-124" title="2010-02-02 12.26.50" src="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.26.50-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><a href="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.27.05-e1265112065514.jpg" rel="lightbox"><img class="alignnone size-medium wp-image-125" title="2010-02-02 12.27.05" src="http://www.geekatwork.de/wp-content/uploads/2010-02-02-12.27.05-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><strong>Update:</strong> I <a href="ftp://83.149.205.218/pub/hardware/realtek/" target="_blank">found some datasheets</a> for several Realtek Chips. There is no datasheet for the RTL8368, but for the RTL8369. It seems that the only difference between those two chips are that the latter doesn&#8217;t have any transceivers on-die, but only some <a href="http://en.wikipedia.org/wiki/Serial_Gigabit_Media_Independent_Interface" target="_blank">SGMII</a> ports for all 8 Ethernet ports. I think I&#8217;m going to dump the EEPROM and try to get some information out of it with the 8369 datasheet.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2010/02/02/switch-hacking/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I can haz FPGA?</title>
		<link>http://www.geekatwork.de/2010/01/17/i-can-haz-fpga/</link>
		<comments>http://www.geekatwork.de/2010/01/17/i-can-haz-fpga/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 21:23:30 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Elektronik]]></category>
		<category><![CDATA[FPGA]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Xilinx]]></category>

		<guid isPermaLink="false">http://www.geekatwork.de/?p=89</guid>
		<description><![CDATA[Da ises weg, das Weihnachtsgeld.

Draufgegangen ist d [...]]]></description>
			<content:encoded><![CDATA[<p>Da ises weg, das Weihnachtsgeld.</p>
<p>Draufgegangen ist das unter anderem für dieses hübsche, aber leider teure FPGA-Board mit einem Xilinx Spartan 3 FPGA:<br />
<a href="http://www.geekatwork.de/wp-content/uploads/2010-01-12-23.48.01-e1263764275949.jpg" rel="lightbox"><img class="alignnone size-medium wp-image-90" title="spartan3an" src="http://www.geekatwork.de/wp-content/uploads/2010-01-12-23.48.01-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p><span id="more-89"></span>Wie man sieht, sieht man ein A auf dem LCD Display. Viel mehr habe ich damit noch nicht zustande gebracht. Besonders einfach wirds einem aber sowieso nicht gemacht. Das Ding ist halt kein Prozessor, mit dem man sequentielle Abläufe durch das Ausführen eines Programms abbilden kann, sondern pure Digitaltechnik.<br />
Durch VHDL wird einem das Beschreiben etwas einfacher gemacht, die Vorgänge laufen aber alle parallel in diesem Chip ab. Signale warten nicht einfach so auf ein Ereignis.</p>
<p>Signalabläufe wie sie von einem Displaycontroller erwartet werden können auch nur über eine Statemachine modelliert werden. Man hüpft also von einem Zustand in den anderen und legt die passenden Signale an die Leitungen. Danach springt man meistens wieder in eine Warteschleife, weil der LCD-Controller üblicherweise langsamer ist als so ein FPGA.</p>
<p>Da man das ganze äußerst schlecht debuggen kann, simuliert man im Vorfeld die Abläufe. Man schreibt also erstmal sein Modul in VHDL und darf sich dann auch noch darum kümmern einen Sogenannten Testbench zu schreiben. Dieser Testbench ist dann dafür zuständig die passenden Signale, die normalerweise durch externe Quellen erzeugt werden, an das Modul zu legen, um das alles in Software abbilden zu können.</p>
<p>Nachdem man dann die Simulation für einige Milisekunden ausgeführt hat, sieht das so aus:<br />
<a href="http://www.geekatwork.de/wp-content/uploads/rs232_wave.png" rel="lightbox"><img class="alignnone size-medium wp-image-91" title="RS232 Simulation" src="http://www.geekatwork.de/wp-content/uploads/rs232_wave-300x101.png" alt="" width="300" height="101" /></a></p>
<p>Auf diesem Bild sieht man die Simulation eines RS232 Moduls. Die Länge eines Bits ist hier 8,6µs, was eine Baudrate von 115200 pro Sekunde ergibt.<br />
Als erstes wird in tx_data das Byte abgelegt, welches üertragen werden soll. Dann zieht man tx_start kurz auf High, was man hier nicht sieht, da es bereits 40ns nach dem Start passiert, und die Übertragung startet. Erst kommt das Startbit auf der TXD-Leitung, dann eine 0, dann eine 1 usw. bis das Stopbit kommt und die Leitung wieder auf &#8220;Standby&#8221; geht und somit 0xAA übertragen wurde. RS232 überträgt das niederwertigste Bit zuerst.</p>
<p>Analog läuft das mit dem Empfangen ab.</p>
<p>In VHDL sieht das ganze dann so aus:</p>
<pre class="brush:plain">library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity RS232 is
    Generic ( Clockrate : integer   := 50000000;  -- Hertz
              Baudrate  : integer   :=  9600      -- Bits/Sec
             );
    Port ( RXD      : in   STD_LOGIC;
           RX_Data  : out  STD_LOGIC_VECTOR (7 downto 0);
           RX_Busy  : out  STD_LOGIC;
           TXD      : out  STD_LOGIC;
           TX_Data  : in   STD_LOGIC_VECTOR (7 downto 0);
           TX_Start : in   STD_LOGIC;
           TX_Busy  : out  STD_LOGIC;
           CLK      : in   STD_LOGIC
           );
end RS232;

architecture Behavioral of RS232 is
signal txstart : std_logic := '0';
signal txsr    : std_logic_vector  (9 downto 0) := "1111111111";
signal txbitcnt : integer range 0 to 10 := 10;
signal txcnt    : integer range 0 to (Clockrate/Baudrate)-1;

signal rxd_sr  : std_logic_vector (3 downto 0) := "1111";
signal rxsr    : std_logic_vector (7 downto 0) := "00000000";
signal rxbitcnt : integer range 0 to 9 := 9;
signal rxcnt   : integer range 0 to (Clockrate/Baudrate)-1; 

begin
   send: process(CLK)
   begin
      if rising_edge(CLK) then
         txstart &lt;= TX_Start;
         if (TX_Start = '1' and txstart = '0') then
            txcnt    &lt;= 0;
            txbitcnt &lt;= 0;
            txsr     &lt;= '1' &amp; TX_Data &amp; '0';
         else
            if(txcnt&lt;(Clockrate/Baudrate)-1) then
               txcnt &lt;= txcnt + 1;
            else
               if (txbitcnt &lt; 10) then
                  txcnt    &lt;= 0;
                  txbitcnt &lt;= txbitcnt + 1;
                  txsr     &lt;= '1' &amp; txsr(txsr'left downto 1);
               end if;
            end if;
         end if;
      end if;
   end process;
   TXD     &lt;= txsr(0);
   TX_Busy &lt;= '1' when (txbitcnt &lt; 10) else '0';

   receive: process(CLK)
   begin
      if rising_edge(CLK) then
         rxd_sr &lt;= rxd_sr(rxd_sr'left - 1 downto 0) &amp; RXD;
         if (rxbitcnt &lt; 9) then
            if(rxcnt &lt; (Clockrate / Baudrate) - 1) then
               rxcnt    &lt;= rxcnt + 1;
            else
               rxcnt    &lt;= 0;
               rxbitcnt &lt;= rxbitcnt + 1;
               rxsr     &lt;= rxd_sr(rxd_sr'left - 1) &amp; rxsr(rxsr'left downto 1);
            end if;
         else
            if (rxd_sr(3 downto 2) = "10") then
               rxcnt    &lt;= ((Clockrate / Baudrate) - 1) / 2;
               rxbitcnt &lt;= 0;
            end if;
         end if;
      end if;
   end process;
   RX_Data &lt;= rxsr;
   RX_Busy &lt;= '1' when (rxbitcnt &lt; 9) else '0';

end Behavioral;</pre>
<p>Mit einer &#8220;entity&#8221; beschreibt man, dass es irgendein Modul mit entsprechendem Namen gibt und welche Leitungen da rein und rausgehen.<br />
Im &#8220;Behaviour&#8221; beschreibt man dann, wie sich das Modul verhält und welche internen Signale oder Variablen es gibt. Wir haben in diesem Fall 2 Prozesse. Einen zum Senden und einen zum Emmpfangen. Jeder dieser Prozesse kann gleichzeitig ausgeführt werden.</p>
<p>Der passende Testbench zu diesem RS232 Modul sieht dann so aus:</p>
<pre class="brush:plain">LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;

ENTITY rs232_tb IS
END rs232_tb;

ARCHITECTURE behavior OF rs232_tb IS 

    -- Component Declaration for the Unit Under Test (UUT)

    COMPONENT RS232
   GENERIC ( Clockrate : integer := 50000000;
             Baudrate : integer := 115200);
    PORT(
         RXD : IN  std_logic;
         RX_Data : OUT  std_logic_vector(7 downto 0);
         RX_Busy : OUT  std_logic;
         TXD : OUT  std_logic;
         TX_Data : IN  std_logic_vector(7 downto 0);
         TX_Start : IN  std_logic;
         TX_Busy : OUT  std_logic;
         CLK : IN  std_logic
        );
    END COMPONENT;

   --Inputs
   signal RXD : std_logic := '0';
   signal TX_Data : std_logic_vector(7 downto 0) := (others =&gt; '0');
   signal TX_Start : std_logic := '0';
   signal CLK : std_logic := '0';

   --Outputs
   signal RX_Data : std_logic_vector(7 downto 0);
   signal RX_Busy : std_logic;
   signal TXD : std_logic;
   signal TX_Busy : std_logic;

  constant clk_period : time := 20 ns;

BEGIN

  -- Instantiate the Unit Under Test (UUT)
   uut: RS232 PORT MAP (
          RXD =&gt; RXD,
          RX_Data =&gt; RX_Data,
          RX_Busy =&gt; RX_Busy,
          TXD =&gt; TXD,
          TX_Data =&gt; TX_Data,
          TX_Start =&gt; TX_Start,
          TX_Busy =&gt; TX_Busy,
          CLK =&gt; CLK
        );

   clk_process :process
   begin
      CLK &lt;= '0';
      wait for clk_period/2;
      CLK &lt;= '1';
      wait for clk_period/2;
   end process;

   -- Stimulus process
   stim_proc: process
   begin
      RXD &lt;= '1';            --idle
      wait for clk_period*2;

      TX_Data &lt;= "10101010";
      TX_Start &lt;= '1';

      wait for clk_period*5;
      TX_Start &lt;= '0';

      wait for clk_period*5000;

      --startbit
      RXD &lt;= '0';
      --435 clock cycles by 20ns each = 8,7us = length of bit with 115200 baud
      wait for clk_period*435;

      RXD &lt;= '0';
      wait for clk_period*435;
      RXD &lt;= '1';
      wait for clk_period*435;
      RXD &lt;= '0';
      wait for clk_period*435;
      RXD &lt;= '1';
      wait for clk_period*435;
      RXD &lt;= '0';
      wait for clk_period*435;
      RXD &lt;= '1';
      wait for clk_period*435;
      RXD &lt;= '0';
      wait for clk_period*435;
      RXD &lt;= '1';
      wait for clk_period*435;

      --stopbit and idle
      RXD &lt;= '1';

      wait;
   end process;

end;</pre>
<p>Der Aufbau ist ähnlich wie vorhin. Die Entity hier enthält jedoch keine Ein- oder Ausgabesignale, da hier später nur die internen Signale dieses Testbenches im Simulator betrachtet werden. Natürlich kann man später in der Waveform noch weitere Signale hinzufügen. Zum Beispiel interne Signale aus dem getesteten Modul.<br />
Im Behaviour wird dann als erses die Komponente RS232 definiert. Es gibt also irgendwo ein solches Modul, das später hier genutzt werden kann. Darauf folgend kommen wieder einige Signale, denen man später in Prozessen Werte zuweisen kann oder von denen man Werte auf den Leitungen abgreifen kann.<br />
Danach wird ein RS232 Modul mit dem Namen uut (&#8220;unit under test&#8221;) instanziert und die Ports des Moduls werden mit den internen Signalen verknüpft.<br />
Dann folgen wieder Prozesse. Der erste generiert das Clocksignal und der zweite ist für den eigentlichen Ablauf des Test verantwortlich. Das Senden ist hier relativ einfach: Wert in tx_data schreiben, für kurze Zeit an tx_start ziehen und dann beginnt die Übertragung.</p>
<p>Der Empfangstest ist dahingehend schwieriger, dass jedes Bit für eine bestimmte Zeit anliegen muss, wie es in Wirklichkeit auf einem Kabel auch der Fall wäre.<br />
clk_period*435 entspricht hier exakt 8,7µs, was wiederrum ungefähr 115200 Baud/s entspricht: 20ns*435 = 8700ns = 8,7µs</p>
<p>Als nächstes werde ich mich mal an den VGA Ausgang setzen und probieren ein Bild zu zaubern. Danach ist allerdings auch schon der DDR2-Speichercontroller dran: Für ein 12 Bit VGA-Bild bei einer Auflösung von 640&#215;480 Pixeln sind schon 450KB Video RAM nötig. Mit double buffering sind wir dann bei 900KB.</p>
<p><strong>Update:</strong> Das RS232 Modul stammt im übrigen von <a href="http://www.lothar-miller.de/s9y/categories/42-RS232" target="_blank">hier</a>. Lediglich den Testbench habe ich mir dann noch dazugeschrieben.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'G33KatWork';
var flattr_url = 'http://www.geekatwork.de';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'G33K @ Work';
var flattr_dsc = 'Basteleien eines Geeks';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2010/01/17/i-can-haz-fpga/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Systemprogrammierung</title>
		<link>http://www.geekatwork.de/2010/01/03/systemprogrammierung/</link>
		<comments>http://www.geekatwork.de/2010/01/03/systemprogrammierung/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 00:08:14 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[OSDev]]></category>
		<category><![CDATA[The usual rants]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Virtualisierung]]></category>

		<guid isPermaLink="false">http://www.geekatwork.de/?p=81</guid>
		<description><![CDATA[Mein momentanes Interessenfeld bezieht sich ja sehr sta [...]]]></description>
			<content:encoded><![CDATA[<p>Mein momentanes Interessenfeld bezieht sich ja sehr stark auf alles, was mit System- und Hardwarenaher Programmierung zu tun hat.<br />
Da ich auf der Zugfahrt zum <a href="http://events.ccc.de/congress/2009" target="_blank">26c3</a> nicht besonders viel zu tun hatte und die AMD und Intel Dokumentationen auf meinem Rechner hatte, habe ich mal angefangen mich um die <a href="http://de.wikipedia.org/wiki/Virtualisierung_%28Informatik%29" target="_blank">Virtualisierungsfunktionen</a>, die diese beiden Hersteller da so in ihre Prozessoren verpflanzen, zu kümmern.<span id="more-81"></span></p>
<p>Nachdem ich dann auch irgendwann mal raushatte, wie ich das vierstufige (!) Paging mit 4KB großen Pages beim Booten zusammenbauen konnte, um so einen Prozessor in den <a href="http://de.wikipedia.org/wiki/AMD64#Betriebsmodi" target="_blank">Long Mode</a> zu bekommen, hab ich mich mal an die Virtualisierung machen wollen.<br />
Zu diesem Zeitpunkt saß ich allerdings schon im Hackcenter.</p>
<p>Wie ich dann, mal wieder, feststellen musste, hat so ein Low Level Zeug einen unglaublichen Rattenschwanz, den man immer wieder hinter sich herzieht. In diesem konrekten Fall brauchte ich also ein vernünftiges <a href="http://de.wikipedia.org/wiki/Interrupt" target="_blank">Interrupthandling</a>. Ist ja schnell implementiert, dachte ich mir und kopier mir meinen Code aus meinen anderen <a href="http://www.geekatwork.de/projekte/geexos/" target="_self">Projekten</a> fröhlich zusammen.</p>
<p>Interrupts konnte ich dann handlen. Problem war jetzt nur, dass 2 Instruktionen nach dem Aktivieren der Interrupts sofort der Interrupt #8 auftrat, was nach Dokumentation ein Double Fault gewesen sein müsste. Dieser tritt aber nur nach einer fatalen, vorhergegangenen Exception auf, wovon ich aber nichts mitbekommen habe. Wieso fliegt da also ein Double Fault? Nichtmal die 2 Instruktionen, die nach dem setzen des Interrupt Enable Flags ausgeführt wurden konnten einen solchen Interrupt auslösen, weil es Sprünge zu sich selbst waren, um die CPU in einer Endlosschleife zu halten.</p>
<p>Kommen wir zurück zum Rattenschwanz: Nachdem ich dann die Interrupt Handler und die Verwaltung der IDT hatte, habe ich noch Routinen zur Verwaltung der <a href="http://de.wikipedia.org/wiki/Global_Descriptor_Table" target="_blank">GDT</a> implementiert. Es funktionierte immernoch nicht, was allerdings zu erwarten war, da es mehr eine Verzweifelungstat war als ein richtiger Lösungsansatz. Wir sind zu diesem Zeitpunkt bei Tag 3 des Kongresses.<br />
Allerdings war das ja auch nicht das Einzige, was ich da gemacht habe. Gab ja noch Vorträge.</p>
<p>Danach gings ans Debuggen. Ich habe VMware probiert, um zu sehen, was das Ding sagt. Wie erwartet: nichts. Es fehlen einfach die Debuggingmöglichkeiten unter Mac OS mit VMware.<br />
Dann gibts noch Qemu, an den man einen GDB klemmen kann. Gesagt getan. Nach wie vor nichts gefunden.<br />
Als letztes bin ich mit dem integrierten Debugger in Bochs dem Kram zu Leibe gerückt, mit dem man seinen Code auf Assemblerebene Debuggen konnte. Auch hier habe ich wieder nichts gefunden.</p>
<p>Was war das Ende vom Lied? Es gibt einen extra Chip auf x86 Systemem, der externe Interrupts handlet. Früher war das der <a href="http://de.wikipedia.org/wiki/Programmable_Interrupt_Controller" target="_blank">PIC (Programmable Interrupt Controller)</a> und heute ist es der <a href="http://de.wikipedia.org/wiki/APIC" target="_blank">APIC (Advanced Programmable Interrupt Controller)</a>, der auch Mehrprozessorsysteme ohne Gefrickel unterstützt.<br />
Diese Chips kann man so konfigurieren, dass jeder externe Interrupt (Tastatur, Floppy, Timer etc) auf einen der 256 Interrupts der CPU gemappt werden kann.</p>
<p>Irgendein Stück Software vor meinem Kernel hat genau das anscheinend mit dem Timerinterrupt gemacht und ihn auf Interrupt #8 gelegt.<br />
Das würde dann auch erklären, warum bei einem Double Fault eigentlich ein Errorcode auf den Stack gepusht werden sollte, was bei mir aber nie passiert ist. Es war schlicht und ergreifend kein Double Fault.</p>
<p>Also hab ich dann doch, entgegen meiner vorherigen &#8220;Brauchste eh nich&#8221;-Meinung, auch noch Code hinzugefügt, der den PIC (eigentlich sind es 2 PICs) entsprechend konfiguriert und die 16 Interrupts, die er verwalten kann, hinter die Exceptions mappt.</p>
<p>Was ist? Es funktioniert endlich.</p>
<p>Und so kann man sich wunderschön auf die Fresse legen und Zeit verbraten.<br />
Ich will nicht sagen ich hab nichts gelernt, genervt hat es aber doch schon ziemlich. Gedauert hat der ganze Prozess jetzt 6 Tage. Und ich hab immernoch keinen virtualisierten Code laufen.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2010/01/03/systemprogrammierung/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apple ][</title>
		<link>http://www.geekatwork.de/2009/12/19/apple/</link>
		<comments>http://www.geekatwork.de/2009/12/19/apple/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 23:42:41 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Apple 2]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[Elektronik]]></category>
		<category><![CDATA[Vintage Computing]]></category>

		<guid isPermaLink="false">http://galauner.de/wp/?p=65</guid>
		<description><![CDATA[Damals - genau genommen im Jahre 1984, also noch lange  [...]]]></description>
			<content:encoded><![CDATA[<p>Damals &#8211; genau genommen im Jahre 1984, also noch lange meiner Zeit &#8211; entschloss sich mein Vater sich einen Heimcomputer zu kaufen: Ein Nachbau eines Apple 2.<br />
Dazu ein Matsuhita Floppy, einen passenden Floppycontroller, eine 16KB Speichererweiterung (&#8220;Language Card&#8221;) und eine Z/80 CPU-Karte.</p>
<p>Seit seiner Einmottung verstaubte dieses schöne Stück Computergeschichte auf unserem Dachboden und ich habe dieses Gerät nie vorher angefasst&#8230; Bis letztes Wochenende.<span id="more-65"></span></p>
<p>Ich hole das Teil also vom Speicher, schließe den UHF-Konverter an den Antennenausgang meines Fernsehers und schalte ihn ein. Man hört ein &#8220;MIEP&#8221; und das Floppy rattert kurz.<br />
Nachdem ich dann versuchte ein lesbares Bild auf meinem Fernseher zu bekommen und es nach 15 Minuten immernoch Schatten warf und krisselig war, sodass man es kaum lesen konnte, gab ich auf und fand mich damit ab. Bunt kam da auch nichts raus <img src='http://www.geekatwork.de/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Also kein &#8220;hochauflösender Grafikmodus&#8221;.</p>
<p>Im Laufe des Abends/der Nacht blätterte ich also durch ein, ebenfalls vom Speicher gekramtes, Buch, in dem die Nutzung dieser schönen Maschine beschrieben war und irgendwann hab ich dann auch mal ein kleines Basic Programm auf eine, sogar noch leere, Diskette gespeichert.</p>
<p>Am nächsten Tag habe ich mir dann auch mal ein Chinch-Kabel und einen Scart-Adapter gesucht, um endlich mal ein vernünftiges Bild (hoffentlich auch mit Farbe) zu bekommen. Hinten am Apple fällt nämlich sowieso Composite raus, das man direkt in einen heutigen Fernseher schieben kann. Die UHF-Konverter waren vor 20 Jahren nur nötig, weil kein Fernseher Composite Signale verarbeiten konnte. Das konnten damals halt nur Monitore &#8211; und die waren teuer.<br />
Also Flux angeklemmt und man bekam ein extrem cooles und um Welten besseres 40&#215;25 Zeichen großes Bild zu Gesicht. Die Color-Demos auf der Apple DOS 3.3 Master Disk blieben allerdings schwarz/weiß:<br />
<a rel="lightbox[apple2]" href="http://www.geekatwork.de/wp-content/uploads/3mzz.jpg"><img class="alignnone size-medium wp-image-66" title="3mzz" src="http://www.geekatwork.de/wp-content/uploads/3mzz-300x225.jpg" alt="3mzz" width="300" height="225" /></a></p>
<p>Weil ich weitere Informationen über den Computer gesucht habe, bin ich auch über die Software <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAcQFjAA&amp;url=http%3A%2F%2Fadtpro.sourceforge.net%2F&amp;ei=5xEsS83IKJPJ_gabmtGCCQ&amp;usg=AFQjCNHVbSaTiNESuE_MOukgmSBRvWEGow&amp;sig2=gRIprYfCGipN5NBtN9o2rg" target="_blank">ADTPro</a> gestolpert. Mit ihr ist es Möglich Diskettenimages, die man auch im Netz findet, per Audio-Interface des Apples, an den man normalerweile einen Kasettenrekorder anschließt, zu übertragen und auch auf eine reale Diskette zu schreiben. Getestet habe ich das mangels Klinkenkabel noch nicht. Die Videos sehen aber sehr vielversprechend aus.</p>
<p>Genauso fand ich das FAQ der <a href="http://home.swbell.net/rubywand/A2FAQs5MAINHALL.html" target="_blank">Usenetgruppe comp.sys.apple2</a>, um überhaupt erstmal rauszufinden, was das denn nun genau für ein Apple 2 war, da es einige verschiedene gab: Apple II, Apple II+, Apple IIe(uro), Apple IIe(uro)+ etc.<br />
Was hier vor mir stand war also dann ein Nachbau eines Apple IIe oder IIe+, mit Apple II+-Tastatur und Apple IIe+ Roms.<br />
Wieso? Der Apple hat seit II+ hat einen sogenannten Autostart-Monitor, der einen nach dem Einschalten nicht direkt auf den Monitor-Prompt wirft, sondern, falls eine Floppy- oder SCSI-Karte installiert ist wird versucht ein DOS zu laden.<br />
Zusätzlich muss man, damit der &#8220;Reset&#8221;-Knopf auf der Tastatur seine Wirkung zeigt gleichzeitig Control drücken. Der Apple II (ohne +) hatte das noch nicht.<br />
Laut Originalrechnung ist das aber kein richtiger Apple IIe+ von Apple, sondern ein MEWA II, den ich im Netz nur auf einer Webseite mit der Bezeichnung MEWA-48 gefunden habe.<br />
<a rel="lightbox[apple2]" href="http://www.geekatwork.de/wp-content/uploads/o3nc.jpg"><img class="alignnone size-medium wp-image-67" title="Apple 2" src="http://www.geekatwork.de/wp-content/uploads/o3nc-225x300.jpg" alt="Apple 2" width="225" height="300" /></a></p>
<p>Später habe ich dann das Buch &#8220;Understanding the Apple 2&#8243; gefunden. Sehr interessant. Der komplette Computer ist erklärt. Jedes einzelne Teil vom Taktgenerator bis hin zur Adressdekodierung am Bus. Das schöne ist, dass man bei diesen alten Computern wirklich noch alles nachvollziehen kann. Keine hochwissenschaftlichen, mit Marketing-Buzzwords gespickten und bis unter die Zähne patentierte Bussysteme oder generische Chips, über die es keine Information gibt.</p>
<p>Das Problem an diesem Gerät ist nur, dass es wahrscheinlich ein IIe+ ist. Steve Wozniak hat damals, um das Composite Signal PAL-Kompatibel zu bekommen einiges am Videogenerator ändern müssen. Leider fiel diesen Änderungen auch der Farbmodus zum Opfer. Es gibt PAL-Karten, die man einstecken kann, um Farbe als PAL-Signal zu bekommen, nach denen ich aber bisher nicht gesucht habe.<br />
Ich bin mir da nicht sicher, weil ich nicht wirklich weiß, was da jetzt für ein Signal rauskommt. NTSC kann dieser kleine Billigfernseher aber höchstwahrscheinlich nicht anzeigen. Ich geh also mal von einem IIe+ aus, der PAL rauswirft.</p>
<p>Was ich mir noch für Extension Karten besorgen möchte sind die PAL-Karte und eine Serial-Karte für eine serielle Schnittstelle. PAL-Karte für ein buntes Bild und Serial kann man immer brauchen, wenn man mit der &#8220;mordernen Welt&#8221; einigermaßen kommunizieren möchte.</p>
<p>Auf jeden Fall macht das Teil Spaß!</p>
<p><strong>Update:</strong> Es ist doch kein IIe. Wie ich grade im Buch &#8220;Understanding the Apple IIe&#8221; gelesen habe, besitzt der einen &#8220;Auxiliary Slot&#8221;. Den hat mein Apple definitiv nicht. Das heißt entweder spuckt der wirklich NTSC aus oder es ist ein II+ mit angepasstem Videosignalgenerator. Die Möglichkeit besteht, weil das ja swieso ein Klon ist, den man ja dann entsprechend anpassen könnte.</p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'G33KatWork';
var flattr_url = 'http://www.geekatwork.de';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'G33K @ Work';
var flattr_dsc = 'Basteleien eines Geeks';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2009/12/19/apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neues Blog :)</title>
		<link>http://www.geekatwork.de/2009/12/15/neues-blog/</link>
		<comments>http://www.geekatwork.de/2009/12/15/neues-blog/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 06:29:09 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Webseite]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://galauner.de/wp/?p=38</guid>
		<description><![CDATA[So.
Ich hab mich jetzt doch mal entschieden Wordpress  [...]]]></description>
			<content:encoded><![CDATA[<p>So.<br />
Ich hab mich jetzt doch mal entschieden WordPress ne Chance zu geben.</p>
<p>Die alte Rails Webseite ist nie wirklich fertig geworden. Mit Rails selber konnte ich mich auch nie so wirklich anfreunden. Und die Lust zum Webdevelopment fehlte auch gänzlich.</p>
<p>Also schnell ein WordPress Template umgehackt und hier ist es. Sieht doch ganz gut aus.<br />
Jetzt fehlt wie immer der Content.</p>
 <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2009/12/15/neues-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KiCAD FTW, EAGLE -&gt; fail!</title>
		<link>http://www.geekatwork.de/2009/01/29/kicad-ftw-eagle-fail/</link>
		<comments>http://www.geekatwork.de/2009/01/29/kicad-ftw-eagle-fail/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 15:16:50 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Elektronik]]></category>
		<category><![CDATA[The usual rants]]></category>
		<category><![CDATA[Eagle]]></category>
		<category><![CDATA[KiCAD]]></category>
		<category><![CDATA[Layout]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PCB]]></category>
		<category><![CDATA[Schaltplan]]></category>

		<guid isPermaLink="false">http://galauner.de/wp/?p=19</guid>
		<description><![CDATA[Nachdem ich in den letzten Tagen einige Differenzen mit [...]]]></description>
			<content:encoded><![CDATA[<p>Nachdem ich in den letzten Tagen einige Differenzen mit EAGLE hatte, was die Legalität meiner Lizenz anging und dem daraus resultierenden Datenverlust, hab ich mich schlussendlich mal nach Alternativen umgesehen. Ich hab echt überlegt, ob ich die 125 Eier für die Non-Profit Version mal auf den Tisch leg, aber nach dem Scheiß können die mich mal. Ich hab jetzt eh was besseres. Bääh! <img src='http://www.geekatwork.de/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> <span id="more-19"></span></p>
<p>Also&#8230; Es geht um <a title="KiCAD" href="http://www.lis.inpg.fr/realise_au_lis/kicad/">KiCAD</a>. KiCAD ist eine Suite, mit der man Schaltpläne und Platinen Zeichnen und Layouten kann. Von irgendsonem Franzosen an irgendsonem &#8220;Laboratoire des bla&#8230;.&#8221; entwickelt. Im Prinzip wie EAGLE, nur mit dem kleinen aber feinen Unterschied, dass es komplett Open Source ist.</p>
<p>Die Bedienung ist etwas gewöhnungsbedürftig, aber verdammt schnell, wenn mans drauf hat. Es gibt einige verbesserungswürdige Punkte, aber die gibts immer. Mit einigen Buchstaben auf der Tastatur hat man sofort ein Bauteil unter Kontrolle. Nichtmal klicken muss man. Maus drüber, &#8220;m&#8221; drücken und Bauteil verschieben. Einmal klicken oder nochmal &#8220;m&#8221; drücken und fertig. Dasselbe gilt für &#8220;r&#8221; beim rotieren, &#8220;w&#8221; beim Wire verlegen usw.</p>
<p>Erste Ergebnisse nach 2 bis 3 Stunden Arbeit sieht man hier:<br />
<a rel="lightbox" href="http://www.geekatwork.de/wp-content/uploads/kicad-1024x819.png"><img class="alignnone size-medium wp-image-20" title="kicad" src="http://www.geekatwork.de/wp-content/uploads/kicad-300x240.png" alt="kicad" width="300" height="240" /></a></p>
<p>Eine geniale Anlaufstelle ist das <a title="Wiki" href="http://kicad.sourceforge.net/wiki/index.php">Wiki</a> mit seinem <a title="Schnelleinsteiger-Howto" href="http://kicad.sourceforge.net/wiki/index.php/DE:Mini_tutorial">Schnelleinsteiger-Howto</a>. Für Umsteiger von EAGLE gibts <a title="hier" href="http://library.oshec.org/">hier</a> noch eine Sammlung konvertierter Libraries. Eigene EAGLE Libraries kann man wohl auch relativ easy importieren. Weiteres gibts hier im <a title="FAQ" href="http://kicad.sourceforge.net/wiki/index.php/FAQ#How_do_I_import_libraries_from_other_PCB_programs.3F">FAQ</a>. Das ganze habe ich bisher aber noch nicht getestet.</p>
<p><em>Nachtrag:</em> Die ULPs für EAGLE gibts alle hier: <a title="Sourceforge" href="http://sourceforge.net/project/showfiles.php?group_id=123224&amp;package_id=134585">Sourceforge</a></p>
<script type="text/javascript">
var flattr_wp_ver = '0.9.11';
var flattr_uid = 'G33KatWork';
var flattr_url = 'http://www.geekatwork.de';
var flattr_lng = 'en_GB';
var flattr_cat = 'text';
var flattr_tag = 'blog,wordpress,rss,feed';
var flattr_btn = 'large';
var flattr_tle = 'G33K @ Work';
var flattr_dsc = 'Basteleien eines Geeks';
</script>
<script src="http://api.flattr.com/button/load.js?v=0.2" type="text/javascript"></script> <p>Feel free to Flattr this post at <a href="http://flattr.com/" title="Flattr" target="_blank">flattr.com</a>, if you like it.</p> <p><a href="http://flattr.com/" title="Flattr" target="_blank"><img src="http://www.geekatwork.de/wp-content/plugins/flattrss/button-compact-static-100x17.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.geekatwork.de/2009/01/29/kicad-ftw-eagle-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
