<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Lukasz.dk</title>
 <link href="http://lukasz.dk/atom.xml" rel="self"/>
 <link href="http://lukasz.dk/"/>
 <updated>2013-01-05T09:45:31+01:00</updated>
 <id>http://lukasz.dk/</id>
 <author>
   <name>Lukasz</name>
   <email>mail@lukasz.dk</email>
 </author>

 
 <entry>
   <title>Pixel Perfect Bitmap Font in Unity</title>
   <link href="http://lukasz.dk/2011/05/01/pixel-perfect-bitmap-font-in-unity/"/>
   <updated>2011-05-01T00:00:00+02:00</updated>
   <id>http://lukasz.dk/2011/05/01/pixel-perfect-bitmap-font-in-unity</id>
   <content type="html">&lt;script language=&quot;javascript1.1&quot; type=&quot;text/javascript&quot; src=&quot;/js/UnityScripts.js&quot;&gt;&lt;/script&gt;&lt;p&gt;&lt;/p&gt;
&lt;h1&gt;Pixel Perfect Bitmap Font in Unity&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;2011-05-01&lt;/p&gt;
&lt;p&gt;I have been playing around with &lt;a href=&quot;http://forum.unity3d.com/threads/16763&quot;&gt;Sprite Manager&lt;/a&gt; for &lt;a href=&quot;http://unity3d.com&quot;&gt;Unity&lt;/a&gt;, which allows you to draw all your 2D sprites in one draw call. I wanted to be able to draw pixel perfect text using Sprite Manager and since I was unable to find any example of this, I wrote my own implementation.&lt;/p&gt;
&lt;p&gt;Click on the image below to see the text rendered inside the Unity Web Player.&lt;/p&gt;
&lt;div id=&quot;1&quot;&gt;&lt;a href=&quot;#1&quot;&gt;&lt;img src=&quot;/images/bitmap-font-unity-demo.png&quot; onclick=&quot;javascript:LoadUnityAfterClick('/unity/BitmapFontDemo.unity3d', '550', '350', '1')&quot; border=&quot;0&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;noscript&gt;
&lt;p&gt;&lt;object id=&quot;Object1&quot; classid=&quot;clsid:444785F1-DE89-4295-863A-D46C3A781394&quot; width=&quot;550&quot; height=&quot;350&quot; codebase=&quot;http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayer.cab#version=2,0,0,0&quot;&gt;&lt;br /&gt;
	&lt;param name=&quot;src&quot; value=&quot;/unity/BitmapFontDemo.unity3d&quot; /&gt;&lt;br /&gt;
	&lt;embed id=&quot;UnityEmbed&quot; src=&quot;/unity/BitmapFontDemo.unity3d&quot; width=&quot;550&quot; height=&quot;350&quot; type=&quot;application/vnd.unity&quot; pluginspage=&quot;http://www.unity3d.com/unity-web-player-2.x&quot; /&gt;&lt;br /&gt;
	&lt;noembed&gt;&lt;br /&gt;
		&lt;div align=&quot;center&quot;&gt;&lt;br /&gt;
			This content requires the Unity Web Player&lt;br /&gt;&lt;br /&gt;
			&lt;a href=&quot;http://www.unity3d.com/unity-web-player-2.x&quot;&gt;Install the Unity Web Player today!&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/noembed&gt;
&lt;p&gt;&lt;/object&gt;&lt;/p&gt;
&lt;/noscript&gt;
&lt;p&gt;I have made a small Unity package that contains the script for my bitmap font loader and the example scene shown above. All scripts in the package except SpriteManager.cs are released into the Public Domain.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/files/BitmapFontDemo.unitypackage&quot;&gt;Download BitmapFontDemo.unitypackage&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Generation of bitmap font&lt;/h2&gt;
&lt;p&gt;In order for Sprite Manager to be able to render text, it has to be included in a texture. For generating the font texture I used &lt;a href=&quot;http://blogs.msdn.com/b/garykac/archive/2006/08/30/732007.aspx&quot;&gt;BMFontGen&lt;/a&gt; developed for &lt;a href=&quot;http://en.wikipedia.org/wiki/Microsoft_XNA&quot;&gt;&lt;span class=&quot;caps&quot;&gt;XNA&lt;/span&gt;&lt;/a&gt;. BMFontGen converts a TrueType or OpenType font into a bitmap (&lt;span class=&quot;caps&quot;&gt;PNG&lt;/span&gt;) along with a &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; descriptor file.&lt;/p&gt;
&lt;p&gt;The BitmapFontDemo package includes a parser for the &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; descriptor file that can be used with Sprite Manager. I use my own &lt;a href=&quot;/2011/04/18/texture-atlas-generator/&quot;&gt;Texture Atlas Generator&lt;/a&gt; to combine the two font textures used in the package into one texture.&lt;/p&gt;
&lt;p&gt;When importing the font texture it is important to change &amp;#8220;Filter Mode&amp;#8221; to &amp;#8220;Point&amp;#8221; and disable &amp;#8220;Generate Mip Maps&amp;#8221; by setting &amp;#8220;Texture Type&amp;#8221; to &amp;#8220;Advanced&amp;#8221;. Use the shader &amp;#8220;Particles/Alpha Blended&amp;#8221; for the material associated with the texture.&lt;/p&gt;
&lt;h2&gt;Pixel perfect orthographic projection&lt;/h2&gt;
&lt;p&gt;To get pixel perfect rendering of the font (or any 2D for that matter) you have to setup the orthographic projection very precisely. To make this easy in the example scene included in the Unity package above, I have made a script that can be added to the camera and it will automatically setup the orthographic projection.&lt;/p&gt;
&lt;p&gt;Liquid error: undefined method `join&amp;#8217; for #&lt;String:0x1101cb860&gt;&lt;/p&gt;
&lt;p&gt;Note that the camera is offset by a half-pixel when using Direct3D 9 on Windows, further details on why this is necessary &lt;a href=&quot;http://drilian.com/2008/11/25/understanding-half-pixel-and-half-texel-offsets/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/bitmap-font-unity-demo-color.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The screenshot above shows that you can also change the color of the individual characters using Sprite Manager. I got the result above by changing the following (long) line of code in BitmapFontDemo.AddText&lt;/p&gt;
&lt;p&gt;Liquid error: undefined method `join&amp;#8217; for #&lt;String:0x1101c9ce0&gt;&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;Liquid error: undefined method `join&amp;#8217; for #&lt;String:0x1101c6090&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Another minor update showing how to draw dynamic text that is updated every frame. Click on the image below to see it in action in the Unity Web Player.&lt;/p&gt;
&lt;div id=&quot;2&quot;&gt;&lt;a href=&quot;#2&quot;&gt;&lt;img src=&quot;/images/bitmap-font-unity-demo-2.png&quot; onclick=&quot;javascript:LoadUnityAfterClick('/unity/BitmapFontDemo2.unity3d', '550', '450', '2')&quot; border=&quot;0&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;noscript&gt;
&lt;p&gt;&lt;object id=&quot;Object2&quot; classid=&quot;clsid:444785F1-DE89-4295-863A-D46C3A781394&quot; width=&quot;550&quot; height=&quot;450&quot; codebase=&quot;http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayer.cab#version=2,0,0,0&quot;&gt;&lt;br /&gt;
	&lt;param name=&quot;src&quot; value=&quot;/unity/BitmapFontDemo2.unity3d&quot; /&gt;&lt;br /&gt;
	&lt;embed id=&quot;UnityEmbed&quot; src=&quot;/unity/BitmapFontDemo2.unity3d&quot; width=&quot;550&quot; height=&quot;450&quot; type=&quot;application/vnd.unity&quot; pluginspage=&quot;http://www.unity3d.com/unity-web-player-2.x&quot; /&gt;&lt;br /&gt;
	&lt;noembed&gt;&lt;br /&gt;
		&lt;div align=&quot;center&quot;&gt;&lt;br /&gt;
			This content requires the Unity Web Player&lt;br /&gt;&lt;br /&gt;
			&lt;a href=&quot;http://www.unity3d.com/unity-web-player-2.x&quot;&gt;Install the Unity Web Player today!&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/noembed&gt;
&lt;p&gt;&lt;/object&gt;&lt;/p&gt;
&lt;/noscript&gt;
&lt;p&gt;&lt;a href=&quot;/files/BitmapFontDemo2.unitypackage&quot;&gt;Download BitmapFontDemo2.unitypackage&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Texture Atlas Generator</title>
   <link href="http://lukasz.dk/2011/04/18/texture-atlas-generator/"/>
   <updated>2011-04-18T00:00:00+02:00</updated>
   <id>http://lukasz.dk/2011/04/18/texture-atlas-generator</id>
   <content type="html">&lt;h1&gt;Texture Atlas Generator&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;2011-04-18&lt;/p&gt;
&lt;p&gt;One of the performance bottlenecks when rendering polygons using a dedicated &lt;span class=&quot;caps&quot;&gt;GPU&lt;/span&gt; is the number of draw calls issued by the application. For textured polygons, you usually bind one texture for each draw call and all the polygons will be textured using this one texture. This means that you will get at least one draw call for every texture used in your application.&lt;/p&gt;
&lt;p&gt;To reduce the number of draw calls for textured polygons, you can put all your individual textures files into one or more big texture files, also known as a &lt;em&gt;texture atlas&lt;/em&gt;. This way all the polygons that use the same atlas can be batched together and rendered in one draw call.&lt;/p&gt;
&lt;p&gt;If you have all your textures as separate files, then creating the atlas by hand can be a quite painstaking experience. I have therefor made this small, single file, Java application that will recursively load &lt;span class=&quot;caps&quot;&gt;PNG&lt;/span&gt; (can easily be modified to support other formats) from a folder and create one or more &lt;span class=&quot;caps&quot;&gt;PNG&lt;/span&gt; texture atlases.&lt;/p&gt;
&lt;p&gt;Get it on GitHub : &lt;a href=&quot;http://github.com/lukaszdk/texture-atlas-generator&quot;&gt;Texture Atlas Generator&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The texture packing algorithm used in this atlas generator is the &lt;a href=&quot;http://www.blackpawn.com/texts/lightmaps/&quot;&gt;Lightmap Packing Algorithm&lt;/a&gt; by &lt;a href=&quot;http://www.blackpawn.com&quot;&gt;Black Pawn&lt;/a&gt;. The images are added to the atlas by area size (width x height), in descending order.&lt;/p&gt;
&lt;p&gt;I will show how to use the atlas generator by example.&lt;/p&gt;
&lt;p&gt;First I downloaded the abuse_png.zip archive from &lt;a href=&quot;http://opengameart.org/content/abuse-art&quot;&gt;OpenGameArt.org&lt;/a&gt; and extracted the contents into a folder named &amp;#8220;abuse_png&amp;#8221; next AtlasGenerator.java.&lt;/p&gt;
&lt;p&gt;I then compiled the application&lt;/p&gt;
&lt;pre&gt;javac AtlasGenerator.java &lt;/pre&gt;
&lt;p&gt;and executed it&lt;/p&gt;
&lt;pre&gt;java AtlasGenerator atlas-2048- 2048 2048 abuse_png/&lt;/pre&gt;
&lt;p&gt;This generated the atlas &lt;span class=&quot;caps&quot;&gt;PNG&lt;/span&gt; texture below. Click the image below to get the full size image.&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;a href=&quot;/images/atlas-2048-1.png&quot;&gt;&lt;img src=&quot;/images/atlas-2048-1-small.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Along with the atlas image there is also a .txt file generated with coordinates for all the textures within the atlas.&lt;/p&gt;
&lt;p&gt;The format for each entry is:&lt;/p&gt;
&lt;pre&gt;imagePath x y width height&lt;/pre&gt;
&lt;p&gt;Here is what the .txt file for the atlas above looks like.&lt;/p&gt;
&lt;pre&gt;abuse_png/ammo 400 765 108 69
abuse_png/ant 0 0 780 495
abuse_png/back_cave 836 867 300 120
abuse_png/back_city 1308 495 420 150
abuse_png/back_intro 1674 344 360 150
abuse_png/back_tech 1359 675 360 150
abuse_png/blowups 1136 867 301 96
abuse_png/bold 1505 351 153 86
abuse_png/cloud 1505 437 68 45
abuse_png/concus 1573 437 63 34
abuse_png/cop 780 0 429 462
abuse_png/coptop 1209 0 465 351
abuse_png/door 1926 195 72 120
abuse_png/door_round 330 1386 180 82
abuse_png/exp1 1719 675 280 192
abuse_png/flyer 0 1710 296 234
abuse_png/fonts 0 1556 512 154
abuse_png/fore_cave 918 495 390 165
abuse_png/fore_techno 1728 495 300 135
abuse_png/fore_techno2 540 1084 270 120
abuse_png/fore_techno3 330 1296 210 90
abuse_png/fore_techno4 0 1080 420 216
abuse_png/gun2 540 867 296 217
abuse_png/jug 540 495 378 180
abuse_png/lava 330 1468 190 36
abuse_png/lavap 296 1710 235 132
abuse_png/lightin 1926 0 114 195
abuse_png/mine 400 834 112 60
abuse_png/misc 0 765 400 315
abuse_png/missle 540 675 351 192
abuse_png/platform 891 675 468 134
abuse_png/push 780 462 252 22
abuse_png/rob1 1209 351 296 141
abuse_png/rob2 0 1296 330 260
abuse_png/sect 0 495 540 270
abuse_png/tdoor 0 1944 245 45
abuse_png/teleport 1674 0 252 344&lt;/pre&gt;
&lt;p&gt;If the images do not fit into one atlas of the specified size, then multiple atlases will be generated. The images below show the 3 atlases generated for the PNGs when setting&lt;br /&gt;
the size of the atlas to 1024&amp;#215;1024.&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;a href=&quot;/images/atlas-1024-1.png&quot;&gt;&lt;img src=&quot;/images/atlas-1024-1-small.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;a href=&quot;/images/atlas-1024-2.png&quot;&gt;&lt;img src=&quot;/images/atlas-1024-2-small.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;a href=&quot;/images/atlas-1024-3.png&quot;&gt;&lt;img src=&quot;/images/atlas-1024-3-small.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Below are 3 .txt files for the 3 images above.&lt;/p&gt;
&lt;pre&gt;abuse_png/ammo 894 252 108 69
abuse_png/ant 0 0 780 495
abuse_png/cloud 357 957 68 45
abuse_png/concus 780 453 63 34
abuse_png/cop 0 495 429 462
abuse_png/coptop 429 495 465 351
abuse_png/door 894 132 72 120
abuse_png/fonts 429 846 512 154
abuse_png/fore_techno3 780 327 210 90
abuse_png/lava 780 417 190 36
abuse_png/lavap 780 0 235 132
abuse_png/lightin 780 132 114 195
abuse_png/mine 245 957 112 60
abuse_png/push 429 1000 252 22
abuse_png/tdoor 0 957 245 45&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre&gt;abuse_png/back_cave 696 806 300 120
abuse_png/blowups 696 926 301 96
abuse_png/door_round 0 929 180 82
abuse_png/exp1 730 270 280 192
abuse_png/flyer 400 530 296 234
abuse_png/fore_techno 696 671 300 135
abuse_png/fore_techno4 540 0 420 216
abuse_png/gun2 400 764 296 217
abuse_png/misc 0 270 400 315
abuse_png/rob1 696 530 296 141
abuse_png/rob2 400 270 330 260
abuse_png/sect 0 0 540 270
abuse_png/teleport 0 585 252 344&lt;/pre&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;pre&gt;abuse_png/back_city 351 180 420 150
abuse_png/back_intro 351 464 360 150
abuse_png/back_tech 351 614 360 150
abuse_png/bold 768 0 153 86
abuse_png/fore_cave 378 0 390 165
abuse_png/fore_techno2 0 372 270 120
abuse_png/jug 0 0 378 180
abuse_png/missle 0 180 351 192
abuse_png/platform 351 330 468 134
&lt;/pre&gt;</content>
 </entry>
 
 <entry>
   <title>Ubuntu 8.10 and ATI Dual Head</title>
   <link href="http://lukasz.dk/2009/03/17/ubuntu-810-and-ati-dual-head/"/>
   <updated>2009-03-17T00:00:00+01:00</updated>
   <id>http://lukasz.dk/2009/03/17/ubuntu-810-and-ati-dual-head</id>
   <content type="html">&lt;h1&gt;Ubuntu 8.10 and &lt;span class=&quot;caps&quot;&gt;ATI&lt;/span&gt; Dual Head&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;2009-03-17&lt;/p&gt;
&lt;p&gt;Yesterday I was trying to a get dual monitor configuration / virtual desktop (&lt;span class=&quot;caps&quot;&gt;VGA&lt;/span&gt; and &lt;span class=&quot;caps&quot;&gt;DVI&lt;/span&gt;)  working  in &lt;a href=&quot;http://www.gnome.org&quot;&gt;&lt;span class=&quot;caps&quot;&gt;GNOME&lt;/span&gt;&lt;/a&gt; (Ubuntu 8.10) on my &lt;span class=&quot;caps&quot;&gt;ATI&lt;/span&gt; Radeon HD 2400 XT graphics card with a 1920&amp;#215;1200 &lt;span class=&quot;caps&quot;&gt;DVI&lt;/span&gt; screen and 1600&amp;#215;1200 &lt;span class=&quot;caps&quot;&gt;VGA&lt;/span&gt; screen connected, using the proprietary &lt;a href=&quot;http://en.wikipedia.org/wiki/Fglrx&quot;&gt;&lt;span class=&quot;caps&quot;&gt;FGLRX&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;ATI&lt;/span&gt; driver&lt;/a&gt; from the Ubuntu repositories.&lt;/p&gt;
&lt;p&gt;I was unsuccessful in getting dualhead working using only the command line aticonfig tool, so after a bit (actually a lot) of experimenting I was able to get working with using a combination of aticonfig and the Catalyst Control Center (amdcccle) tool.&lt;/p&gt;
&lt;p&gt;First thing I did was create an initial xorg.conf configuration file using the command below in shell, which sets up a basic dualhead configuration which can be altered using aticonfig and the Catalyst Control Center.&lt;/p&gt;
&lt;pre&gt;sudo aticonfig --initial=dual-head --overlay-type=Xv&lt;/pre&gt;
&lt;p&gt;I then rebooted (I was not always able to reload the driver by just restarting X). I then started the Catalyst Control Center by typing the following in a shell&lt;/p&gt;
&lt;pre&gt;sudo amdcccle&lt;/pre&gt;
&lt;p&gt;It is important to use sudo or else you wont be able to change the configuration. In the &amp;#8220;Display Manager&amp;#8221; section it is possible to setup the multi-display and specify how the screens are arranged. After you set this, reboot once again.&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/catalyst-control-center.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;p&gt;What should happen now is that when you restart you get the same image on both screens (mirrored/cloned). You now need to enter the &lt;span class=&quot;caps&quot;&gt;GNOME&lt;/span&gt; Screen Resolution configuration application (which in the default Ubuntu GNOME  setup is located under System &amp;#8211; Preferences). Here you should now be able to change the size of the desktop so that it uses the entire screen space on both screens.&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/gnome-screen-resolution.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;p&gt;One thing to note is that I also tried the very latest (9.2) &lt;span class=&quot;caps&quot;&gt;ATI&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;FGLRX&lt;/span&gt; driver, using this driver I actually got 2 screens in the &lt;span class=&quot;caps&quot;&gt;GNOME&lt;/span&gt; Screen Resolution application. They were positioned on top of each other (Mirror Screens was checked), which was  hard to see (and figure out). But you can actually click on the screens and then drag and arrange them so that they match you physical screen configuration. So you may want to try the latest driver if the one in the Ubuntu repositories does not work for you.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ubuntu and Winfast 2000XP EXPERT (LR6611)</title>
   <link href="http://lukasz.dk/2009/01/25/ubuntu-and-winfast-2000xp-expert-lr6611/"/>
   <updated>2009-01-25T00:00:00+01:00</updated>
   <id>http://lukasz.dk/2009/01/25/ubuntu-and-winfast-2000xp-expert-lr6611</id>
   <content type="html">&lt;h1&gt;Ubuntu and Winfast 2000XP &lt;span class=&quot;caps&quot;&gt;EXPERT&lt;/span&gt; (LR6611)&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;2009-01-25&lt;/p&gt;
&lt;p&gt;After a clean install of Ubuntu 8.10 my &lt;span class=&quot;caps&quot;&gt;OEM&lt;/span&gt; TV tuner card called LR6611 (came with a AOpen XC Cube EA 65-II) was no longer working and I had forgotten how I made it work years ago. The cx88xx video4linux driver is correctly loaded, but the card is not detected.  S-video and video works in &lt;a href=&quot;http://tvtime.sourceforge.net/&quot;&gt;tvtime&lt;/a&gt; out of the box, but the quality is poor.&lt;/p&gt;
&lt;p&gt;Below is the output from &lt;strong&gt;lspci -vnn&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;01:06.0 Multimedia video controller [0400]: Conexant Systems, Inc.
CX23880/1/2/3 PCI Video and Audio Decoder [14f1:8800] (rev 05)
Subsystem: AOPEN Inc. Device [a0a0:6f05]
Flags: bus master, medium devsel, latency 32, IRQ 17
Memory at e3000000 (32-bit, non-prefetchable) [size=16M]
Capabilities: &amp;lt;access denied&amp;gt;
Kernel driver in use: cx8800
Kernel modules: cx8800&lt;/pre&gt;
&lt;p&gt;After some searching I found some information on this card on the &lt;a href=&quot;http://www.spinics.net/lists/vfl/msg24737.html&quot;&gt;video4linux-list&lt;/a&gt;. Turns out that this card is a Leadtek Winfast 2000XP Expert &lt;span class=&quot;caps&quot;&gt;OEM&lt;/span&gt; variant, which you can also conclude from searching for &lt;a href=&quot;http://www.google.com/search?&amp;amp;q=LR6611&quot;&gt;LR6611&lt;/a&gt; in Google&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I used the information from the video4linux-list to configure the card by the following line to &lt;strong&gt;/etc/modprobe.d/options&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;options cx88xx i2c_scan=1 card=5 tuner=38&lt;/pre&gt;
&lt;p&gt;Now the card will be correctly configured when booting Ubuntu. You can also test the card without rebooting, by entering the following commands in a shell.&lt;/p&gt;
&lt;p&gt;Liquid error: undefined method `join&amp;#8217; for #&lt;String:0x11067dd90&gt;&lt;/p&gt;
&lt;p&gt;You can watch TV channels in tvtime now. When scanning for channels, do not worry about the &amp;#8220;no signal&amp;#8221; message, the scanner will eventually find the available channels.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/tvtime.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;S-video and video input quality has also greatly improved compared to the default cx88xx settings for this card.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ubuntu and VIA EPIA EN12000EG</title>
   <link href="http://lukasz.dk/2008/04/23/ubuntu-and-via-epia-en12000eg/"/>
   <updated>2008-04-23T00:00:00+02:00</updated>
   <id>http://lukasz.dk/2008/04/23/ubuntu-and-via-epia-en12000eg</id>
   <content type="html">&lt;h1&gt;Ubuntu and &lt;span class=&quot;caps&quot;&gt;VIA&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;EPIA&lt;/span&gt; EN12000EG&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;2008-04-23&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 21/09/08&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Since I wrote this post 5 months ago I have not been experiencing any issues with the EN12000EG when using it at 1200 MHz. However, 22 days ago I rebooted my EN12000EG and by mistake I forgot to set the &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; frequency to 1200 MHz, I did not realize this until about a week ago when I saw that the Gnome &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; Scaling Monitor was reporting the &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; frequency as 400 MHz (ondemand governor). For this period of 22 days I&amp;#8217;ve been using the server as I normally would, which 5 months ago would freeze the system within a week when using &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; scaling.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/en12000eg-uptime-sept20081.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;My best guess to why this is happening is probably a change in the Linux kernel which either fixed or got around this issue. The kernel I&amp;#8217;m currently using is Linux 2.6.24-21-generic i686 &lt;span class=&quot;caps&quot;&gt;GNU&lt;/span&gt;/Linux on Ubuntu 8.04 with all updates installed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Original Post&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Little over a month ago I bought and built myself a &lt;a href=&quot;http://en.wikipedia.org/wiki/Mini-ITX&quot;&gt;Mini-&lt;span class=&quot;caps&quot;&gt;ITX&lt;/span&gt;&lt;/a&gt; computer to use as a headless print/file/media/etc. server. For the motherboard I got a &lt;a href=&quot;http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=399&quot;&gt;&lt;span class=&quot;caps&quot;&gt;VIA&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;EPIA&lt;/span&gt; EN12000EG&lt;/a&gt; with a 1200 MHz &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt;, because it was passively cooled. I put it inside a &lt;a href=&quot;http://www.morex.com.tw/products/productdetail.php?fd_id=37&quot;&gt;Morex 3688&lt;/a&gt; chassis without using the chassis fan. After using it for a while, the system would &amp;#8220;randomly&amp;#8221; freeze completely. This would typically happened when I &amp;#8220;stressed&amp;#8221; system, e.g.. transferring files, printing and using &lt;span class=&quot;caps&quot;&gt;VNC&lt;/span&gt; at the same time. There was no rise in &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; temperature when this happened, so I did not think it was because the motherboard wasn&amp;#8217;t properly cooled without any fans running.&lt;/p&gt;
&lt;p&gt;The longest uptime I had until this point was about 6 days, but the computer would often just freeze after a few days use.&lt;/p&gt;
&lt;p&gt;So I thought it might be an I/O problem and I therefor updated the 1.07 &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt; to version 1.09, but the only thing I could tell changed was the &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; temperature was now reported as being around 20 °C instead around 45 °C previously with the 1.07 &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt;. Since this didn&amp;#8217;t resolve the system freezes either, I then tried to update to Ubuntu 8.04 beta, hoping the issue might have been resolved in the new version, however the system would still freeze on me.&lt;/p&gt;
&lt;p&gt;I had a problem with evolution-data-server using 90% of the &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; in Ubuntu 8.04, this is a &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/evolution-data-server/+bug/151536&quot;&gt;known bug&lt;/a&gt;. I resolved it by just uninstalling evolution-data-server, as I do not use Evolution.&lt;/p&gt;
&lt;pre&gt;sudo apt-get remove evolution-data-server&lt;/pre&gt;
&lt;p&gt;I had earlier found this &lt;a href=&quot;http://www.tkarena.com/forums/linux-arena/33503-en12000eg-freeze.html&quot;&gt;EN12000EG Freeze&lt;/a&gt; thread at the &lt;span class=&quot;caps&quot;&gt;VIA&lt;/span&gt; forums (registration required), where a lot of different solutions had been suggested, I tried some of the easy ones like changing the &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt; settings, but that still didn&amp;#8217;t resolve the problem. So I thought I&amp;#8217;d try disabling &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; frequency scaling as suggested by &lt;a href=&quot;http://www.tkarena.com/forums/linux-arena/33503-en12000eg-freeze-10.html#post232636&quot;&gt;rararasputin&lt;/a&gt; and this solution has worked for me so far.&lt;/p&gt;
&lt;p&gt;First I disabled &lt;em&gt;powernowd&lt;/em&gt; by in System &amp;#8594; Administration &amp;#8594; Services. However the cpu scaling software &lt;em&gt;cpufreq&lt;/em&gt; is active and uses the &lt;em&gt;On demand&lt;/em&gt; &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; scaling governor by default. There are few different ways to change this to the &lt;em&gt;Performance&lt;/em&gt; governor, which will keep the &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; at 1200 Mhz. One way is to use the &lt;em&gt;cpufreq-selector&lt;/em&gt; in a console like shown below&lt;/p&gt;
&lt;pre&gt;sudo cpufreq-selector -g performance&lt;/pre&gt;
&lt;p&gt;Another option, if you are using the &lt;em&gt;Gnome &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; Frequency Scaling Monitor Applet&lt;/em&gt;, is that you can select the governor you wish to use using this applet. But first you need to enable user &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; scaling by the following command and answering yes to setting the suid for cpufreq-selector.&lt;/p&gt;
&lt;pre&gt;dpkg-reconfigure gnome-applets&lt;/pre&gt;
&lt;p&gt;Now you can left-click on the applet and choose &lt;em&gt;Performance&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;A thing to note is that this setting reverts to the default &lt;em&gt;On demand&lt;/em&gt; when you reboot your system. I read that you can make it permanent by changing the &lt;em&gt;policy_ac&lt;/em&gt; key to &lt;em&gt;Performance&lt;/em&gt; in &lt;em&gt;apps &amp;#8594; gnome-power-manager &amp;#8594; cpufreq&lt;/em&gt; using &lt;em&gt;gconf-editor&lt;/em&gt;, however this doesn&amp;#8217;t seem to work for me. Maybe because I use the &lt;em&gt;force=acpi&lt;/em&gt; kernel option in &lt;em&gt;/boot/grub/menu.lst&lt;/em&gt; and this somehow overrides the setting. If any one knows of a simple solution, please let me know.&lt;/p&gt;
&lt;p&gt;As you can see from the partial screenshot below, my &lt;span class=&quot;caps&quot;&gt;VIA&lt;/span&gt; EN12000EG based server ran for over 11 days before Ubuntu insisted that I reboot due to an update. In the 11 days I had tried to stress the system several times, for instance transferring files while updating Ubuntu over &lt;span class=&quot;caps&quot;&gt;VNC&lt;/span&gt; and playing internet radio. Which would often freeze the system earlier, but after disabling cpu scaling, I&amp;#8217;ve been unable to freeze the system.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/en12000eg-nofication.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;My conclusion is that the &lt;span class=&quot;caps&quot;&gt;VIA&lt;/span&gt; EN12000EG hardware has buggy &lt;span class=&quot;caps&quot;&gt;CPU&lt;/span&gt; scaling support.&lt;/p&gt;
&lt;p&gt;As a side note, I couldn&amp;#8217;t get s-video output working with any other driver than the binary CN700 Unichrome Pro Driver. Otherwise everything else worked out of the box with both Ubuntu 7.10 and 8.04.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;rararasputin posted his Openchrome xorg.conf with s-video support. Download formatted &lt;a href=&quot;/files/en12000eg_svideo_xorg.conf&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Datel Memory Plus 64 MB</title>
   <link href="http://lukasz.dk/2008/04/22/datel-memory-plus-64-mb/"/>
   <updated>2008-04-22T00:00:00+02:00</updated>
   <id>http://lukasz.dk/2008/04/22/datel-memory-plus-64-mb</id>
   <content type="html">&lt;h1&gt;Datel Memory Plus 64 MB&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;2008-04-22&lt;/p&gt;
&lt;p&gt;Recently I stumbled upon some interesting information regarding Datel&amp;#8217;s new PS2 memory card &lt;em&gt;Memory Plus 64 MB&lt;/em&gt; at &lt;a href=&quot;http://www.ps2savetools.com/article.php?sid=200&amp;amp;mode=thread&amp;amp;order=0&amp;amp;thold=0&quot;&gt;PS2 Save Tools&lt;/a&gt;. What caught my eye were the instructions for this memory card, as they state that you can load an PS2 &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; of the memory card or a &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; Pendrive, without the need to load CD/&lt;span class=&quot;caps&quot;&gt;DVD&lt;/span&gt; software.&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/mplusinstructions.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;p&gt;Since this memory card could be used for launching PS2Link directly of the memory card itself or an &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; Pendrive and thereby enabling PS2 programming on an unmodified PS2 console, I went ahead and bought one from the &lt;a href=&quot;http://www.codejunkies.com/&quot;&gt;Codejunkies&lt;/a&gt; webshop.&lt;/p&gt;
&lt;p&gt;I was unfortunate to get a memory card where built-in software was not installed, but after sending an email to Codejunkies, I returned the card to them and some days later I got it back and this time the built-in software did boot when the memory card was inserted to either PS2 memory card slot.&lt;/p&gt;
&lt;p&gt;The built-in memory card manager takes about 25 seconds load, for the entire period there is a black screen. Below are some screenshots of the memory manager and how it shows up the PS2 memory card browser.&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/mplus1.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/mplus2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/mplus-browser.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;p&gt;I was hoping I could just insert an &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; pendrive to one of the PS2 &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; ports, with PS2Link named RUNME1.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; and it would boot, &lt;del&gt;however none of my 4 &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; pendrives were recognized by the built in memory manager. I tried &lt;span class=&quot;caps&quot;&gt;FAT&lt;/span&gt; 12/16/32 file systems, also FAT32 W95 &lt;span class=&quot;caps&quot;&gt;LBA&lt;/span&gt;, but none of them seemed to work. One of the pendrives I tried was the 16 MB Pendrive from Datel&amp;#8217;s own Max Drive product, which is recognized in the Max Drive memory manager, which looks very similar.&lt;/del&gt;&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/max-memory.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;p&gt;Since the memory manager wasn&amp;#8217;t helping me get PS2Link launched, I had to figure out some other way of getting it onto the memory card and so the &amp;#8220;hacking&amp;#8221; begins.&lt;/p&gt;
&lt;p&gt;For transferring data to the memory card of my chipped PS2 I used ps2netfs.irx from PS2SDK. This &lt;span class=&quot;caps&quot;&gt;IRX&lt;/span&gt; provides an interface to file systems on the PS2 over the network. I used &lt;em&gt;fsclient&lt;/em&gt; as the client (part of &lt;em&gt;ps2client&lt;/em&gt; package), combined with PS2Link/ps2client. Before you can access the memory cards with ps2netfs, you need to load the memory card &lt;span class=&quot;caps&quot;&gt;IOP&lt;/span&gt; modules SIO2MAN and &lt;span class=&quot;caps&quot;&gt;MCMAN&lt;/span&gt; from the &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt;. The following 3 commands below load ps2netfs with memory card support.&lt;/p&gt;
&lt;pre&gt;ps2client -t 1 execiop rom0:SIO2MAN
ps2client -t 1 execiop rom0:MCMAN
ps2client -t 1 execiop host:ps2netfs.irx&lt;/pre&gt;
&lt;p&gt;Once this was done, I could now browse the Memory Plus memory card.&lt;/p&gt;
&lt;pre&gt;fsclient dir mc0:
Contents of mc0:]
drwxrwxrwx          6 04-08-2008 17:01:30 .
drw-rw-rw-          0 04-08-2008 16:53:54 ..
-r-xr-xr-x         14 04-08-2008 16:53:57 BEEXEC-SYSTEM
-r-xr-xr-x         14 04-08-2008 16:55:26 BAEXEC-SYSTEM
drwxrwxrwx          6 04-22-2008 02:29:47 BESLES-00000 MP&lt;/pre&gt;
&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;BEEXEC&lt;/span&gt;-&lt;span class=&quot;caps&quot;&gt;SYSTEM&lt;/span&gt; and &lt;span class=&quot;caps&quot;&gt;BAEXEC&lt;/span&gt;-&lt;span class=&quot;caps&quot;&gt;SYSTEM&lt;/span&gt; directories contain the same files, to support respectively European (E) and American (A) PS2 models.&lt;/p&gt;
&lt;pre&gt;fsclient dir &quot;mc0:BEEXEC-SYSTEM&quot;
[Contents of mc0:BEEXEC-SYSTEM]
drwxrwxrwx          0 04-08-2008 16:53:57 .
drwxrwxrwx          0 04-08-2008 16:53:57 ..
-rwxrwxrwx    1344000 04-08-2008 16:54:00 osd110.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:06 osd120.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:11 osd130.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:17 osd140.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:23 osd150.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:29 osd160.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:35 osd170.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:41 osd180.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:47 osd190.elf
-rwxrwxrwx    1344000 04-08-2008 16:54:54 osdmain.elf
-rwxrwxrwx        964 04-08-2008 16:55:13 icon.sys
-rwxrwxrwx      33688 04-08-2008 16:55:19 mcp.ico&lt;/pre&gt;
&lt;p&gt;These directories are what make booting an &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; of the memory card possible in the first place. Sony included support for updating the &lt;span class=&quot;caps&quot;&gt;OSD&lt;/span&gt; (the software which starts when you power on your PS2 without any game in it) of the PS2 in the PS2 &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt;. The &lt;span class=&quot;caps&quot;&gt;OSD&lt;/span&gt; looks for a osd1xx.elf on the memory, what &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; filename exactly depends on your PS2 model, hence thats why all the osd1xx.elf files are identical.&lt;/p&gt;
&lt;p&gt;The reason this &amp;#8220;exploit&amp;#8221; hasn&amp;#8217;t been discovered earlier is because the &lt;span class=&quot;caps&quot;&gt;OSD&lt;/span&gt; ELF&amp;#8217;s on the memory must be encrypted with &lt;a href=&quot;http://en.wikipedia.org/wiki/MagicGate&quot;&gt;MagicGate&lt;/a&gt; or the &lt;span class=&quot;caps&quot;&gt;OSD&lt;/span&gt; won&amp;#8217;t load the ELF&amp;#8217;s. So it&amp;#8217;s not really an exploit, just a feature protected by encryption. Even though the Memory Plus is a 64 MB memory card, which will be the main the selling point for the memory card, the more interesting part is the fact that Datel have managed to &lt;del&gt;encrypt&lt;/del&gt; inject their own code into already encrypted ELF&amp;#8217;s for this &lt;a href=&quot;http://www.eurasia.nu/modules.php?name=News&amp;amp;file=article&amp;amp;sid=759&quot;&gt;GateCrasher&lt;/a&gt;&amp;quot; based memory card.&lt;/p&gt;
&lt;p&gt;Anyway, returning to the original task of getting PS2Link to boot of the memory card. While listing the contents of the &amp;#8220;&lt;span class=&quot;caps&quot;&gt;BESLES&lt;/span&gt;-00000 MP&amp;#8221;, I realized that this is the directory in which the RUNME1.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; and RUNME2.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; should be put, as it already contained a &lt;span class=&quot;caps&quot;&gt;RUNME&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;.&lt;/p&gt;
&lt;pre&gt;fsclient dir &quot;mc0:BESLES-00000 MP&quot;
[Contents of mc0:BESLES-00000 MP]
drwxrwxrwx          0 04-08-2008 16:56:54 .
drwxrwxrwx          0 04-08-2008 16:56:54 ..
-rwxrwxrwx     763200 04-08-2008 16:56:56 RUNME.ELF
-rwxrwxrwx        964 04-08-2008 16:57:09 icon.sys
-rwxrwxrwx      33688 04-08-2008 16:57:15 mcp.ico&lt;/pre&gt;
&lt;p&gt;First thing I did was make a copy of &lt;span class=&quot;caps&quot;&gt;RUNME&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; (should I accidentally overwrite it) with the following command.&lt;/p&gt;
&lt;pre&gt;fsclient copyfrom &quot;mc0:BESLES-00000 MP/RUNME.ELF&quot; mplus-manager.elf&lt;/pre&gt;
&lt;p&gt;As you might have already guessed from the command above, the &lt;span class=&quot;caps&quot;&gt;RUNME&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; is the built-in memory card manager of the Memory Plus card. I tried to load the mplus-manager.elf (filename of &lt;span class=&quot;caps&quot;&gt;RUNME&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; copy) using PS2Link and it runs just fine.&lt;/p&gt;
&lt;p&gt;This means that the files in the &lt;span class=&quot;caps&quot;&gt;BEEXEC&lt;/span&gt;-&lt;span class=&quot;caps&quot;&gt;SYSTEM&lt;/span&gt; and &lt;span class=&quot;caps&quot;&gt;BAEXEC&lt;/span&gt;-&lt;span class=&quot;caps&quot;&gt;SYSTEM&lt;/span&gt; directories are really just launcher files for the &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; files in the &amp;#8220;&lt;span class=&quot;caps&quot;&gt;BESLES&lt;/span&gt;-00000 MP&amp;#8221; directory. What this also means is that the memory card manager can be replaced by a free one with more features (like support for my pendrives, which work with usb_mass).&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m would be very interested in hearing from any one who might have a  different version of the memory card manager (filesize of mine is 763200 bytes), as another version might have proper &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; pendrive support.&lt;/p&gt;
&lt;p&gt;I copied PS2LINK.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; using the following fsclient command&lt;/p&gt;
&lt;pre&gt;fsclient copyto PS2LINK.ELF &quot;mc0:BESLES-00000 MP/RUNME1.ELF&quot;&lt;/pre&gt;
&lt;p&gt;I rebooted my PS2 with the memory card inserted into the first slot and waited more than 25 seconds and nothing happened. I then tried something a bit simpler than PS2Link, my very own simple &lt;a href=&quot;/files/ttc-demos/round26/torus-lkz.zip&quot;&gt;Torus demo&lt;/a&gt; from &lt;a href=&quot;/playstation-2-programming/the-third-creation/&quot;&gt;The Third Creation&lt;/a&gt; and it booted just fine.&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/mplus-torus.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;p&gt;So the fun of debugging begins. The unknown factors in finding the bug(s) which caused PS2Link not to boot are, how is the &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; loaded by the encrypted launcher on the memory card and how is the method different from how ELF&amp;#8217;s are normally loaded?&lt;/p&gt;
&lt;p&gt;I suspected the issue might be with the arguments passed to PS2Link, as PS2Link uses these to figure out from which device it was booted. So I made a small PS2SDK application which prints the arguments to the screen using &lt;em&gt;scr_printf()&lt;/em&gt;. However it turned out that this simple application did not boot of the memory either. In fact, the first line of code in &lt;em&gt;main&lt;/em&gt; never got executed (changing &lt;span class=&quot;caps&quot;&gt;BGCOLOR&lt;/span&gt;). This could only mean that the issue was within the &lt;em&gt;crt0.s&lt;/em&gt; (&lt;em&gt;C runtime entry point&lt;/em&gt;) code, so I commented all the code related to argument handling, as the launcher code probably passes garbage arguments to the &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; when it loads it and this case is not handled by crt0.s, which causes the PS2 to hang/crash. After doing this, my simple application did boot of the memory card. I made some quick changes to PS2Link to make it support the altered crt0.s and hardcoded the boot path inside the PS2Link source. And PS2Link booted of the Memory Plus card.&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/mplus-ps2link.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;del&gt;A precompiled version of the PS2Link 1.51 &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; which boots of the Memory Plus memory card is avaliable &lt;a href=&quot;/files/PS2LINK_151_MPLUS.ELF&quot;&gt;here&lt;/a&gt;&amp;quot;&lt;/del&gt;&lt;/p&gt;
&lt;p&gt;&lt;del&gt;A real patch should be made for crt0.s, so it would support the arguments passed by the Memory Plus loader without breaking any existing code. This task will require more time than I spent on getting PS2Link running. I will submit a patch for crt0.s once I get the time to develop it, unless some one beats me to it &lt;strong&gt;hint hint&lt;/strong&gt; :) This crt0.s patch is required to make any PS2SDK based applications boot of the memory card.&lt;/del&gt;&lt;/p&gt;
&lt;p&gt;&lt;del&gt;Once crt0.s is patched, making the required changes to PS2Link should be easy, if the Memory Plus card can be uniquely identified based upon the arguments passed to &lt;em&gt;main()&lt;/em&gt;.&lt;/del&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Based upon a comment by PS2onCrack I tried to format my Pendrives yet again to FAT32 and it turns out that one of my 4 pendrives is actually detected by the Memory Plus manager. In order to format it properly under Ubuntu I had to do the following: First find where its mounted with the &lt;em&gt;df&lt;/em&gt; command (my pendrive partition mounts at /dev/sdb1). Then umount the partition.&lt;/p&gt;
&lt;pre&gt;sudo umount /dev/sdb1&lt;/pre&gt;
&lt;p&gt;Then use fdisk, to change system id of the partition to &amp;#8220;W95 FAT32&amp;#8221;&lt;/p&gt;
&lt;pre&gt;sudo fdisk /dev/sdb&lt;/pre&gt;
&lt;p&gt;Note that I use /dev/sdb (the device) and not /dev/sdb1 (the partition). With fdisk I used the &lt;em&gt;t&lt;/em&gt; option (Change system id), then &lt;em&gt;b&lt;/em&gt; for &amp;#8220;W95 FAT32&amp;#8221;, and finally &lt;em&gt;w&lt;/em&gt; to writing the changes. I then formatted the partition to FAT32.&lt;/p&gt;
&lt;pre&gt;sudo mkfs.vfat -F 32 /dev/sdb1&lt;/pre&gt;
&lt;p&gt;Now my Noname 512 MB pendrive works with the Memory Plus manager. The following pendrives did not work: 1 GB Kingston DataTraveler, Datel Max Drive 16 MB and 256 MB MyCom MP3 Player.&lt;/p&gt;
&lt;p&gt;I also realized that patching crt0.s in PS2SDK and making the necessary changes to PS2Link to make it boot of the Memory Plus card is not the best solution, as this will only fix all ELFs compiled against the updated PS2SDK and not all ELFs already available.&lt;/p&gt;
&lt;p&gt;So instead I made a small Memory Plus &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; loader, which boots of the memory card and then tries to load an &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; correctly, which should work with most, if not all ELFs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;/files/MPLUS-LOADER.ELF&quot;&gt;&lt;span class=&quot;caps&quot;&gt;MPLUS&lt;/span&gt;-&lt;span class=&quot;caps&quot;&gt;LOADER&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/files/mplus-loader-src.zip&quot;&gt;mplus-loader-src.zip&lt;/a&gt; (source)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/files/PS2LINK151.ELF&quot;&gt;PS2LINK151.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;&lt;/a&gt;&amp;quot; (PS2Link 1.51 compiled from Subversion)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To make it work, rename &lt;span class=&quot;caps&quot;&gt;MPLUS&lt;/span&gt;-&lt;span class=&quot;caps&quot;&gt;LOADER&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; to either RUNME1.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; or RUNME2.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; and put in on the Memory Plus card, as described in the Memory Plus instructions.&lt;/p&gt;
&lt;p&gt;Then take the &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; you wish to run  (you can test with PS2LINK151.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;) and rename it EXECUTE1.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; (if you want to boot it when the Memory Plus card is inserted into memory card port 1, otherwise EXECUTE2.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; for port 2) and put it either on the Memory Plus card or your &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; pendrive.&lt;/p&gt;
&lt;p&gt;Now boot the Memory Plus card in port 1, this will now load the Memory Plus &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; loader (RUNME1.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;), which will then load the EXECUTE1.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; of either the Memory Plus card or the &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; pendrive. If the &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; does not exist, the Memory Plus manager will be booted.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve updated the Memory Plus Loader, so now more ELFs should boot. Tested with uLaunchELF v4.12 and &lt;span class=&quot;caps&quot;&gt;SMS&lt;/span&gt; 2.8 (Rev. 1). Also I&amp;#8217;ve added a separate Memory Plus Loader &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; which patches the Memory Plus manager to &lt;span class=&quot;caps&quot;&gt;NTSC&lt;/span&gt; mode before starting it. To make it work you just need to add RUNME1.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; (or RUNME2.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;) and not have EXECUTE1.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; (or EXECUTE2.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;) present, then the Memory Plus manager will be booted in &lt;span class=&quot;caps&quot;&gt;NTSC&lt;/span&gt; mode.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;/files/MPLUS-LOADER2.ELF&quot;&gt;&lt;span class=&quot;caps&quot;&gt;MPLUS&lt;/span&gt;-LOADER2.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/files/MPLUS-LOADER2-NTSC.ELF&quot;&gt;&lt;span class=&quot;caps&quot;&gt;MPLUS&lt;/span&gt;-LOADER2-&lt;span class=&quot;caps&quot;&gt;NTSC&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/files/mplus-loader2-src.zip&quot;&gt;mplus-loader2-src.zip&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Update 3:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Memory Plus Loader has been updated to stop the CD/&lt;span class=&quot;caps&quot;&gt;DVD&lt;/span&gt; drive for spinning. It&amp;#8217;s now also possible to initialize the CD/&lt;span class=&quot;caps&quot;&gt;DVD&lt;/span&gt; drive. The solution was found by &lt;a href=&quot;http://www.psx-scene.com/forums/freevast/57899-free-vast-continues-32.html&quot;&gt;ffgriever&lt;/a&gt; for the &lt;a href=&quot;http://www.psx-scene.com/forums/freevast/&quot;&gt;Free McBoot/FreeVast project&lt;/a&gt;. There are some people reporting that this does not work with all consoles, however it works with my &lt;span class=&quot;caps&quot;&gt;PAL&lt;/span&gt; console.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;/files/MPLUS-LOADER3.ELF&quot;&gt;&lt;span class=&quot;caps&quot;&gt;MPLUS&lt;/span&gt;-LOADER3.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/files/MPLUS-LOADER3-NTSC.ELF&quot;&gt;&lt;span class=&quot;caps&quot;&gt;MPLUS&lt;/span&gt;-LOADER3-&lt;span class=&quot;caps&quot;&gt;NTSC&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/files/mplus-loader3-src.zip&quot;&gt;mplus-loader3-src.zip&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Doom - PlayStation 2 Port</title>
   <link href="http://lukasz.dk/2008/02/11/doom-playstation-2-port/"/>
   <updated>2008-02-11T00:00:00+01:00</updated>
   <id>http://lukasz.dk/2008/02/11/doom-playstation-2-port</id>
   <content type="html">&lt;h1&gt;Doom &amp;#8211; PlayStation 2 Port&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;2008-02-11&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update 28/2/09:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://forums.ps2dev.org/profile.php?mode=viewprofile&amp;amp;u=8970&quot;&gt;Cosmito&lt;/a&gt; has been doing a lot of addition work on my quick PS2 port of doom lately, &lt;a href=&quot;http://ps2homebrewing.wordpress.com/2009/02/24/ps2doom-with-proper-sound-at-last/&quot;&gt;recently adding sound support&lt;/a&gt;. To keep updated on the latest PS2Doom changes, check Cosmitos &lt;a href=&quot;http://ps2homebrewing.wordpress.com/&quot;&gt;website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Original post:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Doom_%28video_game%29&quot;&gt;Doom by id Software&lt;/a&gt; appears to available for every platform known to man, except for the PlayStation 2. So I wondered how long it would take to port it over to PS2 and the answer to that question turned out to be less than 3 hours. Using the PS2 port of &lt;span class=&quot;caps&quot;&gt;SDL&lt;/span&gt;, gsKit (&lt;span class=&quot;caps&quot;&gt;SDL&lt;/span&gt; requires it for video) and PS2SDK, all available from &lt;a href=&quot;http://svn.ps2dev.org&quot;&gt;PS2dev.org Subversion repository&lt;/a&gt; and a &lt;span class=&quot;caps&quot;&gt;SDL&lt;/span&gt; port of Doom &lt;a href=&quot;http://www.libsdl.org/projects/doom/&quot;&gt;available here&lt;/a&gt;, I managed to get a very basic (read: hackish) port of Doom running on the PS2 without much effort.&lt;/p&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/ps2doom1.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;shadow&quot;&gt;&lt;img src=&quot;/images/ps2doom2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;
&lt;p&gt;I&amp;#8217;ve only tested the port over PS2Link and it will most likely not run from a CD-R. There is no sound, however there is support for sound in PS2 &lt;span class=&quot;caps&quot;&gt;SDL&lt;/span&gt;, but does not appear to work with Doom and I have not investigated the cause. Saving and loading of games works, as they just save to host/PC. The DualShock controls are as follow (&lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; keyboard and mouse are untested)&lt;/p&gt;
&lt;pre&gt;Left Analog Stick : Move
Cross             : Enter
Square/R1         : CTRL / Fire
Circle/R2         : Space / Open doors
Triangle          : Escape
L1                : x
L2                : y
L1 and L2 are for entering savegame names&lt;/pre&gt;
&lt;p&gt;I will not continue to work on this port, it was just a quick nostalgic proof of concept port.&lt;/p&gt;
&lt;p&gt;Download &lt;a href=&quot;/files/ps2doom-bin.zip&quot;&gt;ps2doom-bin.zip&lt;/a&gt; (includes shareware data)&lt;/p&gt;
&lt;p&gt;Get the source code at &lt;a href=&quot;http://github.com/lukaszdk/ps2doom&quot;&gt;GitHub&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Follow &lt;a href=&quot;http://forums.ps2dev.org/viewtopic.php?t=9798&quot;&gt;this thread&lt;/a&gt; for further work on this port.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A &lt;a href=&quot;http://firehead.org/~jessh/lsdldoom/&quot;&gt;PS2 port&lt;/a&gt;  by &lt;a href=&quot;http://www.jasonyu.net/&quot;&gt;Jason Yu&lt;/a&gt; with sound effect support has &lt;a href=&quot;http://forums.ps2dev.org/viewtopic.php?p=66358#66358&quot;&gt;surfaced&lt;/a&gt;. I&amp;#8217;ve compiled the source into a single &lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; with the &lt;span class=&quot;caps&quot;&gt;DOOM&lt;/span&gt; shareware data included, which should run from CD-&lt;span class=&quot;caps&quot;&gt;ROM&lt;/span&gt;, &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt;, etc (not tested). Included in the archive is also a &lt;a href=&quot;http://ps2dev.org/ps2/Tools/Packers/Unpackers/PS2-Packer_0.4.4&quot;&gt;ps2-packer&lt;/a&gt; compressed version of &lt;span class=&quot;caps&quot;&gt;DOOM&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt; named &lt;span class=&quot;caps&quot;&gt;DOOMP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;ELF&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;/files/lsdldoom-ps2-bin.zip&quot;&gt;lsdldoom-ps2-bin.zip&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Ubuntu 7.10 and Nvidia nForce 630i</title>
   <link href="http://lukasz.dk/2008/02/09/ubuntu-710-and-nvidia-nforce-630i/"/>
   <updated>2008-02-09T00:00:00+01:00</updated>
   <id>http://lukasz.dk/2008/02/09/ubuntu-710-and-nvidia-nforce-630i</id>
   <content type="html">&lt;h1&gt;Ubuntu 7.10 and Nvidia nForce 630i&lt;/h1&gt;
&lt;p class=&quot;meta&quot;&gt;2008-02-09&lt;/p&gt;
&lt;p&gt;I recently upgraded my computer and got a Gigabyte GA-73PVM-S2H motherboard, not knowing that Ubuntu 7.10 did not support the included Nvidia nForce 630i chipset out of the box. I just moved my hard drives with Ubuntu 7.10 already installed from my old computer into my new and it turned out that neither the integrated Nvidia GeForce 7100 (I already had an Nvidia driver installed) nor the sound card was automatically detected.&lt;/p&gt;
&lt;p&gt;To get the GeForce 7100 working I downloaded &lt;a href=&quot;http://albertomilone.com/nvidia_scripts1.html&quot;&gt;Envy&lt;/a&gt; and then manually selected the Nvidia 169.09 driver, which was then downloaded and installed. I used &lt;em&gt;nvidia-settings&lt;/em&gt; to configure the graphics card.&lt;/p&gt;
&lt;p&gt;The sound card (&lt;span class=&quot;caps&quot;&gt;HDA&lt;/span&gt; Intel driver) is not supported by the version of &lt;a href=&quot;http://www.alsa-project.org&quot;&gt;&lt;span class=&quot;caps&quot;&gt;ALSA&lt;/span&gt;&lt;/a&gt; included with Ubuntu 7.10, it is however supported by the latest &lt;span class=&quot;caps&quot;&gt;ALSA&lt;/span&gt; version. So in order to get it working I had to download, compile and install the latest &lt;span class=&quot;caps&quot;&gt;ALSA&lt;/span&gt; driver myself, there is a guide available &lt;a href=&quot;https://help.ubuntu.com/community/HdaIntelSoundHowto&quot;&gt;here&lt;/a&gt; that describes the process.&lt;/p&gt;
&lt;p&gt;The network adapter works out of the box, it uses the &lt;em&gt;forcedeth&lt;/em&gt; driver.&lt;/p&gt;
&lt;p&gt;My new system would freeze on me after a few hours of use, I suspected the Gigabyte GA-73PVM-S2H motherboard was to blame for this. After checking the &lt;a href=&quot;http://tw.giga-byte.com/Support/Motherboard/BIOS_Model.aspx?ProductID=2691&quot;&gt;Gigabyte website&lt;/a&gt; for my motherboard, I saw there was a F5 &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt; update to my F2 version &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt;.  Since I use Ubuntu, I couldn&amp;#8217;t use their @BIOS Windows utility for updating the &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt;, so I had to use the &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt; built-in Q-Flash which supports updating from an &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; stick.&lt;/p&gt;
&lt;p&gt;First I downloaded the &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt; update and used &lt;a href=&quot;http://www.winehq.org&quot;&gt;Wine&lt;/a&gt; to extract the update file from the .&lt;span class=&quot;caps&quot;&gt;EXE&lt;/span&gt; update available. When I then first tried to put the update file on my &lt;span class=&quot;caps&quot;&gt;USB&lt;/span&gt; memory stick and used Q-Flash I got an &lt;em&gt;&lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt; ID checker error&lt;/em&gt;. This error is apparently related to the file system used on the memory stick, since after I formatted my memory stick to &lt;span class=&quot;caps&quot;&gt;FAT&lt;/span&gt;-16 with &lt;em&gt;mkfs.vfat -F 16 /dev/sdc1&lt;/em&gt; (my memory stick shows up at /dev/sdc1, used &lt;em&gt;df&lt;/em&gt; to see where your memory stick is located) I was able to update my &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt; successfully, and I have not experienced any freezes since.&lt;/p&gt;</content>
 </entry>
 

</feed>
