<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-261768414694528663</id><updated>2012-01-30T17:58:30.102Z</updated><category term='arm'/><category term='gPXE'/><category term='extraction'/><category term='Visual Studio'/><category term='SMART'/><category term='UTF8'/><category term='DTS'/><category term='ULTRAEDIT'/><category term='chkconfig'/><category term='OS-X'/><category term='LILO'/><category term='RAID'/><category term='command prompt'/><category term='Daily show'/><category term='globalscale'/><category term='conversion'/><category term='badblocks'/><category term='disk'/><category term='sector reallocation'/><category term='ckk'/><category term='VirtualStore'/><category term='fimrware'/><category term='C2039. Visual C++'/><category term='HDMI'/><category term='test'/><category term='HDMI-CEC'/><category term='WinDDK'/><category term='GPT'/><category term='firmware'/><category term='mdadm'/><category term='512MB'/><category term='SyntaxHighlighter'/><category term='minicom'/><category term='hdparm'/><category term='LED'/><category term='sanboot'/><category term='64 bit'/><category term='CDDA'/><category term='serial'/><category term='xfs'/><category term='All'/><category term='MKV'/><category term='ext3'/><category term='resync'/><category term='fancontrol'/><category term='SSH'/><category term='XSLT'/><category term='XSL'/><category term='mysql'/><category term='brushes'/><category term='IPL'/><category term='synchronization'/><category term='formatting'/><category term='title'/><category term='putty'/><category term='iSCSI'/><category term='crosstool-ng'/><category term='libusb'/><category term='chroot'/><category term='ntp'/><category term='ASUS P5B Deluxe'/><category term='OSX'/><category term='alpha channel'/><category term='SheevPlug'/><category term='USB'/><category term='IDA Pro'/><category term='Drupal'/><category term='ACCESS DENIED'/><category term='ext2'/><category term='International Domain Name'/><category term='Unicode'/><category term='Firefox'/><category term='initrd'/><category term='Slackware'/><category term='partition'/><category term='nVIDIA'/><category term='Memory Stick'/><category term='corruption'/><category term='character'/><category term='JTAG'/><category term='Mediatek'/><category term='Visual C++'/><category term='disassembly'/><category term='nVidia MediaShield'/><category term='raid services'/><category term='.NET'/><category term='interval'/><category term='Nero'/><category term='PCM'/><category term='RAID5'/><category term='grub'/><category term='MediaShield'/><category term='Cairo'/><category term='VISTA'/><category term='TFTP'/><category term='Pandora'/><category term='Task Manager'/><category term='plug computer'/><category term='PSP'/><category term='cross-compiling'/><category term='ICH8R'/><category term='reverse engineering'/><category term='dmraid'/><category term='LCD'/><category term='UUID'/><category term='cdrecord'/><category term='CUE Sheet'/><category term='leading zeroes'/><category term='mmc'/><category term='WRT54G'/><category term='spoofing'/><category term='iBFT'/><category term='openWRT'/><category term='console'/><category term='duplicate'/><category term='openocd'/><category term='mmc driver'/><category term='8051'/><category term='switch statement'/><category term='Macro'/><category term='windows'/><category term='x86_64'/><category term='WAV'/><category term='Sheevaplug'/><category term='code'/><category term='P5B'/><category term='Windows 7'/><category term='recovery'/><category term='Backwards Security'/><category term='MT8226'/><category term='unsigned drivers'/><category term='boot'/><category term='MTV'/><category term='8032'/><category term='photoshop'/><category term='sftp'/><category term='DDK'/><category term='MacOS'/><category term='streaming'/><category term='target'/><category term='Shortcuts'/><category term='chart'/><category term='Snow Leopard'/><category term='Vista 64'/><category term='md'/><category term='armedslack'/><category term='multiple banks'/><category term='SD card'/><category term='blogger'/><category term='switching'/><category term='sql'/><category term='sensors.conf'/><category term='Linux'/><category term='nodes'/><category term='libfti'/><category term='kernel'/><category term='swap'/><category term='log'/><category term='search'/><category term='IE'/><category term='Samsung'/><category term='marvell'/><title type='text'>&gt;NIL:'s Techno Feats</title><subtitle type='html'>Eat my feats!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>79</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7966465570183872585</id><published>2012-01-10T13:54:00.000Z</published><updated>2012-01-18T16:23:08.985Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='synchronization'/><category scheme='http://www.blogger.com/atom/ns#' term='mdadm'/><category scheme='http://www.blogger.com/atom/ns#' term='disk'/><category scheme='http://www.blogger.com/atom/ns#' term='RAID'/><category scheme='http://www.blogger.com/atom/ns#' term='hdparm'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='md'/><category scheme='http://www.blogger.com/atom/ns#' term='sector reallocation'/><title type='text'>Help, my RAID array does not complete synchronization!</title><content type='html'>Let us suppose the following situation: You have a Linux server with a software RAID1 array (&lt;code&gt;md&lt;/code&gt;) and, for one reason or another (mostly because your are a lazy admin, admit it!), &lt;b&gt;both&lt;/b&gt; disks are reporting unreadable sectors, either through SMART or through actual failed readout attempts.&lt;br /&gt;&lt;br /&gt;So you installed a 3rd good disk, set it as a spare, then failed one of the 2 bad ones to initiate synchronisation onto the good new disk. However, all hell breaks lose as you find out your synchronisation doesn't complete (&lt;code&gt;/proc/mdstat&lt;/code&gt; reports &lt;code&gt;U_&lt;/code&gt; or &lt;code&gt;_U&lt;/code&gt;) and instead of ignoring the unreadable sectors as it should, &lt;code&gt;md&lt;/code&gt; decides that it cannot continue.&lt;br /&gt;&lt;br /&gt;Worse, if you look at your &lt;code&gt;dmesg&lt;/code&gt;, you find out that it is being polluted by a continuous stream of:&lt;pre class="brush:text"&gt;RAID1 conf printout:&lt;br /&gt;--- wd:1 rd:2&lt;br /&gt;disk 0, wo:0, o:1, dev:sda1&lt;br /&gt;disk 1, wo:1, o:1, dev:sdb1&lt;/pre&gt;Help!!!!&lt;br /&gt;&lt;br /&gt;OK, first of all, since this information is quite hard to find, especially if you are in a hurry, here are what the abbreviations above mean:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;wd&lt;/code&gt;: working disks&lt;/li&gt;&lt;li&gt;&lt;code&gt;rd&lt;/code&gt;: raid disks&lt;/li&gt;&lt;li&gt;&lt;code&gt;wo&lt;/code&gt;: write-only (if set to 1, this usually indicates a problem, and that data duplication doe not occur for this device)&lt;/li&gt;&lt;li&gt;&lt;code&gt;o&lt;/code&gt;: online&lt;/li&gt;&lt;/ul&gt;Obviously, &lt;code&gt;wd:1&lt;/code&gt; as well as &lt;code&gt;wo:1&lt;/code&gt; for the second disk is not something we want to see. Why can't our good spare disk be added as R/W to the gorram array? Heck, if the problematic disk fails, that single-handedly contains our up-to-date data now, we will be in big trouble. What's the point of providing redundancy, really, if &lt;code&gt;md&lt;/code&gt; fails to synchronize as soon as there's one measly sector it cannot read!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;It's a bird! It's a plane! No, it's &lt;code&gt;hdparm&lt;/code&gt;!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Well, the sad truth of &lt;code&gt;md&lt;/code&gt; on Linux (which may have improved with newer versions) is that it isn't resilient at all when it comes to unreadable sectors during sync. I guess the developers decided that, since the point of redundancy is to always have at least one good set of data, they didn't need to focus on situation where the "good" set of data may also have some corruption, and therefore never planned for anything but try and re-read an unreadable sector forever, until the disk magically repairs itself (right... fat chance!).&lt;br /&gt;&lt;br /&gt;Now (and for the rest of this post I will mostly be following the excellent information provided by Bas on &lt;a href="http://www.sjvs.nl/?p=12"&gt;his blog&lt;/a&gt;) to compensate for that oversight, the trick is to have &lt;code&gt;md&lt;/code&gt; read the problematic sectors one way or another, so that the synchronisation can complete. May sound easier said than done but most of the time it shouldn't be an issue, as recent disks with SMART are engineered with a set of spare sectors, to be allocated in replacement of unreadable or unwritable ones for exactly this kind of situation. The issue however is that reallocation of sectors only occurs on write access.&lt;br /&gt;&lt;br /&gt;What this means then is that, while the disk has the technology to "fix" itself, as long as you are only attempting to read the problematic sectors, reallocation will not be triggered and you will continue to get read errors. Thus, you must manually issue a write to the problematic sector(s) to trigger the "recovery" mechanism (NB: I'm using "fix" and "recovery" loosely, as you can of course not recover data from these sectors if they are reallocated, therefore will end up with some corrupted data).&lt;br /&gt;&lt;br /&gt;This can be confirmed by checking the &lt;code&gt;Offline_Uncorrectable&lt;/code&gt; (#198) and &lt;code&gt;Reallocated_Sector_Ct&lt;/code&gt; (#5) reports from SMART:&lt;br /&gt;&lt;pre class="brush:text"&gt;# smartctl -A /dev/sda&lt;br /&gt;smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen&lt;br /&gt;Home page is http://smartmontools.sourceforge.net/&lt;br /&gt;&lt;br /&gt;=== START OF READ SMART DATA SECTION ===&lt;br /&gt;SMART Attributes Data Structure revision number: 16&lt;br /&gt;Vendor Specific SMART Attributes with Thresholds:&lt;br /&gt;ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE&lt;br /&gt;  1 Raw_Read_Error_Rate     0x002f   100   100   051    Pre-fail  Always       -       105&lt;br /&gt;  2 Throughput_Performance  0x0026   054   054   000    Old_age   Always       -       2759&lt;br /&gt;  3 Spin_Up_Time            0x0023   084   084   025    Pre-fail  Always       -       4989&lt;br /&gt;  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       10&lt;br /&gt;  5 Reallocated_Sector_Ct   0x0033   252   252   010    Pre-fail  Always       -       0&lt;br /&gt;  7 Seek_Error_Rate         0x002e   252   252   051    Old_age   Always       -       0&lt;br /&gt;  8 Seek_Time_Performance   0x0024   252   252   015    Old_age   Offline      -       0&lt;br /&gt;  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       11496&lt;br /&gt; 10 Spin_Retry_Count        0x0032   252   252   051    Old_age   Always       -       0&lt;br /&gt; 11 Calibration_Retry_Count 0x0032   252   252   000    Old_age   Always       -       0&lt;br /&gt; 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       10&lt;br /&gt;191 G-Sense_Error_Rate      0x0022   252   252   000    Old_age   Always       -       0&lt;br /&gt;192 Power-Off_Retract_Count 0x0022   252   252   000    Old_age   Always       -       0&lt;br /&gt;194 Temperature_Celsius     0x0002   064   060   000    Old_age   Always       -       32 (Lifetime Min/Max 20/40)&lt;br /&gt;195 Hardware_ECC_Recovered  0x003a   100   100   000    Old_age   Always       -       0&lt;br /&gt;196 Reallocated_Event_Count 0x0032   252   252   000    Old_age   Always       -       0&lt;br /&gt;197 Current_Pending_Sector  0x0032   252   100   000    Old_age   Always       -       0&lt;br /&gt;198 Offline_Uncorrectable   0x0030   252   100   000    Old_age   Offline      -       0&lt;br /&gt;199 UDMA_CRC_Error_Count    0x0036   200   200   000    Old_age   Always       -       0&lt;br /&gt;200 Multi_Zone_Error_Rate   0x002a   100   100   000    Old_age   Always       -       2&lt;br /&gt;223 Load_Retry_Count        0x0032   252   252   000    Old_age   Always       -       0&lt;br /&gt;225 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       10&lt;/pre&gt;If you see a zero at the end of these attributes but the disk still reports that it has trouble reading sectors, it indicates that the sector reallocation process hasn't kicked in yet, and needs to be triggered manually.&lt;br /&gt;&lt;br /&gt;The first order of the day then is to find the address of the sector(s) we should trigger a write to. This is fairly easy, as all you need to do is run a SMART test, with something like &lt;code&gt;smartctl -t long /dev/sda&lt;/code&gt; and write down the first sector address where a read error is reported:&lt;pre class="brush:text"&gt;# smartctl -a /dev/sda&lt;br /&gt;(...)&lt;br /&gt;SMART Self-test log structure revision number 1&lt;br /&gt;Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error&lt;br /&gt;# 1  Extended offline    Completed: read failure       60%     10864         293039329&lt;br /&gt;(...)&lt;/pre&gt;Once we have that address, we could of course use &lt;code&gt;dd&lt;/code&gt;, but an even simpler approach is to use a recent version of &lt;code&gt;hdparm&lt;/code&gt;, as it adds easy support for reading/writing a single sector.&lt;br /&gt;&lt;br /&gt;First thing to try with &lt;code&gt;hdparm&lt;/code&gt; then, is confirm that we have a problem accessing that sector:&lt;pre class="brush:text"&gt;# hdparm --read-sector 293039329 /dev/sda&lt;br /&gt;&lt;br /&gt;/dev/sda: Input/Output error&lt;/pre&gt;This confirms what the SMART test reported. You can try a few more read attempts, to validate that the sector is busted, and then, you can issue a write so that the disk finally realizes it should reallocate that sector. Note that, because the operation obviously means destroying existing data, &lt;code&gt;hdparm&lt;/code&gt; requires you to add a &lt;code&gt;--yes-i-know-what-i-am-doing&lt;/code&gt; flag to issue the write, hence:&lt;pre class="brush:text"&gt;# hdparm --yes-i-know-what-i-am-doing --write-sector 293039329 /dev/sda&lt;br /&gt;&lt;br /&gt;/dev/sda: re-writing sector 293039329: succeeded&lt;br /&gt;&lt;/pre&gt;You can then issue a read again, which will confirm that the sector has been reallocated:&lt;pre class="brush:text"&gt;# hdparm --read-sector 293039329 /dev/sda&lt;br /&gt;&lt;br /&gt;/dev/sda:&lt;br /&gt;reading sector 293039329: succeeded&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000&lt;/pre&gt;If you issue &lt;code&gt;smartctl -A&lt;/code&gt; again, you should also see that the sector has been reallocated:&lt;pre class="brush:text"&gt;198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -        1&lt;/pre&gt;It's usually a good idea to use &lt;code&gt;hdparm&lt;/code&gt; to read adjacent sectors as well, and correct them as needed, then repeat the operations above until the SMART self test completes without error and you have smoked out all the problematic sectors. At this stage, if you issue a resync of the array with the new disk, it should complete successfully and redundancy will be restored. Time to order another replacement and check your data for corruption. But at least, you are redundant again.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Addons&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;To get details of your md array, you can use &lt;code&gt;mdadm --detail&lt;/code&gt;. Eg.&lt;pre class="brush:text"&gt;# mdadm --detail /dev/md2&lt;br /&gt;/dev/md2:&lt;br /&gt;        Version : 0.90&lt;br /&gt;  Creation Time : Tue May  6 18:43:16 2008&lt;br /&gt;     Raid Level : raid1&lt;br /&gt;     Array Size : 130030016 (124.01 GiB 133.15 GB)&lt;br /&gt;  Used Dev Size : 130030016 (124.01 GiB 133.15 GB)&lt;br /&gt;   Raid Devices : 2&lt;br /&gt;  Total Devices : 3&lt;br /&gt;Preferred Minor : 2&lt;br /&gt;    Persistence : Superblock is persistent&lt;br /&gt;&lt;br /&gt;    Update Time : Tue Jan 10 13:42:29 2012&lt;br /&gt;          State : clean&lt;br /&gt; Active Devices : 2&lt;br /&gt;Working Devices : 3&lt;br /&gt; Failed Devices : 0&lt;br /&gt;  Spare Devices : 1&lt;br /&gt;&lt;br /&gt;           UUID : 0be47c81:ede086ae:0c460403:d81de298&lt;br /&gt;         Events : 0.3658859&lt;br /&gt;&lt;br /&gt;    Number   Major   Minor   RaidDevice State&lt;br /&gt;       0       8        3        0      active sync   /dev/sda3&lt;br /&gt;       1       8       19        1      active sync   /dev/sdb3&lt;br /&gt;&lt;br /&gt;       2       8       35        -      spare   /dev/sdc3&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;You are strongly encouraged to check your &lt;code&gt;syslog&lt;/code&gt; or &lt;code&gt;messages&lt;/code&gt; for reports of I/O issues, especially if you want to locate the data that may have been affected.&lt;/li&gt;&lt;li&gt;This method is not guaranteed to work! Sometimes a SMART test will report a read error but a readout of the sector using &lt;code&gt;hdparam&lt;/code&gt; will work fine, so you won't be able to get the disk to reallocate it. However, tis shouldn't matter too much for &lt;code&gt;md&lt;/code&gt; resync which is what we are interested in here.&lt;/li&gt;&lt;li&gt;If your disk has a lot of unreadable sectors, it is possible that you may run out of spare sectors for reallocation. It's hard to say how many spare sectors are made available by hard drive manufacturers, but I assume it isn't that many.&lt;/li&gt;&lt;li&gt;You may have a problem recompiling a recent version of &lt;code&gt;hdparm&lt;/code&gt; on some older Linux systems:&lt;pre class="brush:text"&gt;fallocate.c: In function ‘do_fallocate_syscall’:&lt;br /&gt;fallocate.c:39: error: ‘__NR_fallocate’ undeclared (first use in this function)&lt;br /&gt;fallocate.c:39: error: (Each undeclared identifier is reported only once&lt;br /&gt;fallocate.c:39: error: for each function it appears in.)&lt;br /&gt;make: *** [fallocate.o] Error 1&lt;/pre&gt;If that is the case, just add:&lt;pre class="brush:c"&gt;#define __NR_fallocate 285&lt;/pre&gt;in &lt;code&gt;fallocate.c&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Some disks seem to be smart enough (no pun intended) to do further correction, once they have registered &lt;code&gt;Offline_Uncorrectable&lt;/code&gt; sectors, so you may actually find out that, after a few hours, the value of &lt;code&gt;Offline_Uncorrectable&lt;/code&gt; falls back to zero, and still the sectors can be read or written with extended SMART tests not reporting any issue. Pretty neat, but I still wouldn't entirely trust the disk...&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7966465570183872585?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7966465570183872585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2012/01/help-my-raid-array-does-not-complete.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7966465570183872585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7966465570183872585'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2012/01/help-my-raid-array-does-not-complete.html' title='Help, my RAID array does not complete synchronization!'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-895581580683894756</id><published>2012-01-04T12:07:00.002Z</published><updated>2012-01-05T00:35:20.913Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='initrd'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='Slackware'/><category scheme='http://www.blogger.com/atom/ns#' term='LILO'/><category scheme='http://www.blogger.com/atom/ns#' term='UUID'/><title type='text'>Using LILO to boot disks by UUID</title><content type='html'>If you're plugging USB drives in an out and using LILO to boot a Linux distro (eg. Slackware) you may have ended up with a kernel panic because your &lt;code&gt;/dev/sd#&lt;/code&gt; were shuffled around and the kernel was no longer able to find its root partition on the expected device. Of course, having Linux failing to boot just because you happened to plug an extra drive sucks big time, so we want to fix that.&lt;br /&gt;&lt;br /&gt;The well known solution of course it to use UUIDs or labels, since these are fixed. However, while recent versions of LILO are supposed to support root partitions that are identified by UUID/Label, in practice, this doesn't work UNLESS you are using an initrd disk. I'm not sure who of LILO or the kernel is responsible for this new layer of "suck" (I'd assume the kernel, since the expectation is that LILO is using the dev mappings that are being fed by the kernel), but I can only say that there really are some areas of Linux that could still benefit from long awaited improvements...&lt;br /&gt;&lt;br /&gt;Thus, to be able to use UUIDs or labels for your root partition in LILO, you must boot using an initrd. Worse, &lt;a href="http://nil-techno.blogspot.com/2009/10/lilo-warning-initial-ram-disk-is-too.html"&gt;as previously documented&lt;/a&gt;, you will most likely need to compile a new kernel that embeds the initrd, lest you want to run into the following issue while running LILO: &lt;br /&gt;&lt;pre class="brush:text"&gt;Warning: The initial RAM disk is too big to fit between&lt;br /&gt;the kernel and the 15M-16M memory hole.&lt;/pre&gt;&lt;br /&gt;In practice (as also illustrated by &lt;a href="http://www.linuxquestions.org/questions/slackware-14/how-do-i-specify-root-disk-in-lilo-813945/#post4004446"&gt;this post&lt;/a&gt;), this means you will need to:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create an initrd cpio image that can be embedded into a kernel with:&lt;br /&gt;&lt;pre class="brush: text"&gt;cd /boot&lt;br /&gt;mkinitrd -c&lt;br /&gt;cd initrd-tree&lt;br /&gt;find . | cpio -H newc -o &amp;gt; ../initrd.cpio&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Recompile a kernel, while making sure that you have the &lt;code&gt;General Setup → Initial RAM filesystem and RAM disk (initramfd/initrd) support&lt;/code&gt; selected, and then set &lt;code&gt;General Setup → Initramfs source file(s)&lt;/code&gt; to &lt;code&gt;/boot/initrd.cpio&lt;/code&gt;.&amp;nbsp;&lt;br/&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Edit your &lt;code&gt;/etc/lilo.conf&lt;/code&gt; and add an &lt;code&gt; append = "root=UUID=&amp;lt;YOUR-DISK-GUID&amp;gt;"&lt;/code&gt; to your Linux boot entry. An example of a working &lt;code&gt;lilo.conf&lt;/code&gt; is provided below. Note that you probably also want to use a fixed IDs for &lt;code&gt;boot=&lt;/code&gt;, so that running LILO is also not dependent on the current /dev/sd# organization..&amp;nbsp;&lt;br/&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Run LILO, plug drives around and watch in amazement as your system still boots the Linux partition regardless of how the drives are assigned&lt;/li&gt;&lt;/ol&gt;Example &lt;code&gt;lilo.conf&lt;/code&gt;:&lt;br /&gt;&lt;pre class="brush: text"&gt;# Start LILO global section&lt;br /&gt;boot = /dev/disk/by-id/ata-ST3320620AS_ABCD1234&lt;br /&gt;compact&lt;br /&gt;lba32&lt;br /&gt;# LILO doesn't like same volume IDs of RAID 1&lt;br /&gt;disk = /dev/sdb inaccessible&lt;br /&gt;default = Windows&lt;br /&gt;bitmap = /boot/slack.bmp&lt;br /&gt;bmp-colors = 255,0,255,0,255,0&lt;br /&gt;bmp-table = 60,6,1,16&lt;br /&gt;bmp-timer = 65,27,0,255&lt;br /&gt;# Append any additional kernel parameters:&lt;br /&gt;append=" vt.default_utf8=1"&lt;br /&gt;prompt&lt;br /&gt;timeout = 35&lt;br /&gt;# End LILO global section&lt;br /&gt;&lt;br /&gt;image = /boot/vmlinuz&lt;br /&gt;  append = "root=UUID=2cc11aaf-f838-4474-9d9a-f3881569f97c"&lt;br /&gt;  label = Linux&lt;br /&gt;  read-only&lt;br /&gt;image = /boot/vmlinuz.rescue&lt;br /&gt;  append = "root=UUID=2cc11aaf-f838-4474-9d9a-f3881569f97c"&lt;br /&gt;  label = Rescue&lt;br /&gt;  read-only&lt;br /&gt;other = /dev/sda&lt;br /&gt;  # Windows doesn't go to S3 sleep and has issues with backup,&lt;br /&gt;  # unless it sees its disk as first in BIOS...&lt;br /&gt;  boot-as = 0x80&lt;br /&gt;  label = Windows&lt;br /&gt;other = /dev/disk/by-id/ata-ST3320620AS_ABCD1234-part4&lt;br /&gt;  label = OSX&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-895581580683894756?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/895581580683894756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2012/01/using-lilo-to-boot-disks-by-uuid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/895581580683894756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/895581580683894756'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2012/01/using-lilo-to-boot-disks-by-uuid.html' title='Using LILO to boot disks by UUID'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5625638088567607624</id><published>2011-08-31T12:35:00.013+01:00</published><updated>2011-08-31T13:11:12.134+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='serial'/><category scheme='http://www.blogger.com/atom/ns#' term='Slackware'/><category scheme='http://www.blogger.com/atom/ns#' term='console'/><title type='text'>Enabling serial console on Linux Slackware</title><content type='html'>I'm doing this frequently enough to warrant a post.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Make sure you use a kernel with console enabled&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Confirm that your serial tty's are detected with &lt;code&gt;dmesg | grep tty&lt;/code&gt;:&lt;pre class="brush:text"&gt;[    0.000000] console [tty0] enabled&lt;br/&gt;[    1.323949] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A&lt;br/&gt;[    1.568561] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A&lt;br/&gt;[    1.592267] 00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A&lt;br/&gt;[    1.614293] 00:10: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Edit &lt;code&gt;/etc/securetty&lt;/code&gt; and uncomment the lines matching the &lt;code&gt;ttyS&lt;/code&gt; you got from &lt;code&gt;dmesg&lt;/code&gt;. Else you won't be able to logon as root.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Edit your &lt;code&gt;/etc/inittab&lt;/code&gt; and uncomment the lines:&lt;pre class="brush:text"&gt;s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100&lt;br/&gt;s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100&lt;/pre&gt;While you're at it, you probably want to change the &lt;code&gt;9600 vt100&lt;/code&gt; to &lt;code&gt;115200 linux&lt;/code&gt;, if you use putty in serial mode to connect for instance.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you want the boot messages on serial as well (recommended!), make sure you append a &lt;code&gt;console=&lt;/code&gt; line to your kernel. For instance, if using LILO and for 115200 bauds, you would add a line:&lt;pre class="brush:text"&gt;append = "console=ttyS0,115200"&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5625638088567607624?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5625638088567607624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2011/08/enabling-serial-console-on-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5625638088567607624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5625638088567607624'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2011/08/enabling-serial-console-on-linux.html' title='Enabling serial console on Linux Slackware'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-3800262186751719326</id><published>2011-08-03T13:09:00.002+01:00</published><updated>2011-08-03T13:24:06.423+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='conversion'/><category scheme='http://www.blogger.com/atom/ns#' term='DTS'/><category scheme='http://www.blogger.com/atom/ns#' term='MKV'/><category scheme='http://www.blogger.com/atom/ns#' term='WAV'/><category scheme='http://www.blogger.com/atom/ns#' term='extraction'/><category scheme='http://www.blogger.com/atom/ns#' term='PCM'/><title type='text'>Extracting a single DTS/AC3 channel from an MKV file as a PCM WAV</title><content type='html'>Well, since audio and video software editors are still not there yet, a quick recepy.&lt;br /&gt;&lt;br /&gt;Say you have a H264/DTS MKV video file and you want to extract the center channel, as WAV, for easy editing.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download &lt;a href="http://www.videohelp.com/tools/tsMuxeR"&gt;tsMuxeR&lt;/a&gt; and extract the audio stream as a .dts (eg. "multichannel.dts"), using the GUI&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Download &lt;a href="http://www.videohelp.com/tools/eac3to"&gt;eac3to&lt;/a&gt; and run the following command to convert to a multichannel PCM WAV: &lt;code&gt;eac3to.exe multichannel.dts multichannel.wav&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Download &lt;a href="http://www.wavosaur.com/"&gt;wavosaur&lt;/a&gt; and open the multichannel WAV. Then kill the channels you don't need, edit the file, etc.&lt;/li&gt;&lt;/ol&gt;None of the programs above use an installer - they can be extracted and run directly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-3800262186751719326?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/3800262186751719326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2011/08/extracting-single-dtsac3-channel-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3800262186751719326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3800262186751719326'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2011/08/extracting-single-dtsac3-channel-from.html' title='Extracting a single DTS/AC3 channel from an MKV file as a PCM WAV'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7201420726743363582</id><published>2011-06-30T17:04:00.002+01:00</published><updated>2011-06-30T17:07:06.169+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Slackware'/><category scheme='http://www.blogger.com/atom/ns#' term='minicom'/><title type='text'>Slackware 13.37 and minicom</title><content type='html'>Doesn't work by default. Wanna know why? /etc/minirc.dfl is missing a Line Feed. Yes, really, all you need to do is add an extra blank like there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7201420726743363582?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7201420726743363582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2011/06/slackware-1337-and-minicom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7201420726743363582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7201420726743363582'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2011/06/slackware-1337-and-minicom.html' title='Slackware 13.37 and minicom'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-3326419350346509630</id><published>2011-05-25T16:34:00.012+01:00</published><updated>2011-05-26T01:47:28.548+01:00</updated><title type='text'>Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 5</title><content type='html'>Focusing on Linux + LILO setup, to (hopefully) conclude this series.&lt;br /&gt;&lt;br /&gt;At this stage, you are supposed to have a standalone GPT/GUID disk, with a bootable OSX (Chameleon, Chimera), as well as free space for a Linux installation.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;More disk partitioning&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;First order of the day is to pick up the latest Slackware distro (13.37 at the time of this post) and fire it up. Earlier versions of Slackware cannot handle GPT disks, and I don't believe they include gdisk either, so make sure you pick the very latest.&lt;br /&gt;&lt;br /&gt;Now, since we seeded the partitioning from OSX and left some free space, when firing up gdisk (using sdc here as sda+sdb are used by Windows 7 in ICH8R RAID1) you'll be greeted with the following:&lt;pre class="brush:text"&gt;# gdisk /dev/sdc&lt;br /&gt;GPT fdisk (gdisk) version 0.6.14&lt;br /&gt;&lt;br /&gt;Partition table scan:&lt;br /&gt;  MBR: protective&lt;br /&gt;  BSD: not present&lt;br /&gt;  APM: not present&lt;br /&gt;  GPT: present&lt;br /&gt;&lt;br /&gt;Found valid GPT with protective MBR; using GPT.&lt;br /&gt;&lt;br /&gt;Command (? for help): p&lt;br /&gt;Disk /dev/sdc: 234441648 sectors, 111.8 GiB&lt;br /&gt;Logical sector size: 512 bytes&lt;br /&gt;Disk identifier (GUID): 592CD063-7F0A-4F52-81EC-A58C5D3F859C&lt;br /&gt;Partition table holds up to 128 entries&lt;br /&gt;First usable sector is 34, last usable sector is 234441614&lt;br /&gt;Partitions will be aligned on 8-sector boundaries&lt;br /&gt;Total free space is 175418693 sectors (83.6 GiB)&lt;br /&gt;&lt;br /&gt;Number  Start (sector)    End (sector)  Size       Code  Name&lt;br /&gt;   1              40          409639   200.0 MiB   EF00  EFI System Partition&lt;br /&gt;   2          409640        59022927   27.9 GiB    AF00  Snow Leopard&lt;br /&gt;&lt;br /&gt;Command (? for help): n&lt;br /&gt;Partition number (3-128, default 3): &lt;br /&gt;First sector (34-234441614, default = 59022928) or {+-}size{KMGTP}: &lt;br /&gt;Last sector (59022928-234441614, default = 59022928) or {+-}size{KMGTP}: +30G&lt;br /&gt;Current type is 'Linux/Windows data'&lt;br /&gt;Hex code or GUID (L to show codes, Enter = 0700):&lt;br /&gt;Changed type of partition to 'Linux/Windows data'&lt;br /&gt;&lt;br /&gt;Command (? for help): p&lt;br /&gt;Disk /dev/sdc: 234441648 sectors, 111.8 GiB&lt;br /&gt;Logical sector size: 512 bytes&lt;br /&gt;Disk identifier (GUID): 592CD063-7F0A-4F52-81EC-A58C5D3F859C&lt;br /&gt;Partition table holds up to 128 entries&lt;br /&gt;First usable sector is 34, last usable sector is 234441614&lt;br /&gt;Partitions will be aligned on 8-sector boundaries&lt;br /&gt;Total free space is 112504133 sectors (53.6 GiB)&lt;br /&gt;&lt;br /&gt;Number  Start (sector)    End (sector)  Size       Code  Name&lt;br /&gt;   1              40          409639   200.0 MiB   EF00  EFI System Partition&lt;br /&gt;   2          409640        59022927   27.9 GiB    AF00  Snow Leopard&lt;br /&gt;   3        59022928       121937487   30.0 GiB    0700  Linux/Windows data&lt;br /&gt;&lt;br /&gt;Command (? for help): w&lt;br /&gt;&lt;br /&gt;Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!&lt;br /&gt;&lt;br /&gt;Do you want to proceed, possibly destroying your data? (Y/N): y&lt;br /&gt;OK; writing new GUID partition table (GPT).&lt;br /&gt;The operation has completed successfully.&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Note 1: You'll notice that there's a 200 MB &lt;a href="http://en.wikipedia.org/wiki/EFI_System_partition"&gt;EFI System Partition&lt;/a&gt;. If you want OSX to be happy, even if the OSX bootloader shouldn't need it, better leave it alone.&lt;/li&gt; &lt;br /&gt;&lt;li&gt;Note 2: You'll have noticed that when firing gdisk, it mentioned something about a "protective MBR". This is because GPT and MBR can coexist on the same disk, and therefore an MBR-only aware utility could potentially destroy data. We'll put the MBR+GPT coexistence to good use later on in this post.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Note 3: If you leave OSX's disk utility create the partition for the Linux system and try to change the type in gdisk, the installer might not see your Linux system partition as a valid target. If that occurs, you should delete the non OSX/EFI System partitions in gdisk (d command), and recreate them.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Slackware and LILO setup&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The Slackware install is as straightforward as usual, so I'm not going to comment on it. At the end, just install LILO on the MBR of your standalone OSX/Slackware disk (here &lt;code&gt;/dev/sdc&lt;/code&gt;) as you'd normally do. Reboot, and you oughta be able to access your newly installed Linux system.&lt;br /&gt;&lt;br /&gt;So how about we add OSX boot to our &lt;code&gt;etc/lilo.conf&lt;/code&gt; and be done with this whole exercise then? The OSX bootloader (Chameleon, etc.) should be able to take the relay after LILO handoff. And while we're at it, we'll also add Windows boot from &lt;code&gt;/dev/sda&lt;/code&gt;.&lt;br /&gt;Off we go then and add the following at the end of &lt;code&gt;/etc/lilo.conf&lt;/code&gt;:&lt;pre class="brush:text"&gt;other = /dev/sda&lt;br /&gt;  label = Windows&lt;br /&gt;other = /dev/sdc2&lt;br /&gt;  label = OSX&lt;/pre&gt;And now the fun begins...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;LILO troubles&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush:text"&gt;# lilo&lt;br /&gt;&lt;br /&gt;Reference:  disk "/dev/sdb"  (8,16)  0810&lt;br /&gt;&lt;br /&gt;LILO wants to assign a new Volume ID to this disk drive.  However, changing&lt;br /&gt;the Volume ID of a Windows NT, 2000, or XP boot disk is a fatal Windows error.&lt;br /&gt;This caution does not apply to Windows 95 or 98, or to NT data disks.&lt;br /&gt;&lt;br /&gt;Is the above disk an NT boot disk? [Y/n]&lt;/pre&gt;Hell to the no! What on earth is going on here? Well, a little &lt;a href="http://forum.soft32.com/linux2/Problems-lilo-dualboot-PC-SATA-drives-ftopict50617.html"&gt;googling around&lt;/a&gt; tells you that LILO is unhappy because our mirrored disks (&lt;code&gt;/dev/sda&lt;/code&gt; and &lt;code&gt;/dev/sdb&lt;/code&gt;) bear the same volume ID. Two solutions there:&lt;ul&gt;&lt;li&gt;Solution 1: add a section:&lt;pre class="brush:text"&gt;disk = /dev/sdb&lt;br /&gt;  inaccessible&lt;/pre&gt;to lilo.conf to make it ignore the second mirrored disk altogether. In this case LILO will issue the warning &lt;code&gt;Warning: bypassing VolumeID scan of drive flagged INACCESSIBLE:  /dev/sdb&lt;/code&gt; but proceed.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Solution 2 (better): enable dmraid access to your drive. The thing is that the Slackware installer actually saw our mirrored volume alright (it listed our device automatically as &lt;code&gt;/dev/md126*&lt;/code&gt;) but when booting our newly installed Slackware, the dm volume was no longer there. In case you wonder, this is because the Slackware installer rc.S script issues a &lt;code&gt;/sbin/mdadm -A -s&lt;/code&gt; after fuse has been launched, which enables autodetection of mirrored drives.&lt;br /&gt;Therefore, if you just run that same command, the RAID 1 array will be detected and LILO won't complain about Volume IDs. &lt;pre class="brush:text"&gt;# /sbin/mdadm -A -s&lt;br /&gt;mdadm: Container /dev/md/imsm0 has been assembled with 2 drives&lt;br /&gt;mdadm: Started /dev/md/WindowsRAID1_0 with 2 devices&lt;/pre&gt;Probably a good idea to add that line in your system's rc.S script as well.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Now, with the Windows RAID issue being sorted, let's try again, shall we:&lt;pre class="brush:shell"&gt;# lilo&lt;br /&gt;Added Linux *&lt;br /&gt;Added Windows&lt;br /&gt;Warning: Device 0x0820: Inconsistent partition table, 2nd entry&lt;br /&gt;  CHS address in PT:  0:0:0  --&gt;  LBA (-1)&lt;br /&gt;  LBA address in PT:  0  --&gt;  CHS (0:0:1)&lt;br /&gt;Fatal: Either FIX-TABLE or IGNORE-TABLE must be specified&lt;br /&gt;If not sure, first try IGNORE-TABLE (-P ignore)&lt;/pre&gt;Son of a "£$%^&amp;!! What's going on there?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Booting GPT partitions using MBR tools&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I'll cut to the chase, our actual problem here is that LILO (as well as GRUB) is an &lt;b&gt;MBR&lt;/b&gt; bootloader, not a GPT one. Therefore it actually uses the MBR partition table, and if you look at this table, you'll see that as far as MBR is concerned, /dev/sdc2 is nowehere to be found:&lt;pre class="brush:text"&gt;# fdisk -l /dev/sdc&lt;br /&gt;&lt;br /&gt;WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Disk /dev/sdc: 120.0 GB, 120034123776 bytes&lt;br /&gt;255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors&lt;br /&gt;Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;Disk identifier: 0x41b82465&lt;br /&gt;&lt;br /&gt;   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/sdc1               1   234441647   117220823+  ee  GPT&lt;/pre&gt;Wait a minute, if that's the case, how comes LILO was able to boot our Linux GPT partition then? Isn't that one GPT too?&lt;br /&gt;Aha! Well, the trick here is that, when booting the system, LILO doesn't need to know how the partition or filesystem is setup. Since the kernel file is always available to the Linux system you want to run LILO from (duh!), LILO can point to the actual kernel image sectors directly, so it actually &lt;b&gt;bypasses&lt;/b&gt; the whole partition table (as well the filesystem), and just provides a list of &lt;b&gt;raw&lt;/b&gt; blocks to read. Haven't you learned something interesting today? And that is why even a non GPT aware bootloader like LILO is able to boot from a kernel residing on a GPT Linux system partition. But of course, as soon as you leave the system partition, then LILO needs an MBR reference, to know where the start of the target partition is located, which it cannot find.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;gptsync to the rescue!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;At first glance it looks like we may have to abandon LILO. As far as I know, GRUB is unlikely to perform any better though (it's also an MBR based bootloader), but there exist projects targeted at GPT such as eLILO, though these may also require an EFI platform as well, which may also render them useless for our usage scenario. &lt;br /&gt;&lt;br /&gt;Now, remember what I said about protective MBR tables for GPT disks and how both MBR and GPT could coexist? How about we created an MBR table that contains the same partition information as our GPT one then? Well, that's exactly what the &lt;a href="http://refit.sourceforge.net/"&gt;rEFIt&lt;/a&gt;'s gptsync tool is all about. This is a tool that can take a GPT partition table and create an exact MBR clone of it, so that MBR aware tools get the relevant information about the partitions.&lt;br /&gt;Of course, this can only work if the GPT partition doesn't deviate too much from MBR compatibility requirements, which in most case (if your HDD is less than 2 TB as this is the hard limit for maximum MBR), shouldn't be a problem.&lt;br /&gt;At this stage you have two options: pick up the binary gptsync executable for OSX from the Mac disk image or recompile your own from source in Linux. If you want a precompiled gptsync for OSX you can find one &lt;a href="http://www.insanelymac.com/forum/index.php?showtopic=177505"&gt;here&lt;/a&gt; (&lt;a href="http://nil.rcp1.org/files/gptsync-0.2.pkg.zip"&gt;direct mirror&lt;/a&gt;), but considering that we're in Linux right now, we'll go the recompilation route. After having downloaded and extracted the &lt;a href="http://refit.sourceforge.net/#download"&gt;latest refit package&lt;/a&gt;, just navigate to the &lt;code&gt;gptsync&lt;/code&gt; directory and run &lt;code&gt;make -f Makefile.unix&lt;/code&gt;. As these utilities are fairly simple, this should produce a &lt;code&gt;gptsync&lt;/code&gt; and &lt;code&gt;showpart&lt;/code&gt; executable in the same directory. Might be a good idea to see what &lt;code&gt;showpart&lt;/code&gt; reports before going further, right?&lt;pre class="brush:text"&gt;# ./showpart /dev/sdc&lt;br /&gt;&lt;br /&gt;Current GPT partition table:&lt;br /&gt; Warning: Unknown GPT spec revision 0x00010000&lt;br /&gt;Floating point exception&lt;/pre&gt;Dammit! Does no single tool work as expected out of the box these days, or is it just that I'm always one step ahead in trying cutting edge stuff? Long story short, you get this error on &lt;b&gt;64 bit&lt;/b&gt; Linux environments because the tools use &lt;code&gt;unsigned long&lt;/code&gt; for 32 bit unsigned, and &lt;code&gt;unsigned long&lt;/code&gt; is not 32 bit on x86_64. Easiest way I found to fix this is to include &lt;code&gt;&amp;lt;stdint.h&amp;gt;&lt;/code&gt; in &lt;code&gt;gptsync.h&lt;/code&gt; and then change the UINT8, UINT16, UINT32, UINT64 typedefs to use uint8_t, uint16_t, etc.... Once this is done:&lt;pre class="brush:text"&gt;# ./showpart /dev/sdc&lt;br /&gt;&lt;br /&gt;Current GPT partition table:&lt;br /&gt; #      Start LBA      End LBA  Type&lt;br /&gt; 1             40       409639  EFI System (FAT)&lt;br /&gt; 2         409640     59022927  Mac OS X HFS+&lt;br /&gt; 3       59022928    121937487  Basic Data&lt;br /&gt;&lt;br /&gt;Current MBR partition table:&lt;br /&gt; # A    Start LBA      End LBA  Type&lt;br /&gt; 1              1    234441647  ee  EFI Protective&lt;br /&gt;&lt;br /&gt;MBR contents:&lt;br /&gt; Boot Code: LILO&lt;br /&gt;&lt;br /&gt;Partition at LBA 40:&lt;br /&gt; Boot Code: None (Non-system disk message)&lt;br /&gt; File System: FAT32&lt;br /&gt; Listed in GPT as partition 1, type EFI System (FAT)&lt;br /&gt;&lt;br /&gt;Partition at LBA 409640:&lt;br /&gt; Boot Code: None&lt;br /&gt; File System: Unknown&lt;br /&gt; Listed in GPT as partition 2, type Mac OS X HFS+&lt;br /&gt;&lt;br /&gt;Partition at LBA 59022928:&lt;br /&gt; Boot Code: None&lt;br /&gt; File System: ext4&lt;br /&gt; Listed in GPT as partition 3, type Basic Data&lt;/pre&gt;Much better! Off we go then:&lt;br /&gt;&lt;pre class="brush:text"&gt;# ./gptsync /dev/sdc&lt;br /&gt;&lt;br /&gt;Current GPT partition table:&lt;br /&gt; #      Start LBA      End LBA  Type&lt;br /&gt; 1             40       409639  EFI System (FAT)&lt;br /&gt; 2         409640     59022927  Mac OS X HFS+&lt;br /&gt; 3       59022928    121937487  Basic Data&lt;br /&gt;&lt;br /&gt;Current MBR partition table:&lt;br /&gt; # A    Start LBA      End LBA  Type&lt;br /&gt; 1              1    234441647  ee  EFI Protective&lt;br /&gt;&lt;br /&gt;Status: MBR table must be updated.&lt;br /&gt;&lt;br /&gt;Proposed new MBR partition table:&lt;br /&gt; # A    Start LBA      End LBA  Type&lt;br /&gt; 1              1       409639  ee  EFI Protective&lt;br /&gt; 2         409640     59022927  af  Mac OS X HFS+&lt;br /&gt; 3 *     59022928    121937487  83  Linux&lt;br /&gt;&lt;br /&gt;May I update the MBR as printed above? [y/N] y&lt;br /&gt;Yes&lt;br /&gt;&lt;br /&gt;Writing new MBR...&lt;br /&gt;MBR updated successfully!&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Final LILO tuning&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Alrighty. Time for a new run at LILO:&lt;pre class="brush:text"&gt;# lilo&lt;br /&gt;Added Linux *&lt;br /&gt;Added Windows&lt;br /&gt;Warning: Device 0x0820: Inconsistent partition table, 2nd entry&lt;br /&gt;  CHS address in PT:  1023:254:63  --&gt;  LBA (16450559)&lt;br /&gt;  LBA address in PT:  409640  --&gt;  CHS (25:127:15)&lt;br /&gt;Fatal: Either FIX-TABLE or IGNORE-TABLE must be specified&lt;br /&gt;If not sure, first try IGNORE-TABLE (-P ignore)&lt;/pre&gt;Well, actually this is not entirely unexpected considering that GPT does away with the MBR requirements of having partitions starting and ending on a cylinder boundary, so of course, if you don't fine tune your GPT partition, you're likely to have an MBR partition table that doesn't meet the MBR specs. However, in this case, we can safely &lt;b&gt;ignore&lt;/b&gt; that issue, by making sure we have the following at the top of our /etc/lilo.conf&lt;br /&gt;&lt;pre class="brush:text"&gt;lba32        # LBA addressing should be default anyway&lt;br /&gt;ignore-table # ignore CHS vs LBA conflicts in the MBR&lt;/pre&gt;This time:&lt;pre class="brush:text"&gt;# lilo&lt;br /&gt;Added Linux *&lt;br /&gt;Added Windows&lt;br /&gt;Warning: Device 0x0820: Inconsistent partition table, 2nd entry&lt;br /&gt;  CHS address in PT:  1023:254:63  --&gt;  LBA (16450559)&lt;br /&gt;  LBA address in PT:  409640  --&gt;  CHS (25:127:15)&lt;br /&gt;Warning: The partition table is *NOT* being adjusted.&lt;br /&gt;Added OSX&lt;br /&gt;2 warnings were issued.&lt;/pre&gt;Yay, at long last, our bootloader installed!&lt;br /&gt;NB: if you get an "invalid block" error on your OSX partition in LILO, this means that your OSX bootloader (Chameleon, Chimera) has not been properly installed, so you will need to fix that first.&lt;br /&gt;&lt;br /&gt;With LILO in place, you should find that you now have multiboot between Linux, Windows and OSX, and you didn't have to forfeit your ICH8R Windows partition in the slightest. &lt;br /&gt;&lt;br /&gt;As is obvious from the length of these posts, this whole process took some fairly heavy lifting, but I hope that was worth it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-3326419350346509630?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/3326419350346509630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux_3637.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3326419350346509630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3326419350346509630'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux_3637.html' title='Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 5'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-8400492597777047585</id><published>2011-05-25T16:29:00.002+01:00</published><updated>2011-05-25T16:33:34.913+01:00</updated><title type='text'>Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 4</title><content type='html'>&lt;b&gt;Tuning the OSX installation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Just a placeholder for now, as I still need for figure a few things. This will encompass removing the need to update AHCI for RAID everytime the system performs an update, making OSX bootable on its own, installing additiona drivers, etc.&lt;br /&gt;&lt;br /&gt;All of the above doesn't really need to be performed before the Linux installation, but it looks tidier to keep all the OSX related posts in the same breadth... Stay tuned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-8400492597777047585?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/8400492597777047585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux_25.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8400492597777047585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8400492597777047585'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux_25.html' title='Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 4'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-645161581403090058</id><published>2011-05-24T21:59:00.010+01:00</published><updated>2011-08-26T20:02:03.606+01:00</updated><title type='text'>Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 3</title><content type='html'>Alright, on to the actual OSX installation. This assumes that you have sorted out the matter of getting your SATA controllers detetected, and have booted your USB installation media with iBoot&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Disk partitioning&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;From there on, this is the regular OSX installation process. After selecting your language and graciously ignoring the EULA, you should be greeted by a list of all the disks that the installation process is able to handle.&lt;br /&gt;Unless you did something wrong in the previous process, you should have all your disks (though some of those may not appear until you run the disk utility - see next step). If you can't see them here at all, then you either screwed up your kext modification or your kext cache rebuilding. Shame on you!&lt;br /&gt;&lt;br /&gt;In our case, we're going to use a new drive for the OSX + Linux installation, so the first order of business is to partition our HDD in GPT/GUID mode, using the OSX disk utility, which we prefer over using Linux's gdisk as OSX seems to have some installation quirks that gdisk alone doesn't seem to be able to address. I found out that if you use gdisk to modify the GPT partition, you're likely to have the OSX installer complaining that it cannot boot from it.&lt;br /&gt;&lt;br /&gt;To parition the disk, simply launch "Disk Utility" from the Utilities menu at the top. Then select the destination disk and click the "Partition" button.&lt;br /&gt;&lt;br /&gt;Now if anyone knows how one can make the OSX Disk Utility to accept user specified sizes, I'd like to hear from you as any attempt I tried to create a 40 GB single partition for OSX, while leaving the rest of the disk unused have failed. Gotta wonder what the point of providing a "Size" field is when it is blatantly ignored. The trick I used then was to go through the various "n-partitions" options, and pick the one that creates a first partition (for OSX) that is as close as possible to the size I actually want. Then just go through all the extra paritions and change their Format to "Free Space".&lt;br /&gt;&lt;br /&gt;The points you want to pay attention to are:&lt;ol&gt;&lt;li&gt;Label your OSX partition with something descriptive - don't keep "Untitled 1" (though you can change that later)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Select "Mac OS Extended (Case-sensitive, Journaled)" for the Format (it's an UNIX based OS, it IS case sensitive dammit!). Now, if you ever plan to modify your OS files from Linux, then you may want to select a non Journaled filesystem, as the current HFS driver from Linux does not offer write access on Journaled.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;MAKE SURE&lt;/b&gt; "GUID Partition Table" (a.k.a. GPT) is used by clicking the "Options" button. Though you should be able to get away with MBR, the whole point of this exercise is to have a GPT disk to play with, so that's what we're gonna use.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Once your partitioning is set &lt;b&gt;double check that you are partitioning the right disk&lt;/b&gt;, click Apply and quit the Disk Utility program. The newly created partition should now appear as a valid destination target for the installation process, so just select it and click "Install" (or click Customize then install, as it may be a good idea to remove additional languages or printer support if you don't have use for it). You can now go grab a cup of your favorite beverage and come back when the installation process has completed.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Dude, where's my boot?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;So the install process completed successfully, the machine rebooted (more or less as the reboot process can be a bit flaky), and iBoot sees the new OSX installation alright. "VICT..., oh wait, this doesn't boot at ALL! AGHHH!!!".&lt;br /&gt;&lt;br /&gt;Of course it doesn't you silly! To reiterate what I pointed out at the end of the previous post, the OSX installation process installs a &lt;b&gt;clean, unmodified&lt;/b&gt; set of kexts, therefore all our good work about supporting the RAID controller on the USB key has been ignored. For the time being, we'll just fix that as we previously did, but instead of accessing the USB key, we'll do it on the OSX target drive:&lt;ol&gt;&lt;li&gt;Boot once more into your USB installation media with iBoot&lt;/li&gt;&lt;br /&gt;&lt;li&gt;go to Utilities&amp;rarr;Terminal&lt;/li&gt;&lt;br /&gt;&lt;li&gt;issue the command "mount". It should list your OSX partition, indicate that it has write acces, and tell you where it is mounted (should be in /Volumes/Something)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;code&gt;cd /Volumes/&amp;lt;your_osx_partition&amp;gt;/System/Library/Extensions/AppleAHCIPort/Contents&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Issue &lt;code&gt;nano Info.plist&lt;/code&gt; (you &lt;b&gt;do&lt;/b&gt; have nano on your installation key, right? If not, see the first post in this series).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Apply the same change as we did in previous post, namely change the &lt;code&gt;&amp;lt;string&amp;gt;0x01060100&amp;amp;0xffffff00&amp;lt;/string&amp;gt;&lt;/code&gt; part to &lt;code&gt;&amp;lt;string&amp;gt;0x01060100&amp;amp;0xffffff00 0x01040000&amp;amp;0xffff0000&amp;lt;/string&amp;gt;&lt;/code&gt; and save the file.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Now, as previously, we need to rebuild the kext cache. The only difference is that unlike the installation media, the cache for Snow Leopard is located at &lt;code&gt;System/Library/Caches/com.apple.kext.caches/Startup&lt;/code&gt;, so the command you want to issue is:&lt;br /&gt;&lt;pre class="brush:text"&gt;kextcache -v 1 -t -l -a i386 -a x86_64 -m /Volumes/&amp;lt;your_osx_partition&amp;gt;/System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /Volumes/&amp;lt;your_osx_partition&amp;gt;/System/Library/Extensions&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Quit the installer and restart the machine&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Remove the USB key and boot into iBoot. Then select your OSX partition. This time it should boot alright and finalize the installation process. &lt;i&gt;Wilkommen, Bienvenue, Welcome to cabaret indeed&lt;/i&gt;! But keep that USB installation media handy, as you are likely to need it again very soon.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-645161581403090058?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/645161581403090058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux_4844.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/645161581403090058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/645161581403090058'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux_4844.html' title='Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 3'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-2949524996091522312</id><published>2011-05-24T11:41:00.017+01:00</published><updated>2011-07-07T21:38:12.143+01:00</updated><title type='text'>Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 2</title><content type='html'>With both the iBoot CD and the OSX installation USB key rearing to go (see previous post), it's time to insert them both, and reboot, while making sure the CD/DVD drive is selected as your boot device. After a while, the iBoot boot selection screen should pop up, and provide you with the option to select "Mac OSX Install DVD" to boot from (which is actually our USB key) to start the installation process. NB: the name may be truncated, but if this is your first OSX install, just make sure you pick up the icon wit the Apple logo, as there should be only one.&lt;br /&gt;&lt;br /&gt;Now, if your SATA controller was set to AHCI, or if you were using a JMicron SATA port, your target hard drive would likely be detected by the installer and you could actually proceed with the installation.&lt;br /&gt;But of course, that wouldn't teach you how to add support for custom hardware on the fly, such as RAID SATA controller, would it, so where's the fun in that? Plus if you're reading this guide, you're trying to get an ICH controller in RAID mode supported.&lt;br /&gt;&lt;br /&gt;In our case, if we try to iBoot our USB key, the installer won't see our target disk at all, so we need to address that on the USB key. The nice thing about our USB key procedure is that we can add AHCI support on the fly, and the producedure highlighted below should actually work for &lt;b&gt;any&lt;/b&gt; SATA RAID controller (ICH9R, nVidia, whatever) that supports AHCI passthrough, not just ICH8R.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What's the big deal with AHCI vs RAID anyway?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;As it turns out not much. The thing is, even in RAID mode, an ICH controller such as the one we use does AHCI passthrough. So why does the OSX installer see the disk in AHCI mode, but not in RAID mode?&lt;br /&gt;Glad you asked. This is best illustrated by looking at the output from Linux's &lt;code&gt;lspci&lt;/code&gt; both in BIOS AHCI mode and in BIOS RAID mode.&lt;br /&gt;&lt;br /&gt;For the P5B Deluxe, here is what &lt;code&gt;lspci -nn&lt;/code&gt; reports for our SATA ICH8R controller in AHCI mode:&lt;pre class="brush:text"&gt;00:1f.2 SATA controller [0106]: Intel Corporation 82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA AHCI Controller [8086:2821] (rev 02)&lt;/pre&gt;And here is the same, but in RAID mode:&lt;pre class="brush:text"&gt;00:1f.2 RAID bus controller [0104]: Intel Corporation 82801 SATA RAID Controller [8086:2822] (rev 02)&lt;/pre&gt;The important things to notice is that both the class ID and the controller VID:PID have changed, from (0106, 8086:2821) to (0104, 8086:2822) respectively.&lt;br /&gt;As it turns out, the 0x0106 class ID is what the Apple AHCI driver uses to find out if a SATA controller is one it should support through AHCI (well, it actually uses 0x01060100 with a 0xffffff00 mask as we will see shortly), so that's the reason why, as soon as our class ID changes to 0x0104, OSX says "Hey, I don't know how to access this type of controller!" and gives up.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;That's all very well, but that doesn't tell me how to get my RAID SATA controller recognized&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Patience my friend... The key to achieving anything is understanding how it actually works, which we've done, so now is the time to get to the good part.&lt;br /&gt;As you may already be aware, getting hardware recognized on OSX is done through the addition or modification of kexts. A kext, which stands for &lt;b&gt;K&lt;/b&gt;ernel &lt;b&gt;Ext&lt;/b&gt;tension is pretty much the OSX equivalent of a driver or a Linux module. Therefore, to make our RAID controller recognized by the AHCI driver Apple uses, we will need to modify the kexts from our USB installation media to trick the installer into recognizing our non-officially unsupported hardware.&lt;br /&gt;&lt;br /&gt;The kext of interest to us is the &lt;code&gt;AppleAHCIPort.kext&lt;/code&gt; (makes sense), that resides in &lt;code&gt;/System/Library/Extensions/&lt;/code&gt; (which you will often see abbreviated as S/L/E on hackintosh forums). Most specifically, what we will want to edit is the &lt;code&gt;Info.plist&lt;/code&gt; file found in &lt;code&gt;/System/Library/Extensions/AppleAHCIPort.kext/Contents&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;If you look at this file you see that it contains a section:&lt;br /&gt;&lt;pre class="brush:text"&gt;&amp;lt;key&amp;gt;GenericAHCI&amp;lt;/key&amp;gt;                                 &lt;br /&gt;&amp;lt;dict&amp;gt;                                                         &lt;br /&gt;        &amp;lt;key&amp;gt;CFBundeIdentifier&amp;lt;/key&amp;gt;                     &lt;br /&gt;        &amp;lt;string&amp;gt;com.apple.driver.AppleAHCIPort&amp;lt;/string&amp;gt;  &lt;br /&gt;        &amp;lt;key&amp;gt;Chipset Name&amp;lt;/key&amp;gt;                          &lt;br /&gt;        &amp;lt;string&amp;gt;AHCI Standard Controller&amp;lt;/string&amp;gt;        &lt;br /&gt;        &amp;lt;key&amp;gt;IOClass&amp;lt;/key&amp;gt;                               &lt;br /&gt;        &amp;lt;string&amp;gt;AppleAHCI&amp;lt;/string&amp;gt;                       &lt;br /&gt;        &amp;lt;key&amp;gt;IOPCIClassMatch&amp;lt;/key&amp;gt;                       &lt;br /&gt;        &amp;lt;string&amp;gt;0x01060100&amp;amp;0xffffff00&amp;lt;/string&amp;gt;       &lt;br /&gt;        &amp;lt;key&amp;gt;IOProbeScore&amp;lt;/key&amp;gt;                          &lt;br /&gt;        &amp;lt;integer&amp;gt;800&amp;lt;/integer&amp;gt;                           &lt;br /&gt;        &amp;lt;key&amp;gt;IOProviderClass&amp;lt;/key&amp;gt;                       &lt;br /&gt;        &amp;lt;string&amp;gt;IOPCIDevice&amp;lt;/string&amp;gt;                     &lt;br /&gt;        &amp;lt;key&amp;gt;Vendor Name&amp;lt;/key&amp;gt;                           &lt;br /&gt;        &amp;lt;string&amp;gt;Unknown&amp;lt;/string&amp;gt;                         &lt;br /&gt;&amp;lt;/dict&amp;gt;&lt;/pre&gt;Well, well, well, is that our 0x0106 generic AHCI class right there?&lt;br /&gt;&lt;br /&gt;Great, then we just need to change the &lt;code&gt;&amp;lt;string&amp;gt;0x01060100&amp;amp;0xffffff00&amp;lt;/string&amp;gt;&lt;/code&gt; part to &lt;code&gt;&amp;lt;string&amp;gt;0x01060100&amp;amp;0xffffff00 0x01040000&amp;amp;0xffff0000&amp;lt;/string&amp;gt;&lt;/code&gt; to add AHCI passthrough support to any RAID controller (if you &lt;b&gt;do&lt;/b&gt; have an actual dedicated non SATA RAID controller on your platform, you probably shouldn't use such a blanket approach, but instead duplicate one of the later sections), save the file, reboot, and be done with it, right?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Rebuidling the kext cache&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Not so fast! If you just edit and save the Info.plist on the USB key, your RAID controller still will not be detected.&lt;br /&gt;The reason for that is that kexts are executed at the kernel level, so Apple doesn't simply let you load a modified kext like this. Instead, an additional step is needed, which is the rebuilding of what is known as the kext cache. This cache is the &lt;code&gt;Extensions.mkext&lt;/code&gt; file located in your &lt;code&gt;/System/Library/&lt;/code&gt; directory (where the &lt;code&gt;Extensions/&lt;/code&gt; directory also resides).&lt;br /&gt;&lt;br /&gt;Note that the procedure I am highlighting below can be done from an existing Snow Leopard OS, rather than on the USB key itself, but if you do so, be midnful that there's a whole business going on with regards to permissions and ownership, which, if you mount your USB key as anybody but root (not a problem when using the OSX from the key), may result in an error message such as:&lt;br /&gt;&lt;pre class="brush:text"&gt;AppleAHCIPort.kext is not authentic; omitting from mkext.&lt;br /&gt;Authentication Failures:&lt;br /&gt;   File owner/permissions are incorrect (must be root:wheel, nonwritable by group/other):&lt;br /&gt;       /Volumes/Mac OS X Install DVD/System/Library/Extensions/AppleAHCIPort.kext/Contents/Info.plist&lt;/pre&gt;In our case, we'll run everything from the key, and the default execution level is that of the root user, so it should be fairly simple:&lt;ol&gt;&lt;li&gt;Open a terminal window by selecting Utilities→Terminal in the top menu (notice that we haven't had to accept any EULA to do so, so you are free to edit your OSX installation media from the embedded Terminal in any way you like)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Remount the USB key as read/write (by default it is mounted read only) by issuing the command:&lt;pre class="brush:text"&gt;mount -u -o rw /&lt;/pre&gt;Note: Make sure you don't close your terminal session after you do that, as Terminal will not launch if the system is already r/w (which is also the reason why we do it manually). You should be able to check that the USB file system is now mounted r/w by issuing &lt;code&gt;mount&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you haven't done so already, copy the nano text editor, which you should have copied into the root directory to /usr/bin with the command:&lt;br /&gt;&lt;code&gt;cp /nano /usr/bin&lt;/code&gt;&lt;br /&gt;Or you can just leave it in root and issue &lt;code&gt;/nano&lt;/code&gt; whenever you need to edit a file.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Navigate to the Info.plist file we want to edit with &lt;code&gt;cd /System/Library/Extensions/AppleAHCIPort.kext/Contents/&lt;/code&gt; and run nano &lt;code&gt;nano Info.plist&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Change the &lt;code&gt;&amp;lt;string&amp;gt;0x01060100&amp;amp;0xffffff00&amp;lt;/string&amp;gt;&lt;/code&gt; line in the &lt;code&gt;&amp;lt;key&amp;gt;GenericAHCI&amp;lt;/key&amp;gt;&lt;/code&gt; section to &lt;code&gt;&amp;lt;string&amp;gt;0x01060100&amp;amp;0xffffff00 0x01040000&amp;amp;0xffff0000&amp;lt;/string&amp;gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Save the file (Ctrl-X then 'y' to save it)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;navigate to the /System/Library/ directory with &lt;code&gt;cd /System/Library/&lt;/code&gt;. This is the directory that contains the Extensions.mkext file&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Rebuild the kext cache with:&lt;pre class="brush:text"&gt;kextcache -v 1 -t -l -a i386 -a x86_64 -m Extensions.mkext Extensions&lt;/pre&gt;It should complete without errors (or  a benign warning about the JMicronATA.kext) but if there are any issues reported about the AppleAHCIPort.kext, they should be explicitly listed.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Close terminal and leave the installer (Mac OS X Installer&amp;rarr;Quit Mac OS X Installer) then select Restart. You must restart the installation process completely (i.e. reboot) for our changes to be applied.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;With all the above completed, on the second iBoot/USB installer run, you should now see all hard drives recognized, including the ones connected in a SATA connector in RAID mode, with the ability to use them as installation destination. Neat!&lt;br /&gt;&lt;br /&gt;Before shouting "victory" though, you should be aware that:&lt;ol&gt;&lt;li&gt;When OSX installs, it will extract and install its own unmodified AppleAHCIPort kext (from the &lt;code&gt;Essentials.pkg&lt;/code&gt; found in &lt;code&gt;System/Installation/Packages/&lt;/code&gt; directory on the installation media, so what we have done will only work during installation, but the installed OSX will not actually be able to see its disk and we'll have to work around that - bummer!&lt;/li&gt;&lt;br /&gt;&lt;li&gt;iBoot offers the option to ignore the cache during bootup (press the down key on the OS you want to boot, and then select "Boot Ignore Caches"), so we probably could have gotten away with simply modifying the Info.plist file and used that iBoot option instead of going through this whole cache rebuilding exercise...&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;Anyway, in the next installement, we'll go through the actual OSX installation process. Stay tuned...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-2949524996091522312?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/2949524996091522312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux_24.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2949524996091522312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2949524996091522312'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux_24.html' title='Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 2'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-4674972109848584415</id><published>2011-05-23T22:31:00.014+01:00</published><updated>2011-07-07T21:32:16.720+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='P5B'/><category scheme='http://www.blogger.com/atom/ns#' term='ICH8R'/><category scheme='http://www.blogger.com/atom/ns#' term='Snow Leopard'/><category scheme='http://www.blogger.com/atom/ns#' term='OSX'/><category scheme='http://www.blogger.com/atom/ns#' term='RAID'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='GPT'/><category scheme='http://www.blogger.com/atom/ns#' term='USB'/><title type='text'>Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 1</title><content type='html'>Now that's quite a mouthful of a title. And considering that there is much to discuss, I will break this whole thing into a multipart post, so here is the first part of our series.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Introduction &amp;amp; Requirements&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;First of all, I gotta start with the disappointing news that, despite what you might anticipate from the title, this is not a guide to setup motherboard RAID (a.k.a. fakeRAID) support in either OSX or Linux (though the later is no biggie - see previous posts here for various options). The mention of RAID here is to indicate that we want to do an OSX and Linux that coexists nicely with a previous fakeRAID installation, by NOT requiring you to disable RAID settings in BIOS if they are already enabled.&lt;br /&gt;&lt;br /&gt;In practice here, the goal is to add OSX and Linux on a separate non-RAID disk to an existing Windows 7 installation that was set to use fakeRAID (RAID 1 from ICH8R), without touching the BIOS settings.&lt;br /&gt;&lt;br /&gt;Basically, what happened is that I recently upgraded my good old Asus P5B Deluxe based rig to a dual Samsung F3 1TB, installed Windows 7 ontop of the ICH8R RAID 1 array which I created in BIOS as a result, and since that left me with a bunch of unused SATA drives, I thought I would put one of these to good use by installing both OSX and Slackware on it (that Slackware 13.37 sure IS nice!), and use it to boot the whole lot. Sounds easy, but it actually presents a nice set of challenges, some of which include:&lt;ul&gt;&lt;li&gt;Adding extra drivers to a vanilla OSX installation media, so that it recognizes our AHCI controller even in RAID mode&lt;/li&gt;&lt;li&gt;Allow LILO (or GRUB) to boot OSes other than the main Linux system on a GPT/GUID partitioned disk (with a BIOS that is NOT EFI)&lt;/li&gt;&lt;li&gt;Installing OSX Snow Leopard from scratch, including updates and necessary drivers for your rig, but WITHOUT having to spend one's life endlessly browsing the OSX86 forums. Yes, the effort is much appreciated guys, but I have better things to do then become an expert on kexts, Chameleon, DSDT, iBoot and whatnot.&lt;/li&gt;&lt;/ul&gt;My specs:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Asus P5B Deluxe with 2x 1TB SATA HDDs in RAID mode (ICH8R) and 1x 320GB HDD (non RAID)&lt;/li&gt;&lt;li&gt;nVidia GPU (7950GT)&lt;/li&gt;&lt;li&gt;PS/2 keyboard, USB mouse + IDE DVD (the DVD is only going to be used for iBoot, so SATA or IDE won't matter one bit)&lt;/li&gt;&lt;/ul&gt;Requirements:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;OSX Snow Leopard official installation DVD or .dmg image (build 10A421A)&lt;/li&gt;&lt;li&gt;One 8 GB (or bigger) USB key&lt;/li&gt;&lt;li&gt;An existing Snow Leopard installation. Yeah, I know it sucks, but hey.&lt;/li&gt;&lt;/ul&gt;That last item means either you need to create a VMWare image from the DVD media, or borrow a friend's Mac, but we want to create a USB OSX installation medium, which we can customize so there's little way to bypass that requirement. If you really don't have access to a preexisting OSX system, it's probably possible to create an USB key from Linux from the OSX installation DVD, but I haven't tried it so I can't comment on that. Besides, a VMWare image with Snow Leopard shouldn't be that hard to find.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;My kingdom for AHCI? Surely you are jesting!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Question: What do all the hackintosh installation guides you find on the internet have in common?&lt;br /&gt;Answer: They all begin with "You MUST change your BIOS settings and set your SATA controller to AHCI before you begin the installation"&lt;br /&gt;&lt;br /&gt;Of course, this is utter nonsense. If a guide begins with "You MUST change your BIOS settings to something potentially incompatible with what you want, and risk destroying existing data as a result" (by disabling RAID mode from ICHR), then it's  a lousy guide and you should stop right there. For having been a fakeRAID/motherboard RAID user for some years now, with both Intel and nVidia solutions, I'll tell you frankly: all those who say "Don't use fakeRAID: buy a dedicated RAID controller instead" are idiots. First of all, money to buy a separate controller doesn't grow on tree and secondly, with all these cores lying around, the idea that one should spend extra, when all they want is add fault tolerance to &lt;b&gt;consumer grade&lt;/b&gt; hardware is ludicrous. We're not building an enterprise grade server here dammit! Besides, most of these solutions are rather well supported in Linux now, which means that if you screw up your fakeRAID array, you may just be able to do something about it. With a hardware proprietary non reverse engineered RAID solution on the other hand, you might not be so lucky...&lt;br /&gt;&lt;br /&gt;Therefore, the hell with changing your BIOS settings to AHCI! If Linux doesn't bat an eyelid about accessing SATA HDDs with an ICH controller in RAID mode, why should OSX be the exception? Therefore, we'll keep our ICH BIOS settings to RAID, thank you very much, and ignore all this AHCI brainwashing.&lt;br /&gt;&lt;br /&gt;Now, since the OSX installation media has not been designed to support ICH8 in RAID mode, if you try something like iBoot and an unmodified OSX installation media, then unless your HD is plugged on a JMicron SATA controller (which is an actual possibility on the P5B Deluxe), the OSX installer will not see it. This basically means we're gonna have to modify the OSX installation system so that it sees our ICH8R controller as AHCI ICH8 and that's also where doing the install from an 8GB (or more) USB key, that we can modify on the fly, will come real handy.&lt;br /&gt;&lt;br /&gt;But first, we gotta create the base vanilla installer on our key.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Creating a vanilla OSX installation USB key&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To do that, you need to be in your existing OSX system (VMWare, soon-to-be-ex-friend's machine, etc.). I'm going to assume that you have the vanilla OSX disk as a .dmg. The steps to create the key then are as follow:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Plug in your USB key. Don't worry if it automounts.&lt;/li&gt;&lt;li&gt;Open the OSX disk utility (Applications -&amp;gt; Utilities -&amp;gt;Disk Utilities). You should see something like "8.02 GB Generic STORAGE DEVICE Media" or something, as your USB volume&lt;/li&gt;&lt;li&gt;Click on the "Partition" button on the left, to access the partition tab, then click on the "Current" Volume Scheme button so that you get a dropdown, and select 1 partition&lt;/li&gt;&lt;li&gt;In options, under the partition diagram, make sure you select "GUID Partition Table". For the Format, you select "Mac OS Extended" (though it shouldn't matter)&lt;/li&gt;&lt;li&gt;Click Apply to partition &amp;amp; format the USB key&lt;/li&gt;&lt;li&gt;Once formatting is complete, select the Restore button&lt;/li&gt;&lt;li&gt;Now double click on your OSX .dmg image to mount it (or insert your OSX DVD). A "Mac OS X Install DVD" icon should appear on your desktop&lt;/li&gt;&lt;li&gt;Drag that icon onto the Source field of the Restore parameters in Disk Utility until a green '+' sign appears, and then drop it there&lt;/li&gt;&lt;li&gt;For the Destination field, just drag and drop the "Untitled 1" partition, or whatever you called it, from your newly formatted USB stick&lt;/li&gt;&lt;li&gt;Click the "Restore" button. You will be prompted for the system's administrative password.&lt;/li&gt;&lt;/ol&gt;For those who want to see it for themselves, the whole process of creating an OSX installation USB key is demonstrated by the first part of the video below (credits go to &lt;b&gt;stellarola&lt;/b&gt; - you can ignore the Stella Magic part that comes afterwards):&lt;br /&gt;&lt;br /&gt;&lt;object width="640" height="390"&gt;&lt;param name="movie" value="http://www.youtube.com/v/TapQwH4llBw&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/TapQwH4llBw&amp;amp;hl=en_US&amp;amp;feature=player_embedded&amp;amp;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="390"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The restore process will take a few minutes (15-30 mins), but, once completed, will give you the ability to install OSX from USB using iBoot.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Installing a text editor&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Because we're going to do it the hard way, a must have for our USB key is a text editor, so that we can tune the USB key to our needs during the installation process (more about this in the next post). As a UNIX veteran, I swear by vi, but I do understand that not everybody is confortable with vi sequences, so to alleviate the editing process, we'll go with the more intuitive GNU nano.&lt;br /&gt;&lt;br /&gt;One might wonder why there is no default editor on the vanilla OSX installation media, but the answer is that Apple obviously considered an installer to be read-only affair, so it made little sense adding vi or nano to the installation utilities. On the other hand, we will very much require the ability to edit files on USB, so we need a text editor for OSX. Of course, since GNU nano is GPL and therefore, anybody can legally publish a nano OSX binary to copy onto an USB key, I'm not going think twice about putting the one I conveniently recompiled from source (using Xcode 3.2) and that I am putting online &lt;a href="http://nil.rpc1.org/files/nano-2.2.6.tgz"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Once downloaded, just drag and drop the "nano" file onto your USB stick folder (where you'll see the OSX installation paraphernalia). As long as it's on the key, we're good - no need to worry about placing it into bin/ or usr/bin/ just yet. Once it's copied, you can eject the USB, as at this stage, we won't need to access another OSX system: we'll just do everything we need from USB.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;iBoot&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Finally, the last piece we need for the installation is the latest &lt;a href="http://www.tonymacx86.com/viewforum.php?f=125"&gt;iBoot CD&lt;/a&gt; (&lt;a href="http://www.bugmenot.com/view/tonymacx86.com"&gt;bugmenot&lt;/a&gt;). And while on the iBoot download page, you might as well download MultiBeast, as it will come handy to finalize our installation.&lt;br /&gt;&lt;br /&gt;The iBoot zip basically contains an ISO which you should burn to a CD. Note that if you can't use a CD, you should be able to use that ISO image to produce an alternate iBoot loader (eg use a second USB key or TFTP), but I'm not going to detail that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-4674972109848584415?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/4674972109848584415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4674972109848584415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4674972109848584415'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2011/05/installing-osx-snow-leopard-linux.html' title='Installing OSX (Snow Leopard) + Linux (Slackware 13.37 x86_64) on a GUID/GPT disk, with Software RAID enabled (ICH8R) - Part 1'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-6813118955916236220</id><published>2011-01-21T12:14:00.003Z</published><updated>2011-01-21T12:46:05.929Z</updated><title type='text'>Why encrypted firmware is bad</title><content type='html'>A simple example will suffice.&lt;br /&gt;&lt;br /&gt;Let's say I own a digital camera, or a device that contains a digital camera, that uses encrypted firmware.&lt;br /&gt;&lt;br /&gt;Now let's say that this firmware has been written in such way that, at regular intervals, and without any form of notification to the user (like a LED blinking or a tell-tale shutter noise), it takes low resolution pictures of what it sees, and stores these unrequited pictures into its embedded storage (which too would be encrypted).&lt;br /&gt;&lt;br /&gt;Then, when the user takes a normal high res picture using the digital camera, the firmware adds "noise" to it that contains encrypted image(s) from the hidden low-res pictures it has in memory.&lt;br /&gt;&lt;br /&gt;With hi-res image files in the MB range or even better: digital video, it has become exceedingly easy to add "meaningful noise" and play a little steganography on digital photography. There are also ways to ensure sure that an useful data payload can still be recovered, even if the user downsizes the images.&lt;br /&gt;&lt;br /&gt;Blissfully unaware of this, the user then uploads some of these high res picture to a public website, as one does. Then malicious entities/government agencies can just run a search on EXIF (if the user didn't remove this data, but even then, with the proper resources, parsing images all day to check for known steganographic payload is not that big a feat) and spy on you at length, provided you keep sharing pictures with friends, etc, and without your knowledge...&lt;br /&gt;&lt;br /&gt;Of course, this kind of far fetched scenario would never happen... just like printer manufacturers would never &lt;a href="http://en.wikipedia.org/wiki/Printer_steganography"&gt;add hidden marks to every page printed&lt;/a&gt;, that would uniquely identify what printer (and by extension who) printed some data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-6813118955916236220?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/6813118955916236220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2011/01/why-encrypted-firmware-is-bad.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6813118955916236220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6813118955916236220'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2011/01/why-encrypted-firmware-is-bad.html' title='Why encrypted firmware is bad'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-8190971154033925128</id><published>2010-08-13T17:44:00.005+01:00</published><updated>2010-08-13T18:03:57.550+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PSP'/><category scheme='http://www.blogger.com/atom/ns#' term='Pandora'/><category scheme='http://www.blogger.com/atom/ns#' term='Memory Stick'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='IPL'/><title type='text'>Formatting a PSP Memory Stick for use with a Pandora battery in Linux</title><content type='html'>Always a pain to do, and nobody seems to provide the files I want, so I'll just provide &lt;a href="http://nil.rpc1.org/files/pandora.tgz"&gt;my own files&lt;/a&gt; (using ipl_ms.bin =&gt; no frills, just normal boot) and a short script. &lt;br /&gt;&lt;br /&gt;Once extracted, just run something like:&lt;pre class="brush:shell"&gt;root@sheeva:~/pandora# ./format_ms.sh /dev/sda&lt;br /&gt;+ dd if=/dev/zero of=/dev/sda bs=512 count=32&lt;br /&gt;32+0 records in&lt;br /&gt;32+0 records out&lt;br /&gt;16384 bytes (16 kB) copied, 0.00699201 s, 2.3 MB/s&lt;br /&gt;+ parted /dev/sda&lt;br /&gt;GNU Parted 1.8.8&lt;br /&gt;Using /dev/sda&lt;br /&gt;Welcome to GNU Parted! Type 'help' to view a list of commands.&lt;br /&gt;(parted) mklabel msdos&lt;br /&gt;(parted) mkpartfs primary fat16 32s -1s&lt;br /&gt;(parted) set 1 boot on&lt;br /&gt;(parted) set 1 lba off&lt;br /&gt;(parted) u s&lt;br /&gt;(parted) p&lt;br /&gt;Model: Generic STORAGE DEVICE (scsi)&lt;br /&gt;Disk /dev/sda: 3995648s&lt;br /&gt;Sector size (logical/physical): 512B/512B&lt;br /&gt;Partition Table: msdos&lt;br /&gt;&lt;br /&gt;Number  Start  End       Size      Type     File system  Flags&lt;br /&gt; 1      32s    3995647s  3995616s  primary  fat16        boot&lt;br /&gt;&lt;br /&gt;(parted) q&lt;br /&gt;Information: You may need to update /etc/fstab.&lt;br /&gt;&lt;br /&gt;+ dd if=ipl_ms.bin of=/dev/sda bs=512 seek=16&lt;br /&gt;4+1 records in&lt;br /&gt;4+1 records out&lt;br /&gt;2288 bytes (2.3 kB) copied, 0.00179176 s, 1.3 MB/s&lt;br /&gt;+ mount /dev/sda1 tmp_mnt&lt;br /&gt;+ tar -C tmp_mnt -xvf ms.tar&lt;br /&gt;ISO/&lt;br /&gt;ISO/VIDEO/&lt;br /&gt;MEMSTICK.IND&lt;br /&gt;MP_ROOT/&lt;br /&gt;MP_ROOT/100MNV01/&lt;br /&gt;MP_ROOT/101ANV01/&lt;br /&gt;MSTK_PRO.IND&lt;br /&gt;MUSIC/&lt;br /&gt;PICTURE/&lt;br /&gt;PSP/&lt;br /&gt;PSP/GAME150/&lt;br /&gt;PSP/GAME5XX/&lt;br /&gt;PSP/GAME/&lt;br /&gt;PSP/SAVEDATA/&lt;br /&gt;PSP/COMMON/&lt;br /&gt;PSP/SYSTEM/&lt;br /&gt;PSP/THEME/&lt;br /&gt;PSP/RSSCH/&lt;br /&gt;PSP/RSSCH/IMPORT/&lt;br /&gt;VIDEO/&lt;br /&gt;seplugins/&lt;br /&gt;+ umount tmp_mnt&lt;br /&gt;+ sync&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-8190971154033925128?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/8190971154033925128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2010/08/formatting-psp-memory-stick-for-use.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8190971154033925128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8190971154033925128'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2010/08/formatting-psp-memory-stick-for-use.html' title='Formatting a PSP Memory Stick for use with a Pandora battery in Linux'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1048036485043568222</id><published>2010-08-09T12:01:00.019+01:00</published><updated>2010-08-31T10:41:34.859+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iSCSI'/><category scheme='http://www.blogger.com/atom/ns#' term='iBFT'/><category scheme='http://www.blogger.com/atom/ns#' term='TFTP'/><category scheme='http://www.blogger.com/atom/ns#' term='gPXE'/><category scheme='http://www.blogger.com/atom/ns#' term='sanboot'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><title type='text'>That darn iBFT iSCSI Windows installation error</title><content type='html'>If you ended up here, it's probably because you too tried to install Windows 7 or Vista on an iSCSI bootable disk using gPXE and, even though Windows setup could see your disk alright, you got one of the following errors:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"Windows cannot be installed to this disk. Setup does not support configuration of or installation to disks connected through a USB or IEEE 1394 port"&lt;/span&gt; (Vista)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"Windows cannot be installed to Disk &amp;lt;#&amp;gt; Partition &amp;lt;#&amp;gt;. (Show details)"&lt;/span&gt; -&gt; &lt;span style="font-style: italic;"&gt;"Windows cannot be installed to this disk. iSCSI deployment is disabled since no NICs referenced in the iBFT can be resolved to actual NT-visible devices. Windows cannot be installed to this disk. This computer's hardware may not support booting to this disk. Even if you're probably smart enough to know what you're doing, and we could definitely let you install to this disk to sort booting later, we're going to be asses about it and prevent you from overriding the idiotic setup decisions we made (by the way, did we mention the Windows recovery partition yet?). Why? Because we're Microsoft and screw you, that's why."&lt;/span&gt; (Windows 7)&lt;br /&gt;&lt;br /&gt;OK. Let's forget about Microsoft's stupid decisions for a while, and attempt to work within them,  to figure out how we can address the issue.&lt;br /&gt;&lt;br /&gt;Firs of all, if you see the message above, then I can guarantee that, no matter how properly you think you did setup your iSCSI PXE boot, you screwed up something and your iSCSI boot sequence is wrong.&lt;br /&gt;And yes, getting an iSCSI boot error on a blank disk is to be expected, but NO, not all the errors you see during gPXE iSCSI boot can be safely ignored (if you manage to see them at all, but we'll come to that). There's good error and there's bad error.&lt;br /&gt;&lt;br /&gt;The first thing I'll point out, if you're like me and thought you could get your dchp/tftp server to:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Supply the iSCSI disk boot parameter (that dhcp-option=net:gpxe,17,"iscsi:192.150.23.3::3260:2:sheeva:disk1" line or similar, along with the keep-san option)&lt;/li&gt;&lt;li&gt;Attempt to boot from it and&lt;/li&gt;&lt;li&gt;If that fails, fallback to executing WinPE/pxleinux to launch a WinPE installation image&lt;/li&gt;&lt;/ol&gt;is that such a scheme just won't work. Unless you're fiddling with the &lt;a href="http://www.etherboot.org/wiki/scripting"&gt;gPXE scripting options&lt;/a&gt; (and even then), you can only have either&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Boot from iSCSI then fail and hands things over back to BIOS, or,&lt;/li&gt;&lt;li&gt;If a boot image is specified, ignore the iSCSI options provided by the dhcp server altogether and just boot from that image.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;You can't just have the dhcp/tftp server alone tell gPXE: "try to boot to iSCSI and if that fails, boot from something else while keeping the iSCSI boot options", to boot WinPE for installation onto a blank iSCSI disk for instance. No siree. If you tried that, well, that was your first mistake. Not to say that this can't be achieved at all (we'll see how to do just that from the commandline below, and, in a next post, I'll try to show you how to do it automatically as well), but that can only be achieved &lt;span style="font-weight: bold;"&gt;outside&lt;/span&gt; of the dhcp/tftp options.&lt;br /&gt;&lt;br /&gt;In short, if you're using dnsmasq and with something like:&lt;pre class="brush: text"&gt;dhcp-match=gpxe,175   # tags the request with net:gpxe if gPXE was supplied&lt;br /&gt;dhcp-option=175,8:1:1 # turn on the keep-san option (allows installation)&lt;br /&gt;dhcp-option=net:gpxe,17,"iscsi:192.150.23.3::3260:2:sheeva:disk1"&lt;br /&gt;dhcp-boot=net:#gpxe,pxelinux.0       # if NOT (#) gPXE, use pxelinux.0&lt;br /&gt;dhcp-boot=net:gpxe,Boot/startrom.n12 # if gPXE, use WinPE&lt;/pre&gt;Then, when WinPE boots, it will not have any of the options that &lt;span style="font-weight: bold;"&gt;you think&lt;/span&gt; gPXE should have fed it with regards to the iSCSI boot disk. Especially, the "dhcp-option=net:gpxe,17," option will be completely ignored. Yeah, that makes as much sense to me to as anybody else, but that's how gPXE works for now.&lt;br /&gt;&lt;br /&gt;And that's also the reason why, in most of the guides you see, they'll tell you to first try to boot from an unbootable iSCSI disk with gPXE, let it fail and then use BIOS fallback to boot from an installation CD or DVD. Again, simply chaining WinPE in there from PXE does not work without additional effort that none of these guides provide.&lt;br /&gt;&lt;br /&gt;Also, &lt;span style="font-weight: bold;"&gt;and this is the most important part if you want Windows install to accept your iSCSI disk as bootable&lt;/span&gt;, as long as you do not see the following lines during boot:&lt;pre class="brush: text"&gt;Booting from root path "&amp;lt;your iSCSI path&amp;gt;"&lt;br /&gt;&lt;br /&gt;Registered as BIOS drive 0x80&lt;br /&gt;Booting from BIOS drive 0x80&lt;br /&gt;Boot failed&lt;br /&gt;Preserving connection to SAN disk&lt;/pre&gt;Then it's game over, plain and simple.&lt;br /&gt;&lt;br /&gt;Granted, those line may be hard to spot at during boot, when gPXE will hand things back over to the BIOS on failure (which it should do, if you followed what I said above), as those darn BIOS makers forgot that the Pause key we have on our keyboards could be put for some good use, but if you try a few times, and you don't see any mention of a BIOS drive 0x80, Windows will simply not see your iSCSI driver as bootable, simple as this.&lt;br /&gt;&lt;br /&gt;For your reference, here's a screenshot from a VMWare diskless machine that illustrates what you should see when gPXE executes:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://2.bp.blogspot.com/_WJDvGbjnsG8/TGAvn1PIQRI/AAAAAAAAAEg/QM__2Of4Zw0/s1600/iscsi_1.png" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;As long as you see the lines I highlighted above, after the iSCSI boot attempt, whatever error is thrown out will come from the iSCSI disk itself, rather than your boot process, so you can ignore it. But if you don't see the "Registered as BIOS drive" line from gPXE however, you should pay very close attention to the iSCSI error you get.&lt;br /&gt;&lt;br /&gt;So, of course, now your question is: "I'm not seeing these lines (or they're too fast for me to see). How then can I validate that my iSCSI target is good, and that it can be used for installation with gPXE?"&lt;br /&gt;&lt;br /&gt;Well, duh, through the &lt;a href="http://www.etherboot.org/wiki/commandline"&gt;gPXE commandline&lt;/a&gt; of course, which you can enter with Ctrl-B at boottime. Gotta wish proprietary PXE was as easy to troubleshoot for power users as gPXE is.   But you're in a hurry and don't want to learn about the whole gPXE/DHCP/TFTP internals, so I'll cut down to the chase. The sequence of command you are after:&lt;pre class="brush: text"&gt;dhcp net0&lt;br /&gt;set keep-san 1&lt;br /&gt;sanboot iscsi:&amp;lt;iscsi server ip&amp;gt;::&amp;lt;iscsi port&amp;gt;:&amp;lt;iscsi lun&amp;gt;:&amp;lt;iscsi target id&amp;gt;&lt;br /&gt;# and if the above line works and you want to boot to WinPE for instance, you could&lt;br /&gt;chain tftp://&amp;lt;server ip&amp;gt;/Boot/startrom.n12&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;dhcp net0&lt;/code&gt; initializes DHCP and allows you to communicate with the server (for tftp, etc)&lt;/li&gt;&lt;li&gt;then the &lt;code&gt;keep-san&lt;/code&gt; option is to ensure that Windows can see the iSCSI disk as bootable, which of course is the feature you're after&lt;/li&gt;&lt;li&gt;finally the &lt;code&gt;sanboot&lt;/code&gt; line is the one that will tell you if something is wrong with your iSCSI access.&lt;/li&gt;&lt;/ul&gt;But first, let's see an example of what happens when everything works as expected (for an uninitialized disk):&lt;br /&gt;&lt;br /&gt;&lt;img src="http://1.bp.blogspot.com/_WJDvGbjnsG8/TGAwGDm-AtI/AAAAAAAAAEo/H4ovClhUtZk/s1600/iscsi_2.png" /&gt;&lt;br /&gt;&lt;br /&gt;Here, we have the &lt;code&gt;Registered as BIOS drive&lt;/code&gt; and the &lt;code&gt;Preserving connection&lt;/code&gt; lines so we're good. You might also want to note that I am specifically specifying that I'm using port 3260 (default for iSCSI) and that my device is on LUN2 (very non default).&lt;br /&gt;&lt;br /&gt;Now, let's see some common errors:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://2.bp.blogspot.com/_WJDvGbjnsG8/TGAw5G6DlmI/AAAAAAAAAE4/jo6s0iJwA4I/s1600/iscsi_3.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;0x2c0d603b&lt;/span&gt; is usually an indication that your iSCSI path is wrong. In the case above, I used the non-existing disk0 instead of disk1 for the target part.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://4.bp.blogspot.com/_WJDvGbjnsG8/TGAxHGFd-6I/AAAAAAAAAFA/nu2K0-nGlxE/s1600/iscsi_4.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Ah,&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; 0x1d704039&lt;/span&gt; (and now, aren't you glad you found this page)...&lt;br /&gt;Yes, this is an error you &lt;span style="font-weight: bold;"&gt;should not&lt;/span&gt; get, even with a non bootable iSCSI disk. And yes, I agree, that an I/O error is precisely what you'd expect from a non-bootable disk, but actually, that I/O error is unrelated to the disk being bootable or not. On the other hand, it has very much to do with trying to use an iSCSI device that cannot be used as a disk, which, if you are using Linux tgtd/tgtadm is exactly what you're going to get if you're leaving the sequence of four columns as is (::::) because that means that LUN 0 will be used, and LUN 0 is reserved by tgtd for the virtual controller.&lt;br /&gt;In short, if you're using tgtd, your actual device LUNs start at 1, and if you're keeping the options part as '::::', then the default of LUN 0 will be used, so you're not actually accessing your disk!&lt;br /&gt;This is why I'm using &lt;code&gt;iscsi:192.150.23.3::3260:&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;2&lt;/span&gt;:sheeva:disk1&lt;/code&gt; in the line that works, because I'm trying to access the second disk I created on that specific target. Even if that was the very first disk I created with tgtadm, I would have to add 1 for the LUN in the line above, because the default of 0 is not a disk.&lt;br /&gt;&lt;br /&gt;Then, other errors you might get are &lt;span style="font-weight: bold;"&gt;0x0b8080a0&lt;/span&gt; (Operation cancelled) or &lt;span style="font-weight: bold;"&gt;0x2e852001&lt;/span&gt; (Exec Format Error), but these should occur after you get the "Registered as BIOS drive" line, so you should be able to safely ignore them. For other errors, google is your friend.&lt;br /&gt;&lt;br /&gt;So, to summarize, if Windows doesn't like your iSCSI boot device, it's probably because, despite what you think, gPXE didn't find anything it could use as a bootable disk, and to find out why, you should try to boot from it using the gPXE low level commands.&lt;br /&gt;&lt;br /&gt;In a next instalment, we'll see how we can create a nice iSCSI aware WinPE image, that we can launch from PXE, for all of our installation needs, and how we can solve the problem of automating WinPE fallback from a non bootable iSCSI disk, as well as how we can use pxelinux to boot from multiple iSCSI disk.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1048036485043568222?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1048036485043568222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2010/08/that-darn-ibft-iscsi-windows.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1048036485043568222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1048036485043568222'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2010/08/that-darn-ibft-iscsi-windows.html' title='That darn iBFT iSCSI Windows installation error'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_WJDvGbjnsG8/TGAvn1PIQRI/AAAAAAAAAEg/QM__2Of4Zw0/s72-c/iscsi_1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7789963263790595033</id><published>2010-06-25T15:31:00.006+01:00</published><updated>2010-06-25T16:02:18.238+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSH'/><category scheme='http://www.blogger.com/atom/ns#' term='sftp'/><category scheme='http://www.blogger.com/atom/ns#' term='chroot'/><title type='text'>chrooted ssh &amp; sftp on Slackware</title><content type='html'>Since the SheevaPlug makes a nice server for one to share files online securedly, while allowing you to see exactly who is accessing them, today's exercise is to setup sshd so that selected people can SFTP into it, while only seeing what you want them to see.&lt;br /&gt;&lt;br /&gt;Now, you'll find plenty of articles on how to do that, some of them &lt;a href="http://www.howtoforge.com/chroot_ssh_sftp_debian_etch"&gt;very well made&lt;/a&gt;, but what they won't tell is how to sort things out when stuff's not exactly working as it should be.&lt;br /&gt;&lt;br /&gt;First of all, this is what you want to have in your sshd_config:&lt;pre class="brush: text"&gt;# Use a non obvious port for outside connections.&lt;br /&gt;# You could also do port translation on your gateway or something&lt;br /&gt;# but, just so you see how it's done:&lt;br /&gt;Port 22&lt;br /&gt;Port 1234&lt;br /&gt;&lt;/pre&gt;Default options should be super limiting: no X11/TCP forwarding, no pasword auth, no root logon, etc) and then you use the very convenient Match tag to setup the allowed remote users, as well as the less restrictive options for your own network. Thus:&lt;pre class="brush: text"&gt;# only "remote_user" can logon from the outside network, in a chrooted env&lt;br /&gt;Match User remote_user&lt;br /&gt;     PasswordAuthentication yes&lt;br /&gt;     ChrootDirectory /home/chroot&lt;br /&gt;# connections from inside are OK&lt;br /&gt;Match Address 192.168.1.0/24&lt;br /&gt;     PasswordAuthentication yes&lt;br /&gt;     PermitRootLogin yes&lt;br /&gt;     AllowTCPForwarding yes&lt;br /&gt;     X11Forwarding yes&lt;br /&gt;&lt;/pre&gt;Then I'll assume that you pretty much follow the link I gave above to setup your /home/chroot directory and create the "remote_user" guy.&lt;br /&gt;&lt;br /&gt;First bad surprise:&lt;pre class="brush: text"&gt;"cannot run command `/bin/bash': No such file or directory"&lt;/pre&gt;WTF? But I did copy bash and the script took care of my libraries.&lt;br /&gt;Unfortunately, nope, the script did not take care of all the libs, and instead of reporting "library not found", the error message does not help.&lt;br /&gt;&lt;br /&gt;Now, if you go:&lt;pre class="brush: text"&gt;# ldd /bin/bash&lt;br /&gt;     libtermcap.so.2 =&gt; /lib/libtermcap.so.2 (0x4004b000)&lt;br /&gt;     libdl.so.2 =&gt; /lib/libdl.so.2 (0x40056000)&lt;br /&gt;     libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x40061000)&lt;br /&gt;     libc.so.6 =&gt; /lib/libc.so.6 (0x40075000)&lt;br /&gt;     /lib/ld-linux.so.3 (0x40000000)&lt;/pre&gt;and check your libraries again, you'll probably find that ld-linux.so.3 was not copied. If you do just that, you should find that you can logon to the chrooted environment at last. Yay!&lt;br /&gt;&lt;br /&gt;But then you want to add sftp. To do that, you *must* have the sftp-server and the lib dependencies in your chrooted environment as well.&lt;br /&gt;&lt;br /&gt;For Slackware, that means you need to create a /home/chroot/usr/libexec/sftp-server (if you don't know which sftp-server to pick, check the line "Subsystem sftp" in your sshd_config) and once again, copy all the library files (or use the script).&lt;br /&gt;&lt;br /&gt;But then, disaster strikes: whenever you try to logon with sftp, you get your connection closed. If you look at the sftp debug log, you'll see something like:&lt;pre class="brush: text"&gt;debug1: Sending subsystem: sftp&lt;br /&gt;debug2: channel 0: request subsystem confirm 1&lt;br /&gt;debug2: callback done&lt;br /&gt;debug2: channel 0: open confirm rwindow 0 rmax 32768&lt;br /&gt;debug2: channel 0: rcvd adjust 131072&lt;br /&gt;debug1: client_input_channel_req: channel 0 rtype exit-status reply 0&lt;br /&gt;debug2: channel 0: rcvd eof&lt;br /&gt;debug2: channel 0: output open -&gt; drain&lt;br /&gt;debug2: channel 0: obuf empty&lt;br /&gt;debug2: channel 0: close_write&lt;br /&gt;debug2: channel 0: output drain -&gt; closed&lt;br /&gt;debug2: channel 0: rcvd close&lt;br /&gt;debug2: channel 0: close_read&lt;br /&gt;debug2: channel 0: input open -&gt; closed&lt;br /&gt;debug3: channel 0: will not send data after close&lt;br /&gt;debug2: channel 0: almost dead&lt;br /&gt;debug2: channel 0: gc: notify user&lt;br /&gt;debug2: channel 0: gc: user detached&lt;br /&gt;debug2: channel 0: send close&lt;br /&gt;debug2: channel 0: is dead&lt;br /&gt;debug2: channel 0: garbage collecting&lt;br /&gt;debug1: channel 0: free: client-session, nchannels 1&lt;br /&gt;debug3: channel 0: status: The following connections are open:&lt;br /&gt;#0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cfd -1)&lt;br /&gt;&lt;br /&gt;debug3: channel 0: close_fds r -1 w -1 e 6 c -1&lt;br /&gt;debug1: fd 0 clearing O_NONBLOCK&lt;br /&gt;debug3: fd 1 is not O_NONBLOCK&lt;br /&gt;debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.3 seconds&lt;br /&gt;debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0&lt;br /&gt;debug1: Exit status 1&lt;br /&gt;Connection closed&lt;/pre&gt;Well, to cut a long story short, if you're seeing this, the problem is likely that you don't have rw permission on /dev/null (and possibly /dev/zero). Just make sure you issue a chmod 777 /home/chroot/dev/null and that should be the end of it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7789963263790595033?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7789963263790595033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2010/06/chrooted-ssh-sftp-on-slackware.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7789963263790595033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7789963263790595033'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2010/06/chrooted-ssh-sftp-on-slackware.html' title='chrooted ssh &amp; sftp on Slackware'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-8492432530947804302</id><published>2010-02-24T13:37:00.008Z</published><updated>2011-08-31T13:08:13.346+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='resync'/><category scheme='http://www.blogger.com/atom/ns#' term='RAID'/><category scheme='http://www.blogger.com/atom/ns#' term='SMART'/><title type='text'>Resync'ing a RAID 1 array</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;    &lt;p&gt;Can come handy when attempting to correct unreadable sectors on a RAID disk. Eg. if your RAID1 array is built around /dev/sda3 and /dev/sdb3 and you had unreadable sectors reported by SMART on /dev/sda (Current_Pending_Sector), but got no error during the SMART extended self test, you might want to resync the /dev/sda partitions on /dev/sdb as follows:&lt;/p&gt;    &lt;pre class="brush:text"&gt;mdadm --fail /dev/md2 /dev/sda3&lt;br/&gt;mdadm --remove /dev/md2&lt;br/&gt;/dev/sda3&lt;br/&gt;mdadm --add /dev/md2 /dev/sda3&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-8492432530947804302?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/8492432530947804302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2010/02/resync-raid-1-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8492432530947804302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8492432530947804302'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2010/02/resync-raid-1-array.html' title='Resync&amp;#39;ing a RAID 1 array'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-8956088072389138860</id><published>2009-12-31T12:54:00.002Z</published><updated>2009-12-31T13:00:47.355Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='ntp'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='interval'/><title type='text'>Changing the NTP update interval in Windows</title><content type='html'>Default is 604800 seconds (7 days), which is way way too long. On my machine, I'm getting clock skews of close to a minute as a result, and that's not acceptable when you're swapping files around for compilation for instance.&lt;br /&gt;&lt;br /&gt;To set this value to a more reasonable interval, you need to update the following key:&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpClient\SpecialPollInterval&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-8956088072389138860?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/8956088072389138860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/12/changing-ntp-update-interval-in-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8956088072389138860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8956088072389138860'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/12/changing-ntp-update-interval-in-windows.html' title='Changing the NTP update interval in Windows'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-2900382878881741580</id><published>2009-12-15T11:03:00.008Z</published><updated>2010-07-10T22:31:33.639+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DDK'/><category scheme='http://www.blogger.com/atom/ns#' term='WinDDK'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Windows 7, I hardly knew ye...</title><content type='html'>Blah, blah, blah, Windows 7 is great, blah, blah...&lt;br /&gt;&lt;br /&gt;Oh, you were actually expecting something in that range? Not on this blog I'm afraid.&lt;br /&gt;When Windows 7 consistently freezes within 4 hours of a fresh install (happened on Vista too, so I don't think it's a Win 7 issue only. Past that initial freeze the system is stable enough though), needs a full reinstall less than one month after it, and putting the computer to sleep or rebooting is akin to Russian roulette (will it boot again, or will just remain frozen forever and require, not only a hard reset, but a complete PSU unplug? - heck, I have a hackintosh OS-X working better than that on hardware that was never meant to be supported by Apple - go figure!)&lt;br /&gt;&lt;br /&gt;And now, &lt;span style="font-weight: bold;"&gt;once again&lt;/span&gt;, it's time for a clean Windows 7 reinstall, which means reinstalling all the apps, and having to do that every few months to keep the hardware in running order (because I actually DO something with my machine you know, like installing drivers by the truckload for development purposes - it's not just for internet and multimedia) is getting a bit old.&lt;br /&gt;&lt;br /&gt;Today's tip then is then is how to avoid reinstalling the WinDDK, when you still have the files (in  E:\WinDDK\7600.16385.0\ for instance) and all you are interested are the build environment shortcuts.&lt;br /&gt;Windows 7 x64 free build environment shortcut:&lt;br /&gt;&lt;pre class="brush:text"&gt;C:\Windows\System32\cmd.exe /k E:\WinDDK\7600.16385.0\bin\setenv.bat E:\WinDDK\7600.16385.0\ fre x64 WIN7 no_oacr&lt;/pre&gt;Same thing for x86:&lt;br /&gt;&lt;pre class="brush:text"&gt;C:\Windows\System32\cmd.exe /k E:\WinDDK\7600.16385.0\bin\setenv.bat E:\WinDDK\7600.16385.0\ fre x86 WIN7 no_oacr&lt;/pre&gt;And for reference,  setenv usage:&lt;br /&gt;&lt;pre class="brush: text"&gt;Usage: "setenv &lt;directory&gt; [fre|chk] [64|x64] [WIN7|WLH|WXP|WNET] [bscmake] [no_oacr] [separate_object_root]"&lt;/directory&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-2900382878881741580?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/2900382878881741580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/12/windows-7-i-hardly-knew-ye.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2900382878881741580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2900382878881741580'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/12/windows-7-i-hardly-knew-ye.html' title='Windows 7, I hardly knew ye...'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-9015188263941714867</id><published>2009-11-05T16:28:00.007Z</published><updated>2009-11-05T17:28:21.942Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='HDMI'/><category scheme='http://www.blogger.com/atom/ns#' term='HDMI-CEC'/><title type='text'>HDMI-CEC is SLOOOOOOOOOOOOOW!!!</title><content type='html'>Well, like many, I was convinced that HDMI-CEC was the wave of the future with regards to AV automation, until I actually read the specs of the thing (in "Supplement 1 Consumer Electronics Control (CEC)" of the &lt;a href="http://www.hdmi.org/download/HDMISpecification13a.pdf"&gt;HDMI Specifications version 1.3a&lt;/a&gt;).&lt;br /&gt;The interesting bits are to be found in "CEC 5 Signaling and Bit Timings" and "CEC 6 Frame Description", where, if you do the maths, you actually find out that the shortest time it takes to transfer a single 8 bit packet (start bit + 10 bit header + 10 bit packet) is 52.5 ms. And if you were to transfer 32 bits of data, you get close to 125 ms, or, in other words, no more than &lt;span style="font-weight: bold;"&gt;eight&lt;/span&gt; 32 bit data packets per second.&lt;br /&gt;Heck, I can mash a remote button faster than that!&lt;br /&gt;&lt;br /&gt;What this means really is that. no matter how cool HDMI-CEC might look, with a max data rate of only&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt; 41 bytes per second&lt;/span&gt;, future proof it ain't.&lt;br /&gt;Thinking of transferring a GUI menu content from one device to another using CEC? Won't happen.&lt;br /&gt;Thinking of transferring a reasonable amount of text in a short time? Huh-huh.&lt;br /&gt;&lt;br /&gt;For a format designed in 2002 to be more than 20 times slower than what has been the de-facto lowest speed for any form of serial data communication (9600 bauds) for more than 30 years now, you really got to be kidding us.&lt;br /&gt;And it's not like either the cable or devices connected can't support high transmission speed (it's HDMI - both the cable, and the devices it connects were &lt;span style="font-weight: bold;"&gt;designed&lt;/span&gt; for high speed!).&lt;br /&gt;&lt;br /&gt;So really there you have it. On one hand, a handful of transmission lines that can transfer at least half a Gigabyte of data per second, and in the same cable, a puny line that will barely transfer 1/1,000,000th of it, because of our regular corporate overlords' lack of vision (guys: if you're going to borrow what SCART has been doing for more than 2 decades, at least bring it up to speed).&lt;br /&gt;&lt;br /&gt;Oh the irony!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-9015188263941714867?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/9015188263941714867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/11/hdmi-cec-is-slooooooooooooow.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/9015188263941714867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/9015188263941714867'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/11/hdmi-cec-is-slooooooooooooow.html' title='HDMI-CEC is SLOOOOOOOOOOOOOW!!!'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-6532989509323183658</id><published>2009-10-29T13:08:00.014Z</published><updated>2009-10-30T02:48:05.823Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cairo'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual C++'/><title type='text'>Creating a Visual Studio 2008 application that uses Cairo</title><content type='html'>One day or another, you'll want to produce quick 2D data with your code for visualization, and after looking through hordes of libraries that do not satisfy your needs at all (listen, it's not that hard: I don't want graphing, I don't want 3D, and I certainly don't want proprietary closed source paying software! I just want something that gives me a simple canvas to draw elementary stuff like text fields or simple graphics using 2D coordinates), you'll settle down on &lt;a href="http://cairographics.org/"&gt;Cairo&lt;/a&gt; as the best trade-off for quick and easy &lt;span style="font-weight: bold;"&gt;generic&lt;/span&gt; 2D output. If it's used by Firefox for SVG output, it certainly should satisfy our needs.&lt;br /&gt;&lt;br /&gt;Unfortunately, or should I say, as usual, whenever you want a nice step by step tutorial on how to get you started with using Cairo on Windows, you'll get nothing but a handful of incomplete snippets here and there. This short step by step tutorial attempts to remedy that.&lt;br /&gt;&lt;br /&gt;For this exercise, we'll just create a C console application that outputs "Hello, World" to a PNG file using Cairo using Visual Studio 2008.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a new Win32 Console Application in Visual Studio. Let's call it cairo_test. And since we don't wanna get bogged down by Microsoft's crap on a simple hello world app, on Application Settings -&gt; Additional Options, make sure you check "Empty Project".&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create a new source file - let's call it main.c - and fill it with the following content (which I picked up from &lt;a href="http://www.nabble.com/Simple-Win32-GDI-example-with-Cairo-wanted-td19209699.html"&gt;here&lt;/a&gt;):&lt;pre class="brush:c"&gt;#define LIBCAIRO_EXPORTS&lt;br /&gt;&lt;br /&gt;#include &amp;lt;cairo/cairo.h&amp;gt;&lt;br /&gt;&lt;br /&gt;int main(int argc, char** argv)&lt;br /&gt;{&lt;br /&gt;cairo_surface_t *surface;&lt;br /&gt;cairo_t *cr;&lt;br /&gt;&lt;br /&gt;surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80);&lt;br /&gt;cr = cairo_create (surface);&lt;br /&gt;&lt;br /&gt;cairo_select_font_face (cr, "serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);&lt;br /&gt;cairo_set_font_size (cr, 32.0);&lt;br /&gt;cairo_set_source_rgb (cr, 0.0, 0.0, 1.0);&lt;br /&gt;cairo_move_to (cr, 10.0, 50.0);&lt;br /&gt;cairo_show_text (cr, "Hello, World");&lt;br /&gt;cairo_destroy (cr);&lt;br /&gt;cairo_surface_write_to_png (surface, "hello.png");&lt;br /&gt;cairo_surface_destroy (surface);&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;}&lt;/pre&gt;Don't worry about the "#include &amp;lt;cairo.h&amp;gt;" for now, we'll sort it out in a second&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Download the latest Cairo &lt;span style="font-weight: bold;"&gt;Dev&lt;/span&gt; package files for Windows from &lt;a href="http://www.gtk.org/download.html"&gt;http://www.gtk.org/download.html&lt;/a&gt; by picking up either Windows 32 or 64. At the time of this article, the latest Dev is cairo 1.8.8.&lt;br /&gt;Extract the package directories "lib" and "include" at the root of your Visual Studio project. You can safely ignore the other directories from the archive.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Change the Active configuration if needed and right click on your project in the Solution Explorer panel to access the properties page.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In Configuration Properties -&gt; C/C++ -&gt; Additional Include Directories, create a new entry and point it to "&amp;lt;your project root&amp;gt;\include". Be mindful that there is a cairo subdirectory there, which is why we used cairo/cairo.h in our source. Just make sure the source and your include paths match.&lt;/li&gt;&lt;li&gt;In  Configuration Properties -&gt; Linker -&gt; Input -&gt; Additional Dependencies, type "cairo.lib"&lt;/li&gt;&lt;li&gt;In  Configuration Properties -&gt; Linker -&gt; Gener al -&gt; Additional Library Directories, create a new entry and point it to the "&amp;lt;your project root&amp;gt;\lib" directory you extracted above. (Oh, and why oh why are the Additional Dependencies and Additional Library Directories on 2 different pages Microsoft?!? Where's the twisted UI logic behind that?)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Try to compile your project. It should complete  without errors. Note that if you picked up the Windows 64 libraries, you MUST create a new x64 configuration, or the process will fail with "fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'". Just follow &lt;a href="http://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/61666/reply/67674/"&gt;these guidelines&lt;/a&gt; if you don't know how to do that.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Bet you didn't wait and tried to run your executable already. And of course, you  got the DLL not found errors. Why of course, now you need to install the bunch of DLLs Cairo needs to be happy. Basically, what you should do is pick up the DLLs from ALL the binary packages below (still provided by the GTK+ &lt;a href="http://www.gtk.org/download-windows.html"&gt;Windows 32&lt;/a&gt; or &lt;a href="http://www.gtk.org/download-windows-64bit.html"&gt;Windows 64&lt;/a&gt; Project binaries) and extract them into the Release or Debug directory that contains your executable. For all of the archives, you j ust need to extract the DLL - all the other files are irrelevant:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;cairo &lt;span style="font-weight: bold;"&gt;Binaries&lt;/span&gt; (yes you need the binaries package too, as the Dev one doesn't contain the DLL) -&gt; libcairo-2.dll&lt;br /&gt;&lt;/li&gt;&lt;li&gt;zlib Binaries -&gt; zlib1.dll&lt;/li&gt;&lt;li&gt;libpng Binaries -&gt; libpng12-0.dll&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Freetype Binaries -&gt; freetype6.dll&lt;br /&gt;&lt;/li&gt;&lt;li&gt;FontConfig Binaries -&gt; libfontconfig-1.dll&lt;br /&gt;&lt;/li&gt;&lt;li&gt;expat Binaries -&gt; libexpat-1.dll&lt;/li&gt;&lt;/ul&gt;If you're gonna produce JPEG or TIFF images with your application, you probably want to install those DLLs too, but you already guessed that.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Now you can actually run your test program. It should produce an "hello.png" file that looks like the one below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_WJDvGbjnsG8/Sumi8tTBL_I/AAAAAAAAADw/4sWGhwwECeM/s1600-h/hello.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 240px; height: 80px;" src="http://3.bp.blogspot.com/_WJDvGbjnsG8/Sumi8tTBL_I/AAAAAAAAADw/4sWGhwwECeM/s400/hello.png" alt="" id="BLOGGER_PHOTO_ID_5398024792215465970" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;Alrighty then. Now you can get going and visualize the hell out of whatever ground-breaking application you've been thinking of!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-6532989509323183658?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/6532989509323183658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/creating-visual-studio-2008-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6532989509323183658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6532989509323183658'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/creating-visual-studio-2008-application.html' title='Creating a Visual Studio 2008 application that uses Cairo'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_WJDvGbjnsG8/Sumi8tTBL_I/AAAAAAAAADw/4sWGhwwECeM/s72-c/hello.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-2341202786216055914</id><published>2009-10-21T17:17:00.010+01:00</published><updated>2009-10-21T18:01:26.711+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='formatting'/><category scheme='http://www.blogger.com/atom/ns#' term='title'/><category scheme='http://www.blogger.com/atom/ns#' term='ckk'/><category scheme='http://www.blogger.com/atom/ns#' term='Drupal'/><category scheme='http://www.blogger.com/atom/ns#' term='leading zeroes'/><title type='text'>Formatting node titles in drupal</title><content type='html'>Bit disappointed in &lt;a href="http://drupal.org/"&gt;Drupal&lt;/a&gt;. Of course it's a  great tool (and it's GPL), but they probably won't be 'there' till version 8 at best with regards to full fledged &amp;amp; intuitive customization.&lt;br /&gt;Not that I really mind modifying the PHP code anyway, but I'd rather create actual content instead of doing that.&lt;br /&gt;&lt;br /&gt;So, of course you have installed the &lt;a href="http://drupal.org/project/cck"&gt;cck module&lt;/a&gt; to create fields, and it's oh so convenient (although customizing the field formatting can be a bit of a pain there too), but unfortunately, the title field for a node does not fall under the cck realm, and thus you don't have means of applying any of the default or custom formatters you might be using with cck. Bummer!&lt;br /&gt;&lt;br /&gt;Let's say you have created a new content type, with type  'my_ct' then (would be listed along with 'book', 'page', 'story'), and you are using a numeric title field (again, with no possibility of setting a content type for node titles and check input, Drupal is quite limited). Now you want to display your title in a custom format. Eg. if your node title value is '12', you want your displayed title to be "My_Content_000012", with leading zeroes.&lt;br /&gt;For that, assuming you are using the default garland theme of Drupal v.6, edit the file drupal/themes/garland/template.php and in "function phptemplate_preprocess_page(&amp;amp;$vars)" add the following:&lt;br /&gt;&lt;pre class="brush:php"&gt;  // Custom format for my_ct node titles&lt;br /&gt; if ($vars['node']-&gt;type == 'my_ct') {&lt;br /&gt;   $value = $vars['node']-&gt;title;&lt;br /&gt;   // Don't apply formatting unless numeric&lt;br /&gt;   if (!is_numeric($value))&lt;br /&gt;     $vars['title'] = $value;&lt;br /&gt;   else&lt;br /&gt;     $vars['title'] = sprintf("My_Content_%06d", $value);&lt;br /&gt; }&lt;/pre&gt;Now, if you want better customization or input validation for titles, you can probably get started on that with the &lt;a href="http://www.webscaped.com/articles/2009/03/custom-field-validation-in-drupal/"&gt;following article&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-2341202786216055914?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/2341202786216055914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/formatting-node-titles-in-drupal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2341202786216055914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2341202786216055914'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/formatting-node-titles-in-drupal.html' title='Formatting node titles in drupal'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1176092225111661809</id><published>2009-10-19T14:34:00.010+01:00</published><updated>2009-10-30T02:52:14.316Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='cdrecord'/><category scheme='http://www.blogger.com/atom/ns#' term='Nero'/><category scheme='http://www.blogger.com/atom/ns#' term='CUE Sheet'/><category scheme='http://www.blogger.com/atom/ns#' term='CDDA'/><title type='text'>Don't use Nero, period</title><content type='html'>Growing tired of Nero's inability to handle cue sheets (wanna make Nero crash? Just pick up a cue sheet here and there). This program has so many drawbacks, it's a wonder they still manage to sell it (yes, Ahead, it is normal in 2009 for a computer to become totally unusable for about 30 seconds whenever you insert a CD and Nero is running - background poll-wah?).&lt;br /&gt;&lt;br /&gt;The answer: use cdrecord and get back the time and coaster you'd have gotten with Nero.&lt;br /&gt;To burn a CDDA with text from a CUE sheet using cdrecord:&lt;br /&gt;&lt;pre class="brush:text"&gt;cdrecord dev=1,0,0 -eject - copy -v -text -useinfo -dao cuefile=&amp;lt;some file&amp;gt;.cue&lt;/pre&gt;Now, once I get a 64 bit, non cygwin1.dll dependent version of cdrecord in MinGW, I'll be a happy man.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1176092225111661809?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1176092225111661809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/dont-use-nero-period.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1176092225111661809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1176092225111661809'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/dont-use-nero-period.html' title='Don&apos;t use Nero, period'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-2277578661492725925</id><published>2009-10-15T15:51:00.003+01:00</published><updated>2009-10-15T16:05:08.464+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Shortcuts'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Task Manager'/><title type='text'>Task Manager Windows Shortcut</title><content type='html'>Found that one totally by accident (and yes, sometimes it doesn't hurt checking the &lt;a href="http://support.microsoft.com/kb/126449"&gt;official Microsoft documentation&lt;/a&gt;): &amp;lt;Ctrl&amp;gt; &amp;lt;Shift&amp;gt; &amp;lt;Esc&amp;gt; = bring up the Task Manager&lt;br /&gt;&lt;br /&gt;Now, give me a shortcut to bring up the Device Manager (well, you can go there in 2 steps, through &amp;lt;Windows &amp;lt;Pause/Break&amp;gt; (= System Information) -&gt; Device Manager, but still...&lt;br /&gt;&lt;br /&gt;Oh, and of course, you want to replace the default Task Manager with &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"&gt;Process Explorer&lt;/a&gt;, as the shortcut works for it too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-2277578661492725925?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/2277578661492725925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/task-manager-windows-shortcut.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2277578661492725925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2277578661492725925'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/task-manager-windows-shortcut.html' title='Task Manager Windows Shortcut'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-4162129116400831951</id><published>2009-10-13T13:58:00.008+01:00</published><updated>2009-10-15T02:57:47.968+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vista 64'/><category scheme='http://www.blogger.com/atom/ns#' term='libfti'/><category scheme='http://www.blogger.com/atom/ns#' term='openocd'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><category scheme='http://www.blogger.com/atom/ns#' term='libusb'/><category scheme='http://www.blogger.com/atom/ns#' term='64 bit'/><title type='text'>Compiling OpenOCD on Windows 64 systems</title><content type='html'>This time with libftdi/libusb - just &lt;a href="http://forum.sparkfun.com/viewtopic.php?t=17655"&gt;follow the leader&lt;/a&gt;. ;)&lt;br /&gt;&lt;br /&gt;Or, if you just want my latest (development) installable zip of OpenOCD for Windows 7 64 / Vista 64, try &lt;a href="http://nil.rpc1.org/files/sheeva/OpenOCD-Win64.zip"&gt;here&lt;/a&gt;. Just extract, follow the instructions, and you should have OpenOCD 0.3.0 running on Windows 64 bit in no time.&lt;br /&gt;&lt;br /&gt;Took a little while to get this stuff working, because of a very nasty libFTDI bug, as well as the usual hurdle of driver signing for Windows 64. I think the FSF should establish a free driver signing program for well established GPL projects, like OpenOCD, so that we get "Microsoft Approved" signed drivers. That would foil Redmond's obvious attempts to oust OpenSource from Vista 64 / Windows 7 64 (although they'd have to walk into the scheme and pay Microsoft/Verisign for the signing privilege).&lt;br /&gt;&lt;br /&gt;There's got to be a way to restore freedom back to the users of Windows OS!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-4162129116400831951?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/4162129116400831951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/compiling-openocd-on-windows-64-systems.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4162129116400831951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4162129116400831951'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/compiling-openocd-on-windows-64-systems.html' title='Compiling OpenOCD on Windows 64 systems'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7501878519626675319</id><published>2009-10-09T16:05:00.033+01:00</published><updated>2011-08-18T17:57:23.527+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sheevaplug'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='armedslack'/><category scheme='http://www.blogger.com/atom/ns#' term='Slackware'/><title type='text'>Installing Slackware on the SheevaPlug</title><content type='html'>And so, finally, we come to the final part of our series regarding the setting up of our SheevaPlug with Linux. Thanks to the good guys at &lt;a href="http://www.armedslack.org/"&gt;armedslack&lt;/a&gt;, we will have the best Linux distro ever, running on one of the coolest little devices around.&lt;br /&gt;&lt;br /&gt;For this setup, we will install Slackware on an 8 GB High speed SDIO MMC card, and leave the NAND flash untouched with its updated Ubuntu version. This will also suppose that you have a working kernel that supports ext4 and all the features you want already installed on the flash (if not, refer to &lt;a href="http://nil-techno.blogspot.com/2009/10/recompiling-new-kernel-for-sheevaplug.html"&gt;this post&lt;/a&gt; to to set it up). Now, we are going to deviate a little bit from the "official" armedslack intallation guide for the SheevaPlug, as we are not going to use TFTP for our packages but instead read them directly from an USB device.&lt;br /&gt;&lt;br /&gt;And so, without further ado:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download the packages from armedslack.org. The only directories you really need are the "slackware", "isolinux" and "kernels" directory from &lt;a href="ftp://ftp.armedslack.org/armedslack/armedslack-current/"&gt;ftp://ftp.armedslack.org/armedslack/armedslack-current/&lt;/a&gt;. If you're downloading from a Linux system, one way to do it, as advertised in the armedslack installation readme is: &lt;pre class="brush: text"&gt;rsync --exclude '*/source/*' --delete -Pavv ftp.armedslack.org::armedslack/armedslack-current .&lt;/pre&gt;(NB: If you use Filezilla to download from FTP, please note that it seems to default to ASCII mode instead of binary, so don't be surprised if your files are corrupted!)&lt;br /&gt;This amounts to about 2 GB of files, so it will take a while, but the filesystem used for the target shouldn't matter much, as long as it is accessible from the default armedslack kernel. So if you have a FAT formatted USB stick lying around, with more than 3 GB space available, you should probably use that.&lt;br /&gt;I also have to point out that we are downloading slackware-current, which contains an up-to-date version of the packages, but is different from a dot release, so you might see some versioning differences between current and what you get on the official x86 dot releases.&lt;br /&gt;For the remainder of this guide, I will assume that you have the directories (slackware/, isolinux/ and kernels/) in an "armedslack/" directory at the root of a FAT formatted USB device. Note that if you're not using a FAT formatted device, you will need to copy the kernel and initrd image on a separate device that can be read from U-boot&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Alright, time to reboot the system, with your USB and MMC card plugged in and enter the Marvell&amp;gt;&amp;gt; U-boot prompt through the serial console. There, you need to issue the following: &lt;pre class="brush: text"&gt;Marvell&amp;gt;&amp;gt; usb start&lt;br /&gt;(Re)start USB...&lt;br /&gt;USB:   scanning bus for devices... 2 USB Device(s) found&lt;br /&gt;scanning bus for storage devices... 1 Storage Device(s) found&lt;br /&gt;Marvell&amp;gt;&amp;gt; fatload usb 0 0x00800000 armedslack/kernels/kirkwood/uImage-kirkwood&lt;br /&gt;reading armedslack/kernels/kirkwood/uImage-kirkwood&lt;br /&gt;...&lt;br /&gt;................................................................................&lt;br /&gt;&lt;br /&gt;1887248 bytes read&lt;br /&gt;Marvell&amp;gt;&amp;gt; fatload usb 0 0x01100000 armedslack/isolinux/uinitrd-kirkwood.img&lt;br /&gt;reading armedslack/isolinux/uinitrd-kirkwood.img&lt;br /&gt;...&lt;br /&gt;................................................................................&lt;br /&gt;&lt;br /&gt;10985095 bytes read&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs console=ttyS0,115200 nodhcp kbd=uk root=/dev/ram rw;bootm 0x00800000 0x01100000&lt;/pre&gt;If all is well, you should be seeing your usual Slackware installation screen.&lt;br /&gt;Please note that because of the "kbd=uk" line above, your keyboard will be automatically set to uk, so change it accordingly.&lt;br /&gt;Also, if you want to use a network session rather than the serial console, you should issue:&lt;pre class="brush: text"&gt;dhcpcd eth0&lt;br /&gt;/etc/rc.d/rc.dropbear start&lt;/pre&gt;Then you can find your IP address through ifconfig and ssh to it.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If needed, you should use fdisk to partition your MMC device: &lt;pre class="brush: text"&gt;fdisk /dev/mmcblk0&lt;/pre&gt; On my system, I created a 512MB /dev/mmcblk0p1 partition for Swap (type 0x82) and left the rest as /dev/mmcblk0p2 for Linux (type 0x83)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you had a look at &lt;code&gt;dmesg&lt;/code&gt;, you should see that your USB device has been detected by the kernel (normally as &lt;code&gt;/dev/sda&lt;/code&gt;). Since we have our Slackware package on that device, this is what we are going to use for the source. I have found out however that:&lt;br /&gt;- If you attempt to mount the directory manually and chose the &lt;code&gt;Install from a pre-mounted directory&lt;/code&gt; option in &lt;code&gt;SOURCE MEDIA SELECTION&lt;/code&gt;, &lt;b&gt;MAKE SURE&lt;/b&gt; that your path ends with the &lt;code&gt;slackware/&lt;/code&gt; directory where the &lt;code&gt;a/&lt;/code&gt;, &lt;code&gt;ap/&lt;/code&gt;, &lt;code&gt;d/&lt;/code&gt;... packages reside and &lt;b&gt;NOT&lt;/b&gt; the one where &lt;code&gt;extra/&lt;/code&gt;, &lt;code&gt;isolinux/&lt;/code&gt;, &lt;code&gt;kernels/&lt;/code&gt;... reside. If you don't, setup will happily list the packages but fail to install them and produce a completely irrelevant error!&lt;br /&gt;- If you select "Install from a hard drive partition" but haven't previously mounted the partition, it will fail to mount the directory properly.&lt;br /&gt;For now, we will use the "Install from a hard drive partition" option, but we first need to mount that partition manually.&lt;br /&gt;And remember that the Slackware setup process uses /mnt for its own purpose, so you should not use that location as a mountpoint. So:&lt;pre class="brush: text"&gt;mkdir /usb&lt;br /&gt;mount /dev/sda1 /usb&lt;br /&gt;echo "mmc0" &amp;gt; /sys/class/leds/plug\:green\:health/trigger&lt;br /&gt;setup&lt;/pre&gt;The "echo mmc0" line in there is a trick to get the blue LED act as an MMC card access indicator, as, if you're like me, you want to see some indication of r/w access to your root device.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Setup should be smart enough to detect your Swap &amp;amp; Linux mmc partitions, and format them (the default ext4 is a good choice for a filesystem). With regards to the SOURCE MEDIA SELECTION screen, you should now select "2  Install from a hard drive partition" then enter "/dev/sda1" as the device and "/armedslack" as the path (or whatever you called your directory on the USB). If you did mount your partition beforehand, this will work and you will then be able to select the packages straight off the USB.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;From there, it's your run-of-the-mill package selection and installation. On my 8 GB SD Card, I found that selecting everything but GNU Emacs, TeX, KDEI and the Kernel sources resulted in a 3.7 GB installation, thus leaving  about 2.9 GB free space, which is fine. Of course, if you want more space, you can fine tune your package selection or use a bigger SD card.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;After you've gone through the rest of the configuration (network, etc) you can reboot the system and get back to the Marvell&amp;gt;&amp;gt; U-Boot prompt. There we will want to test that the custom kernel we've been using to boot Ubuntu can also boot our Slackware installation. Again, this supposes that you followed the steps from my earlier post regarding custom kernel installation and flashing. If not, now is probably a good time to follow &lt;a href="http://nil-techno.blogspot.com/2009/10/flashing-new-kernel-on-sheevaplug.html"&gt;this post&lt;/a&gt; to to flash the uImage-kirkwood kernel that you used for setup.&lt;br /&gt;&lt;br /&gt;To test that your current NAND kernel can boot Slackware:&lt;pre class="brush: text"&gt;# Preliminary check to see if your bootargs_console variable is&lt;br /&gt;# properly defined. if not, make sure you set it up&lt;br /&gt;Marvell&amp;gt;&amp;gt; printenv bootargs_console&lt;br /&gt;bootargs_console=console=ttyS0,115200&lt;br /&gt;# This defines our root device. Make sure that use the right device, and that you mount it "ro"&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs_root root=/dev/mmcblk0p2 rootfs=ext4 ro&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs $(bootargs_console) $(bootargs_root)&lt;br /&gt;Marvell&amp;gt;&amp;gt; printenv bootcmd&lt;br /&gt;bootcmd=nand read.e 0x800000 0x100000 0x400000; bootm 0x800000&lt;br /&gt;# Your bootcmd should only read the kernel and boot from it.&lt;br /&gt;# If not, just issue the 2 commands above instead of what follows&lt;br /&gt;Marvell&amp;gt;&amp;gt; run bootcmd&lt;/pre&gt;You should then be able to boot into your newly installed Slackware Linux. If not, you might want to check your parameters and  install &amp;amp; flash a kernel that works.&lt;br /&gt;Now, while we have confirmed that your system can indeed boot, we haven't yet saved anything on the flash to make it the default, so you need to reboot into the Marvell prompt once more, and this time:&lt;pre class="brush: text"&gt;# First, we start by saving the current working bootargs so that if you ever want&lt;br /&gt;# to get back to Ubuntu, you can issue a "setenv bootargs $(bootargs_rescue)"&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs_rescue $(bootargs)&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs_root root=/dev/mmcblk0p2 rootfs=ext4 rootwait ro&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs $(bootargs_console) $(bootargs_root)&lt;br /&gt;Marvell&amp;gt;&amp;gt; saveenv&lt;br /&gt;Saving Environment to NAND...&lt;br /&gt;Erasing Nand...Writing to Nand... done&lt;br /&gt;Marvell&amp;gt;&amp;gt; reset&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;After this last command, the plug should automatically boot into Slackware and you can finalize your installation.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;IMPORTANT&lt;/span&gt;: You VERY MUCH want to add a rootwait parameter to your bootargs, which ensures that the SD is ready before the kernel attempts to mount it as rootfs. Otherwise, you may end up with maddening kernel panics when mounting rootfs, especially after a power failure, that are really due to the SD card not being ready yet.&lt;br /&gt;Another alternative would be to add rootdelay=## but if you read &lt;a href="http://kerneltrap.org/mailarchive/openmoko-kernel/2009/7/19/6229023/thread"&gt;here&lt;/a&gt;, you'll see that rootwait is the smarter option.&lt;br /&gt;&lt;br /&gt;One thing you might want to do, as we did during the install, is set the blue LED as an MMC access indicator.&lt;br /&gt;On my system, I did that by editing /etc/rc.d/rc.S and adding the line:&lt;pre class="brush: text"&gt;# Set the blue LED as SD access indicator&lt;br /&gt;echo "mmc0" &amp;gt; /sys/class/leds/plug\:green\:health/trigger&lt;/pre&gt;just before the section&lt;br /&gt;&lt;pre class="brush: text"&gt;# Enable swapping:&lt;br /&gt;/sbin/swapon -a&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7501878519626675319?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7501878519626675319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/installing-slackware-on-sheevaplug.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7501878519626675319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7501878519626675319'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/installing-slackware-on-sheevaplug.html' title='Installing Slackware on the SheevaPlug'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-6025517433924375680</id><published>2009-10-09T13:08:00.015+01:00</published><updated>2010-08-11T20:56:21.251+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iSCSI'/><category scheme='http://www.blogger.com/atom/ns#' term='VISTA'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='target'/><category scheme='http://www.blogger.com/atom/ns#' term='SheevPlug'/><title type='text'>Using the SheevaPlug as an iSCSI target for Vista or Windows 7</title><content type='html'>(Updated 2010.08.08)&lt;br /&gt;&lt;br /&gt;Well, since I played with this iScsi stuff just for the sake of it, I might as well post a quick guide.&lt;br /&gt;&lt;br /&gt;For this setup, I will be using the SheevaPlug running Slackware 13.0 (armedslack) on an SDIO card, a 100 GB HDD connected to the plug through USB (/dev/sda, but you could use a partition or even an image file) and a version of Windows that supports iSCSI (Vista or later). The SheevaPlug server has been creatively named "sheeva".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Compiling&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The de-facto iSCSI target server tool for Linux is the &lt;a href="http://stgt.sourceforge.net/"&gt;Linux SCSI target framework (tgt) project&lt;/a&gt; (NB: you know you need to come up with better designation when your URL is actually shorter than your project name), so off we go and download &lt;a href="http://stgt.sourceforge.net/releases/"&gt;the latest version&lt;/a&gt; (Important note: at the time of this post update, version 1.0.7 doesn't appear to work for the SheevaPlug, but 1.0.5 does).&lt;br /&gt;We're pretty much going to follow the "./doc/&lt;a href="http://git.kernel.org/?p=linux/kernel/git/tomo/tgt.git;a=blob;f=doc/README.iscsi"&gt;README.iscsi&lt;/a&gt;" from the archive, so you might want to keep that file open for reference.&lt;br /&gt;Once extracted on the SheevaPlug, cd to the usr/ directory and issue a "make ISCSI=1; make install". This package is not that big, so we can compile it on the Plug directly. Remember to add ISCSI=1, as default make will not have iSCSI.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Starting the target server daemon&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After that, as root, you need to launch the daemon with&lt;pre class="brush:text"&gt;tgtd&lt;/pre&gt;The syslog should tell you that everything's rolling with a line like&lt;pre class="brush: text"&gt;Oct  9 12:46:23 sheeva tgtd: Target daemon logger with pid=1897 started!&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Setting up the iSCSI target&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is where the bulk of our configuration occurs. What we're going to set below is an iSCSI drive named "sheeva:hd100" that maps to our /dev/sda HDD.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;First we need to create that device:&lt;br /&gt;&lt;pre class="brush:text"&gt;root@sheeva:~# tgtadm --lld iscsi --mode target --op new --tid 1 --target sheeva:hd100&lt;br /&gt;root@sheeva:~# tgtadm --lld iscsi --mode target --op show&lt;br /&gt;Target 1: sheeva:hd100&lt;br /&gt;System information:&lt;br /&gt;Driver: iscsi&lt;br /&gt;State: ready&lt;br /&gt;I_T nexus information:&lt;br /&gt;LUN information:&lt;br /&gt;LUN: 0&lt;br /&gt;    Type: controller&lt;br /&gt;    SCSI ID: IET     00010000&lt;br /&gt;    SCSI SN: beaf10&lt;br /&gt;    Size: 0 MB&lt;br /&gt;    Online: Yes&lt;br /&gt;    Removable media: No&lt;br /&gt;    Backing store type: rdwr&lt;br /&gt;    Backing store path: None&lt;br /&gt;Account information:&lt;br /&gt;ACL information:&lt;br /&gt;root@sheeva:~#&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Now, despite the fact that a device with LUN0 was created as shown above, this is just a virtual controller device, not a physical target, and we still need to create a LUN for our device: &lt;pre class="brush:text"&gt;root@sheeva:~# tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 --backing-store /dev/sda&lt;br /&gt;root@sheeva:~# tgtadm --lld iscsi --mode target --op show&lt;br /&gt;Target 1: sheeva:hd100&lt;br /&gt;System information:&lt;br /&gt;Driver: iscsi&lt;br /&gt;State: ready&lt;br /&gt;I_T nexus information:&lt;br /&gt;LUN information:&lt;br /&gt;LUN: 0&lt;br /&gt;    Type: controller&lt;br /&gt;    SCSI ID: IET     00010000&lt;br /&gt;    SCSI SN: beaf10&lt;br /&gt;    Size: 0 MB&lt;br /&gt;    Online: Yes&lt;br /&gt;    Removable media: No&lt;br /&gt;    Backing store type: rdwr&lt;br /&gt;    Backing store path: None&lt;br /&gt;LUN: 1&lt;br /&gt;    Type: disk&lt;br /&gt;    SCSI ID: IET     00010001&lt;br /&gt;    SCSI SN: beaf11&lt;br /&gt;    Size: 100030 MB&lt;br /&gt;    Online: Yes&lt;br /&gt;    Removable media: No&lt;br /&gt;    Backing store type: rdwr&lt;br /&gt;    Backing store path: /dev/sda&lt;br /&gt;Account information:&lt;br /&gt;ACL information:&lt;br /&gt;root@sheeva:~#&lt;/pre&gt;This time, we have our physical device listed. Note that you could also mount a partition instead of a whole device, and make it appear as a device through iSCSI&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;At this stage, we have a target, but it doesn't accept inbound connections ("ACL information" is empty), so:&lt;pre class="brush:text"&gt;root@sheeva:~# tgtadm --lld iscsi --mode target --op bind --tid 1 --initiator-address ALL&lt;br /&gt;root@sheeva:~# tgtadm --lld iscsi --mode target --op show&lt;br /&gt;Target 1: sheeva:hd100&lt;br /&gt;System information:&lt;br /&gt;Driver: iscsi&lt;br /&gt;State: ready&lt;br /&gt;I_T nexus information:&lt;br /&gt;LUN information:&lt;br /&gt;LUN: 0&lt;br /&gt;    Type: controller&lt;br /&gt;    SCSI ID: IET     00010000&lt;br /&gt;    SCSI SN: beaf10&lt;br /&gt;    Size: 0 MB&lt;br /&gt;    Online: Yes&lt;br /&gt;    Removable media: No&lt;br /&gt;    Backing store type: rdwr&lt;br /&gt;    Backing store path: None&lt;br /&gt;LUN: 1&lt;br /&gt;    Type: disk&lt;br /&gt;    SCSI ID: IET     00010001&lt;br /&gt;    SCSI SN: beaf11&lt;br /&gt;    Size: 100030 MB&lt;br /&gt;    Online: Yes&lt;br /&gt;    Removable media: No&lt;br /&gt;    Backing store type: rdwr&lt;br /&gt;    Backing store path: /dev/sda&lt;br /&gt;Account information:&lt;br /&gt;ACL information:&lt;br /&gt;ALL&lt;br /&gt;root@sheeva:~#&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Here you might want to find out if Windows is able to see our target, so you can fire up the iSCSI Initiator (in Control Panel -&gt; Administrative Tools). If you are prompted to enable the iSCSI service on startup and modify the firewall rules, accept it.&lt;br /&gt;Now, if you go to the "Targets" tab and press Refresh, you'll probably see that your target is not yet detected.&lt;br /&gt;To make it appear in the target list, you want to go to the "Discovery" tab and click "Add/Discover Portal". Then provide the IP/DNS of your server. Port 3260 should be fine as it's used by the Target daemon on the Linux server.&lt;br /&gt;After doing this, if you go to the "Targets" tab again, you should see something like this listed:&lt;pre class="brush:text"&gt;sheeva:hd100              Inactive&lt;/pre&gt;If not, you might want to check your daemon, firewall, etc. as you should be able to detect the target at this stage.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you're fine with anybody being able to  connect to our iSCSI target on your network, then you can just try to press "Log On" in  the Targets tab, and you should be able to connect. You can then go to Computer Management, and you should be able to see the disk!&lt;br /&gt;You should also see who is connect to your target in the "I_T nexus information" section from tgtadm in Linux:&lt;pre class="brush:text"&gt;root@sheeva:~# tgtadm --lld iscsi --mode target --op show&lt;br /&gt;Target 1: sheeva:hd100&lt;br /&gt;System information:&lt;br /&gt;Driver: iscsi&lt;br /&gt;State: ready&lt;br /&gt;I_T nexus information:&lt;br /&gt;I_T nexus: 4&lt;br /&gt;    Initiator: iqn.1991-05.com.microsoft:dusk&lt;br /&gt;    Connection: 1&lt;br /&gt;        IP Address: 192.168.1.184&lt;br /&gt;LUN information:&lt;br /&gt;LUN: 0&lt;br /&gt;    Type: controller&lt;br /&gt;    SCSI ID: IET     00010000&lt;br /&gt;    SCSI SN: beaf10&lt;br /&gt;    Size: 0 MB&lt;br /&gt;    Online: Yes&lt;br /&gt;    Removable media: No&lt;br /&gt;    Backing store type: rdwr&lt;br /&gt;    Backing store path: None&lt;br /&gt;LUN: 1&lt;br /&gt;    Type: disk&lt;br /&gt;    SCSI ID: IET     00010001&lt;br /&gt;    SCSI SN: beaf11&lt;br /&gt;    Size: 100030 MB&lt;br /&gt;    Online: Yes&lt;br /&gt;    Removable media: No&lt;br /&gt;    Backing store type: rdwr&lt;br /&gt;    Backing store path: /dev/sda&lt;br /&gt;Account information:&lt;br /&gt;ACL information:&lt;br /&gt;ALL&lt;br /&gt;root@sheeva:~#&lt;/pre&gt;Pretty cool, heh?&lt;br /&gt;If you do want to restrict access, you should of course follow the README.iscsi and add iSCSI target accounts. Then you can provide these credentials to the CHAP logon parameters in Windows (which can be accessed by clicking "Advanced" in the "Log On to Target" dialog. Be warned however that Windows will return a "CHAP secret given does not conform to the standard" error if your password is too short, so you need to make it at least 10 characters or more.&lt;br /&gt;To disconnect from a target, on Vista, simply click on "Details", select its Identifier and click "Log off...". For Windows 7, Microsoft did the wise thing and added a "Disconnect" button.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;IMPORTANT NOTE:&lt;/span&gt; Because we used LUN 1, and not LUN 0, if you attempt to boot from this newly created iSCSI disk, you MUST fill in the LUN parameter in the iSCSI root path syntax (the sequence of 4 columns that most guides will leave blank). In our case, if we wanted to use the device above for booting with gpxe/dnsmasq, we would add the following in dnsmasq.conf:&lt;pre class="brush:text"&gt;dhcp-option=net:gpxe,17,"iscsi:192.168.1.3:::1:sheeva:hd1"&lt;/pre&gt;Notice that there is a "1" for the LUN before "sheeva:hd1" and that we used :::&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;: instead of ::::. Likewise if you use a nonstandard port (different than 3260), you would use something like ::&amp;lt;custom port&amp;gt;:&amp;lt;LUN&amp;gt;:&amp;lt;target name&amp;gt;. This is detailed in RFC 4173, or you can find more information &lt;a href="http://www.etherboot.org/wiki/sanboot/iscsi_boot"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-6025517433924375680?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/6025517433924375680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/using-sheevaplug-as-iscsi-target-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6025517433924375680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6025517433924375680'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/using-sheevaplug-as-iscsi-target-for.html' title='Using the SheevaPlug as an iSCSI target for Vista or Windows 7'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-484223376349883409</id><published>2009-10-07T19:09:00.005+01:00</published><updated>2009-10-09T11:23:21.154+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='badblocks'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='corruption'/><category scheme='http://www.blogger.com/atom/ns#' term='USB'/><category scheme='http://www.blogger.com/atom/ns#' term='test'/><title type='text'>Checking removable media for badblocks on Linux</title><content type='html'>This comes handy when you are flashing firmwares from USB and don't want to take any risk with data corruptions (most firmwares images have checksums or CRCs, but who knows...)&lt;br /&gt;&lt;br /&gt;Linux provides a badblock command to do just that. Obviously, this is a &lt;span style="font-weight: bold;"&gt;DESTRUCTIVE &lt;/span&gt;test (all data on your media will be erased without warning), and you'll need to reformat your media afterwards. Oh, and of course the badblocks command is available on the SheevaPlug.&lt;br /&gt;&lt;pre class="brush: text"&gt;badblocks -t random -svw &amp;lt;your_device&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-484223376349883409?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/484223376349883409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/checking-usb-stick-for-badblocks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/484223376349883409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/484223376349883409'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/checking-usb-stick-for-badblocks.html' title='Checking removable media for badblocks on Linux'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-39494509882462124</id><published>2009-10-07T11:04:00.008+01:00</published><updated>2009-10-07T20:13:28.256+01:00</updated><title type='text'>Flashing a new kernel on the SheevaPlug</title><content type='html'>This is the last piece of the puzzle with regards to our using a customized Ubuntu on the internal Flash. After that, we'll switch to using ArmedSlack on the MMC (but we'll keep that rescue Ubuntu image on the internal Flash).&lt;br /&gt;Because we've pretty much done that before, flashing the new kernel is very straightforward, so I'm going to comment a little bit about the U-Boot commands we use.&lt;br /&gt;&lt;br /&gt;As you'd expect, the "fatload usb 0 0x00800000 uImage" just takes the uImage file from the USB and loads it in RAM @ address 0x00800000, and it's this RAM image that we are going to flash. Because of the &lt;pre&gt;mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)&lt;/pre&gt; option we pass to our U-Boot boot command (see what the command "printenv bootargs" reports in the Marvell&amp;gt;&amp;gt; prompt, or refer to the setenv we did &lt;a href="http://nil-techno.blogspot.com/2009/10/upgrading-factory-sheevaplug-nand-to.html"&gt;previously&lt;/a&gt;), U-Boot expects the kernel uImage to be 0x400000 bytes in length (that's 4 MB) starting at address 0x100000 on the NAND Flash. Therefore, we will need to write the 4MB from our RAM containing the loaded uImage to 0x100000 on the Flash.&lt;br /&gt;But before we can write the Flash we need to erase it.&lt;br /&gt;Oh, and don't worry about our kernel image not being exactly 4 MB in length. As long as its size is less that 4 MB, you'll be fine.&lt;br /&gt;If it's more though, then you will need to move the rootfs starting at 0x100000 + 4MB = 0x500000, and change your bootargs parameters accordingly.&lt;br /&gt;&lt;br /&gt;All in all, to replace the existing kernel with a new &lt;pre class="brush: text"&gt;Marvell&amp;gt;&amp;gt; usb start&lt;br /&gt;(Re)start USB...&lt;br /&gt;USB:   scanning bus for devices... 2 USB Device(s) found&lt;br /&gt;   scanning bus for storage devices... 1 Storage Device(s) found&lt;br /&gt;Marvell&amp;gt;&amp;gt; fatload usb 0 0x00800000 uImage&lt;br /&gt;reading uImage&lt;br /&gt;...................................................................................................................................................................................................................................................................................................................&lt;br /&gt;&lt;br /&gt;3152056 bytes read&lt;br /&gt;Marvell&amp;gt;&amp;gt; nand erase clean 0x00100000 0x00400000&lt;br /&gt;&lt;br /&gt;NAND erase: device 0 offset 0x100000, size 0x400000&lt;br /&gt;Erasing at 0x4e0000 -- 100% complete. Cleanmarker written at 0x4e0000.&lt;br /&gt;OK&lt;br /&gt;Marvell&amp;gt;&amp;gt; nand write.e 0x00800000 0x00100000 0x00400000&lt;br /&gt;&lt;br /&gt;NAND write: device 0 offset 0x100000, size 0x400000&lt;br /&gt;&lt;br /&gt;Writing data at 0x4ff800 -- 100% complete.&lt;br /&gt;4194304 bytes written: OK&lt;br /&gt;Marvell&amp;gt;&amp;gt; reset&lt;/pre&gt;&lt;br /&gt;The bootup sequence shouldn't be that much different from the one you got when testing the new kernel in RAM&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-39494509882462124?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/39494509882462124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/flashing-new-kernel-on-sheevaplug.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/39494509882462124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/39494509882462124'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/flashing-new-kernel-on-sheevaplug.html' title='Flashing a new kernel on the SheevaPlug'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5846335525716037811</id><published>2009-10-06T21:29:00.010+01:00</published><updated>2009-10-07T00:40:48.188+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LED'/><category scheme='http://www.blogger.com/atom/ns#' term='Sheevaplug'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Using the blue LED on the SheevaPlug</title><content type='html'>As mentioned &lt;a href="http://plugcomputer.org/plugforum/index.php?topic=795.msg4934#msg4934"&gt;here&lt;/a&gt;, it is possible to control the blue LED on the Plug and use it for notification.&lt;br /&gt;The LED itself is accessible as /sys/class/leds/plug\:green\:health, and as mentioned in the &lt;a href="http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/LEDs"&gt;Linux LED Documentation&lt;/a&gt;, it is possible to find out the available LED functions (triggers) through:&lt;br /&gt;&lt;pre class="brush: text"&gt;~# cat /sys/class/leds/plug\:green\:health/trigger&lt;br /&gt;none nand-disk mmc0 timer heartbeat [default-on]&lt;/pre&gt;Thus, if you want a heartbeat effect, you would issue the command:&lt;br /&gt;&lt;pre class="brush: text"&gt;echo "heartbeat" &gt; /sys/class/leds/plug\:green\:health/trigger&lt;/pre&gt;Now, on the more useful side,  with a default Linux image running on the NAND flash, you might want to enable "nand-disk" to monitor said flash activity. Please be aware however that the LED behaviour in this case is quite different from your run-of-the-mill HDD access activity (which is a good thing - the less actual access to the NAND, the less wear and tear). In short, &lt;a href="http://www.linux-mtd.infradead.org/doc/ubifs.html"&gt;UBIFS&lt;/a&gt; does its job and reduces NAND accesses to the bare minimum, which in turn results in little NAND activity actually  going on. A couple of well placed "sync" should suffice to convince you that "nand-disk" works as expected though.&lt;br /&gt;&lt;br /&gt;If you're using the default Ubuntu running on the NAND Flash, you probably want to add the following to your /etc/rc.local then:&lt;br /&gt;&lt;pre class="brush: text"&gt;echo "nand-disk" &gt; /sys/class/leds/plug\:green\:health/trigger&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5846335525716037811?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5846335525716037811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/accessing-blue-led-on-sheevaplug.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5846335525716037811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5846335525716037811'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/accessing-blue-led-on-sheevaplug.html' title='Using the blue LED on the SheevaPlug'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1301235965746866921</id><published>2009-10-06T10:54:00.033+01:00</published><updated>2010-08-13T12:52:56.908+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='crosstool-ng'/><category scheme='http://www.blogger.com/atom/ns#' term='Sheevaplug'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='kernel'/><category scheme='http://www.blogger.com/atom/ns#' term='cross-compiling'/><category scheme='http://www.blogger.com/atom/ns#' term='x86_64'/><title type='text'>Recompiling a new kernel for the SheevaPlug</title><content type='html'>There are many reasons why you would want to use a custom kernel on the plug. As far as I am concerned, the lack of ext4 and ntfs support in the kernel provided with the otherwise excellent  SheevaPlug installer 1.0 system make a clear case for a custom kernel. After all, you might wanna mount external HDDs that are NTFS formatted, or, more important, you might want to install/access a Linux system running with ext4 (which I hear is nicer on flash based media devices than ext3), as we will do when we install &lt;a href="http://www.armedslack.org/"&gt;armedslack&lt;/a&gt;  on an SDIO card.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Setting up a cross-compiler for the SheevaPlug on Linux x86_64&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While it is definitely possible to recompile a kernel on the SheevaPlug itself, let us just consider the raw compilation times observed when compiling a 2.6.31.2 kernel (exact same .config) on the Sheeva and on a more up to date PC:&lt;br /&gt;-  Quad Core PC (Slackware 13.0 x86_64 w/ ext4 fs on a RAID5 array) - 3:03 mins (183 secs)&lt;br /&gt;- SheevaPlug (Ubuntu 9.04 w/ ext4 fs on a high speed SDIO card) - 57:42 mins (3462 secs)&lt;br /&gt;&lt;br /&gt;That's one full order of magnitude right there (or about 20x slower)! And if you need a further case for cross-compilation, remember that extracting the kernel source takes ALOT of space. You &lt;span style="font-weight: bold;"&gt;will&lt;/span&gt;  run out of space if you try to extract it on the internal flash NAND - it's just too big for what's left of the 512 MB space, and even on external media, you might want to think twice about using the limited space you have there.&lt;br /&gt;&lt;br /&gt;If you're familiar with this blog, you know that there's no way we'll want to use any of the old, likely outdated, tools that came with the SheevaPlug SDK CD or internet binaries got compiled by people we don't know (and therefore don't trust!). Besides, the Cross compiler tgz I got on the CD has a big fat CRC error to start with, and it's 32 bit while our cross compiling rig is running Linux x86_64. If what we've seen with the 32 bit openocd binaries is any indication of what's in store for 64 bit users, we might as well cut to the chase and ignore anything that's not 64 bit.&lt;br /&gt;What we do want, and always will want, is the most cutting edge and up to date technology we can lay our hands on. Therefore, we will of course recompile our own cross compiler for the SheevaPlug using the latest gcc, glibc and binutils.&lt;br /&gt;&lt;br /&gt;Now, we could of course dive in straight ahead, and recompile, by hand, the whole cross-compiling shebang, but let's face it: your time is precious, so is mine, and if you just dive in head first in trying to produce a cross compiler from the GNU vanilla tarballs, whilst having no previous experience in the matter, you'll find soon enough that:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Compiling a cross compiler manually is absolute hell!&lt;/li&gt;&lt;li&gt;glibc and gcc have to be the worst offenders for breaking things that worked perfectly fine before with newer versions. All those rumours you've heard about needing to apply a massive amount of patches to gcc and gblic before you can compile them as cross-compilers? They're true!&lt;/li&gt;&lt;/ol&gt;Fact of the matter is I wasted more than one afternoon yesterday on the "Heck, I'm smarter than that - I'll go manual!" approach, and, while I now have a clearer idea of how one &lt;span style="font-weight: bold;"&gt;might&lt;/span&gt; get a cross-compiler actually compiled from scratch, I'll just say this: Do yourself a favour - if you value your time, don't waste it in trying to create a cross-compiling toolchain by hand.&lt;br /&gt;Now, if you really, &lt;span style="font-weight: bold;"&gt;really&lt;/span&gt;, insist on compiling a whole toolchain manually, then my advice is to try to stick as close as possible to &lt;a href="http://frank.harvard.edu/%7Ecoldwell/toolchain/"&gt;this guide&lt;/a&gt; (trust me!), but don't come whining that I didn't warn you you were about to step through the gates of hell beforehand...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;Using CrossTool-NG&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The MUCH better approach, to automate the cross compilation setup process is to use &lt;span style="font-weight: bold;"&gt;Yann E. Morin&lt;/span&gt;'s most excellent &lt;a href="http://ymorin.is-a-geek.org/projects/crosstool"&gt;Crosstool-NG&lt;/a&gt;. And, yes, despite being an automated tool, it will not compromise on our using the latest versions of gcc, glibc, binutils, etc.&lt;br /&gt;&lt;br /&gt;So off we go:&lt;pre class="brush: bash"&gt;cd /usr/src&lt;br /&gt;mkdir sheeva&lt;br /&gt;cd sheeva&lt;br /&gt;wget http://ymorin.is-a-geek.org/download/crosstool-ng/crosstool-ng-1.4.2.tar.bz2&lt;br /&gt;tar -xjvf crosstool-ng-1.4.2.tar.bz2&lt;br /&gt;cd crosstool-ng-1.4.2&lt;br /&gt;./configure&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;cd ..&lt;br /&gt;ct-ng menuconfig&lt;/pre&gt;Well, isn't that nice - a kernel like configuration menu. Alrighty then, here are the options you want to change for the SheevaPlug:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Paths and misc options&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Try features marked as EXPERIMENTAL: check&lt;/li&gt;&lt;li&gt;Prefix directory: "/usr/local/${CT_TARGET}" (this will result in all the tools residing in /usr/local/arm-unknown-linux-gnueabi) or, preferred: "/usr/local/sheeva". One important note though: DO NOT USE /usr/local or any directory containing data you plan to keep. &lt;span style="color: rgb(255, 0, 0);"&gt;THIS DIRECTORY WILL BE ERASED&lt;/span&gt;. You have been warned.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Use LAN mirror: Let's try to use a mirror there, so - check&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Prefer the mirror: check&lt;/li&gt;&lt;li&gt;Base URL: ftp://ftp.heanet.ie/mirrors/ftp.gnu.org/gnu/ (this is an Irish mirror - not entirely sure it works, as the downloads didn't seem much faster, but worth a try)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt; Stop after extracting tarballs: check (we'll need to patch glibc!)&lt;/li&gt;&lt;li&gt;Number of parallel jobs: 2x the number of cores you have. In my case that would be 8 (quad core)&lt;/li&gt;&lt;li&gt;Maximum log level to see: change from "INFO" to "EXTRA"&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Target Options&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Target Architecture: arm&lt;/li&gt;&lt;li&gt;Use EABI: check&lt;/li&gt;&lt;li&gt;Emit assembly for CPU: arm926ej-s&lt;/li&gt;&lt;li&gt;Floating point: change from "hardware (FPU)" to "software"&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Toolchain options: don't change anything&lt;/li&gt;&lt;li&gt;Operating System:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Target OS: change from "bare-metal" to "linux"&lt;/li&gt;&lt;li&gt;Get kernel headers from: change from "kernel's 'headers_install'" to "Use custom headers"&lt;/li&gt;&lt;li&gt;Path to custom headers directory/tarball: "/usr/src/sheeva"&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;GMP and MPFR:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;GMP and MPFR: check&lt;/li&gt;&lt;li&gt;GMP version: 4.2.4 (latest)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;MPFR version: 2.4.1 (latest)&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;binutils&lt;/li&gt;&lt;ul&gt;&lt;li&gt; binutils version: 2.19.51.0.2&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;C compiler:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;gcc version: 4.3.3&lt;/li&gt;&lt;li&gt;C++: check&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;C-library:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;C library: glibc&lt;/li&gt;&lt;li&gt;glibc version: 2.9&lt;/li&gt;&lt;li&gt;Threading implementation to use: make sure "ntpl" is set.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;The rest should be left untouched. For your reference, I am providing the Crosstool-NG &lt;a href="http://nil.rpc1.org/files/sheeva/.config"&gt;.config file I used&lt;/a&gt;. Please note that if you use a recent version of glibc, you MUST have a threading implementation set, but you can NOT use linuxthreads, as it's been deprecated (you WILL get errors if you do select it), so the only option to use in nptl.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;Kernel headers &amp;amp; glibc 2.9 patch&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before you can run the build, we still need to setup our kernel headers.&lt;br /&gt;At the time of this writing, the most recent kernel is linux-2.6.31.2, so just download and extract it somewhere. Then, within the linux-2.6.31.2/ directory, run the command:&lt;br /&gt;&lt;pre class="brush: bash"&gt;make headers_install ARCH=arm INSTALL_HDR_PATH=/usr/src/sheeva&lt;/pre&gt;The INSTALL_HDR_PATH should match exactly what you used for "Path to custom headers directory/tarball" in the menuconfig of Crosstool-NG.&lt;br /&gt;You should now find that you have an "include" directory containing the relevant kernel headers in /usr/src/sheeva&lt;br /&gt;&lt;br /&gt;Once you have everything setup, you need to go back to the sheeva directory (because this is where the ct-ng config resides) and launch the build with: &lt;pre class="brush: bash"&gt;cd /usr/src/sheeva&lt;br /&gt;ct-ng build&lt;/pre&gt;If you followed what we did above, you will note that we checked the "Stop after extracting tarballs" option, and indeed the build process stops after "Extracting and patching toolchain components". The reason we did that is because glibc 2.9 needs to be manually patched to prevent the following error (undefined reference to `_begin') from occurring:&lt;pre class="brush: text"&gt;[ALL  ]    /usr/src/sheeva/targets/arm-unknown-linux-gnueabi/build/build-libc/elf/librtld.os: In function `_dl_start_final':&lt;br /&gt;[ALL  ]    raise.c:(.text+0x54c): undefined reference to `_begin'&lt;br /&gt;[ALL  ]    /usr/src/sheeva/targets/arm-unknown-linux-gnueabi/build/gcc-core-shared/lib/gcc/arm-unknown-linux-gnueabi/4.3.3/../../../../arm-unknown-linux-gnueabi/bin/ld: /usr/src/sheeva/targets/arm-unknown-linux-gnueabi/build/build-libc/elf/ld.so: hidden symbol `_begin' isn't defined&lt;br /&gt;[ALL  ]    /usr/src/sheeva/targets/arm-unknown-linux-gnueabi/build/gcc-core-shared/lib/gcc/arm-unknown-linux-gnueabi/4.3.3/../../../../arm-unknown-linux-gnueabi/bin/ld: final link failed: Nonrepresentable section on output&lt;br /&gt;[ALL  ]    collect2: ld returned 1 exit status&lt;br /&gt;(...)&lt;br /&gt;[ERROR]    Build failed in step 'Installing C library'&lt;/pre&gt;This known problem is documented &lt;a href="http://www.eglibc.org/archives/patches/msg00711.html"&gt;here&lt;/a&gt; and if you have a look at the diff file, you'll see that we can easily manually patch this problem by editing "targets/src/glibc-cvs-2.9/elf/Makefile" and replace, on line 314:&lt;pre class="brush: text"&gt;-e 's/\. = 0 + SIZEOF_HEADERS;/&amp;amp; _begin = . - SIZEOF_HEADERS;/' \&lt;/pre&gt;with&lt;pre class="brush: text"&gt;-e 's/\. = .* + SIZEOF_HEADERS;/&amp;amp; _begin = . - SIZEOF_HEADERS;/' \&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Building the cross-compiler&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once you have made this change, just launch ct-ng menuconfig again (from the /usr/src/sheeva directory, as this is where the config file resides) and remove the checkmark on "Stop after extracting tarballs" (in the "Paths and misc options" menu)&lt;br /&gt;&lt;br /&gt;Now, you can launch the actual build of the tools with &lt;pre class="brush: text"&gt;ct-ng build&lt;/pre&gt;This will take a little while (about 15 mins on my machine) but should complete successfully. If you have a multiple core system, hopefully you didn't forget to change the "Number of parallel jobs" option (which is equivalent to the -j option of make, i.e. number of concurrent jobs to run at once), as this dramatically reduces the time it takes to compile the toolchain. The -j option should always be your friend when compiling a large source, like a Linux kernel for instance.&lt;br /&gt;&lt;br /&gt;Time for a tea or coffee break!&lt;br /&gt;&lt;br /&gt;Note that, near the end of the compilation, you might get the error "[ERROR]    libtool.m4: error: problem compiling FC test program". From what I gather however, FC is a test for the Fortran 90 compiler, which we couldn't care less about, so, unless you got another error, I will consider this build process of success, and you should now have the whole set of cross compiler tools in /usr/local/sheeva/bin. Time to compile ourselves a new kernel!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Installing U-boot mkimage&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While we now have the tools to create arm binaries, we're still missing the last piece of the puzzle to boot a kernel, and that is the mkimage  utility (which is called at the end of a successful kernel compilation), which turns a newly crafted kernel into something U-Boot can actually launch.&lt;br /&gt;&lt;br /&gt;You guessed it, no way in hell we're gonna use the Marvell provided mkimage tool - we're gonna recompile our own from source of course!&lt;br /&gt;And once more, the good guys at Debian (never underestimate a Debianer!) provide us with &lt;a href="http://packages.debian.org/source/sid/uboot-mkimage"&gt;what we need&lt;/a&gt;:&lt;pre class="brush: bash"&gt;cd /usr/src/sheeva&lt;br /&gt;wget http://ftp.de.debian.org/debian/pool/main/u/uboot-mkimage/uboot-mkimage_0.4.tar.gz&lt;br /&gt;tar -xzvf uboot-mkimage_0.4.tar.gz&lt;br /&gt;make&lt;br /&gt;make install&lt;/pre&gt;Easy as a pie!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Cross-Compiling a new kernel for the SheevaPlug&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;At long last, we're ready to compile us some custom kernel!&lt;br /&gt;At this stage, we can more or less follow the &lt;a href="http://www.openplug.org/plugwiki/index.php/Compiling_Linux_Kernel_for_the_Plug_Computer"&gt;Compiling Linux Kernel for the Plug Computer&lt;/a&gt; tutorial from openplug.org . Henceforth:&lt;pre class="brush: bash"&gt;cd /usr/src/sheeva/linux-2.6.31.2&lt;br /&gt;make ARCH=arm kirkwood_defconfig&lt;br /&gt;make ARCH=arm menuconfig&lt;/pre&gt;There, change the options that you want. If you plan to keep  using UBIFS (which you should have switched to during the SheevaPlug Installer 1.0 upgrade), then make sure that you enable BOTH:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Device Drivers  ---&gt; Memory Technology Device (MTD) support  ---&gt; UBI - Unsorted block images  ---&gt;  Enable UBI&lt;br /&gt;&lt;/li&gt;&lt;li&gt;File systems  ---&gt; Miscellaneous filesystems  ---&gt; UBIFS file system support&lt;/li&gt;&lt;li&gt;Device Drivers ---&gt; Generic Driver Options, and  make sure that both "Create a kernel maintained /dev tmpfs  (EXPERIMENTAL)" and "Automount devtmpfs at /dev" are enabled. Without those, you won't see init messages on the serial console after the root filesystem is mounted. &lt;/li&gt;&lt;/ul&gt;With this set, and the other default options from kirkwood_defconfig, you should be able to produce a usable kernel. Now is obviously a good time to add ext4 &amp;amp; NTFS suppot, and remove features (802.11 stack) that you do not want. Finally, we're ready to compile, and the kernel makes cross compilation very easy for us, as its CROSS_COMPILE feature enables us to specify exactly which tools it should use instead of the default ones. Thus, because we have an arm-unknown-linux-gnueabi-gcc, arm-unknown-linux-gnueabi-ld, etc. in /usr/local/sheeva/bin, we will use the line: &lt;pre class="brush: bash"&gt;make -j8 ARCH=arm CROSS_COMPILE=/usr/local/sheeva/bin/arm-unknown-linux-gnueabi- uImage&lt;/pre&gt;and in about 3 minutes (vs. one hour if done on the SheevaPlug) you should end up with something like&lt;pre class="brush: text"&gt;Image Name:   Linux-2.6.31.2&lt;br /&gt;Created:      Tue Oct  6 14:50:51 2009&lt;br /&gt;Image Type:   ARM Linux Kernel Image (uncompressed)&lt;br /&gt;Data Size:    3151992 Bytes = 3078.12 kB = 3.01 MB&lt;br /&gt;Load Address: 0x00008000&lt;br /&gt;Entry Point:  0x00008000&lt;br /&gt;Image arch/arm/boot/uImage is ready&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Building the modules&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You probably still have a few modules to compile as well, which you can do as follows&lt;br /&gt;&lt;pre class="brush: bash"&gt;make -j8 ARCH=arm CROSS_COMPILE=/usr/local/sheeva/bin/arm-unknown-linux-gnueabi- modules&lt;br /&gt;make -j8 ARCH=arm CROSS_COMPILE=/usr/local/sheeva/bin/arm-unknown-linux-gnueabi- INSTALL_MOD_PATH=./modules modules_install&lt;/pre&gt;Just don't forget that you'll need to copy the content of the ./modules directory to your Ubuntu image to keep the kernel happy&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;Testing the new kernel on the plug&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In a next post, we'll see how to actually flash that kernel on the plug. Before we do that though, we want to ensure that it can boot our current system, so we'll try to launch it from an USB stick.&lt;br /&gt;Off we go then to copy your shiny new kernel to an USB stick with &lt;pre class="brush: bash"&gt;mount /dev/sde1 /mnt/usb&lt;br /&gt;cp arch/arm/boot/uImage /mnt/usb/&lt;br /&gt;sync&lt;br /&gt;umount /mnt/usb&lt;/pre&gt;For the test part, we'll need the serial console ("screen /dev/ttyUSB0 115200,-crtscts" or similar), with which we first reboot our system, and interrupt the autoboot to get to the Marvel &amp;gt;&amp;gt; prompt. From there, the following set of commands should boot the existing system with our new kernel:&lt;br /&gt;&lt;pre class="brush: text"&gt;usb start&lt;br /&gt;fatload usb 0 0x00800000 uImage&lt;br /&gt;bootm 0x00800000&lt;/pre&gt;Success? Then my work here is done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1301235965746866921?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1301235965746866921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/recompiling-new-kernel-for-sheevaplug.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1301235965746866921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1301235965746866921'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/recompiling-new-kernel-for-sheevaplug.html' title='Recompiling a new kernel for the SheevaPlug'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5362246050067796034</id><published>2009-10-04T12:38:00.013+01:00</published><updated>2009-10-07T11:02:25.709+01:00</updated><title type='text'>Upgrading the factory SheevaPlug nand to a more efficient version</title><content type='html'>If you've had a look at openplug.org, as you should have, you've read that the default installed NAND kind of blows (slow MMC/NAND accesses, old U-Boot version that lacks versatility to install newer kernels, etc.), so you'll want to upgrade the default NAND (u-boot and Ubuntu) to something that's more up to date.&lt;br /&gt;&lt;br /&gt;Well, the good guys at openplug.org heard you and made a readily available package for ya (see &lt;a href="http://www.openplug.org/plugwiki/index.php/SheevaPlug_Installer"&gt;SheevaPlug Installer&lt;/a&gt; in the HowTo's section), so off you go an download the big tarball.&lt;br /&gt;Only thing is, well, they've customized their packages for the masses (that still run a 32 bit OS), not the classes (x64), and they insist on using a PHP installer (eeeeew!!!).&lt;br /&gt;Are we gonna trust a one size-fits-all installer to cover our needs? Of course not!&lt;br /&gt;&lt;br /&gt;The purpose of this guide then is to show you how to &lt;span style="font-weight: bold;"&gt;manually&lt;/span&gt; install the SheevaPlug Installer v1.0 from a Linux x86_64 environment, since, if you followed the previous post, you should now have a  working openocd there. Of course, this stuff will work on 32 bit Linux as well.&lt;br /&gt;&lt;br /&gt;For the purpose of this exercise, we'll assume that you have extracted the tar in /usr/src, and thus you have a /usr/src/sheevaplug-installer-v1.0/ directory and that you have a FAT32 formatted USB stick mounted in /mnt/usb&lt;br /&gt;&lt;br /&gt;First we need to populate the USB stick.&lt;br /&gt;&lt;pre class="brush: text"&gt;cd /usr/src/sheevaplug-installer-v1.0/installer/&lt;br /&gt;cp * /mnt/usb&lt;br /&gt;sync&lt;/pre&gt;That's really all there is to it for the USB part. Once syncing is done, just plug the USB stick on the sheevaplug.&lt;br /&gt;&lt;br /&gt;Then,  log on the sheeva with the serial console, and reboot it. When you see the prompt "Hit any key to stop autoboot:" press a key. Now that the plug is in idle state, we'll start by re-flashing the U-Boot using openocd, which is definitely something you want to know how to do in case of trouble. Please note that, as shown below, you MUST launch openocd from the directory where your uboot.bin image is located. Also note that the flashing itself takes about 2-3 minutes, during which NOTHING will happen in the openocd console, so &lt;span style="font-weight: bold;"&gt;be patient&lt;/span&gt;.&lt;br /&gt;&lt;pre class="brush: text"&gt;cd uboot&lt;br /&gt;openocd -f /usr/local/share/openocd/scripts/board/sheevaplug.cfg&lt;/pre&gt;Then from another Linux terminal&lt;br /&gt;&lt;pre class="brush: text"&gt;# telnet localhost 4444&lt;br /&gt;Trying 127.0.0.1...&lt;br /&gt;Connected to localhost.&lt;br /&gt;Escape character is '^]'.&lt;br /&gt;Open On-Chip Debugger&lt;br /&gt;&amp;gt;  sheevaplug_init&lt;br /&gt;target state: halted&lt;br /&gt;target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;cpsr: 0x000000d3 pc: 0xffff0000&lt;br /&gt;MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;0 0 1 0: 00052078&lt;br /&gt;&amp;gt; sheevaplug_reflash_uboot&lt;br /&gt;target state: halted&lt;br /&gt;target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;cpsr: 0x000000d3 pc: 0xffff0000&lt;br /&gt;MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;0 0 1 0: 00052078&lt;br /&gt;NAND flash device 'NAND 512MiB 3,3V 8-bit' found&lt;br /&gt;erased blocks 0 to 5 on NAND flash device #0 'NAND 512MiB 3,3V 8-bit'&lt;br /&gt;[!!!! THE 2-3 MINUTES PAUSE HAPPENS HERE - BE PATIENT!!!!]&lt;br /&gt;wrote file uboot.bin to NAND flash 0 up to offset 0x00074000 in 217.873932s&lt;br /&gt;&amp;gt;&lt;/pre&gt;After that, the plug will reboot (into the new U-Boot), so make sure you have your serial console still running. The upgraded U-Boot should still let you  boot the old factory installed Ubuntu Linux, so you might wanna check that everything's copacetic.&lt;br /&gt;&lt;br /&gt;So far so good? Alright then, let's move to the next stage and flash that up to date Linux image.&lt;br /&gt;This time we're not gonna use openocd but the flashing capabilities of the U-Boot, so you can "shutdown" (i.e. exit) openocd if not already done.&lt;br /&gt;&lt;br /&gt;Once again, you need to reset the plug &amp;amp; interrupt the boot process to get to the Marvel&amp;gt;&amp;gt; prompt. There, we will install the new Ubuntu image by using the various commands from the U-Boot environment.&lt;br /&gt;Three points that you need to know before starting this procedure:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Please note that it is necessary to boot the RAM image at the end to setup the NAND filesystem. Failure to do so will result in an unbootable Linux image, but this can be rectified by reloading the USB images and issuing the last command listed.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It is also a good idea, before you start this whole procedure, to spare a copy of your environment variables, which you'll get with the command 'printenv', as we're going to modify/create some of those. This way you should be able to revert back to your old environment if anything happens&lt;/li&gt;&lt;li&gt;The initial setup of the Linux image requires access to the USB stick, so make sure you leave it plugged in.&lt;/li&gt;&lt;/ol&gt;&lt;pre class="brush: text"&gt;Marvell&amp;gt;&amp;gt; usb start&lt;br /&gt;(Re)start USB...&lt;br /&gt;USB:   scanning bus for devices... 2 USB Device(s) found&lt;br /&gt;     scanning bus for storage devices... 1 Storage Device(s) found&lt;br /&gt;Marvell&amp;gt;&amp;gt; fatload usb 0 0x00800000 uImage&lt;br /&gt;reading uImage&lt;br /&gt;...............................................................................................................................................................................................................................................................&lt;br /&gt;&lt;br /&gt;2620504 bytes read&lt;br /&gt;Marvell&amp;gt;&amp;gt; fatload usb 0 0x01100000 initrd&lt;br /&gt;reading initrd&lt;br /&gt;.....................................................................................................................................................................................................................................................................................................................................&lt;br /&gt;&lt;br /&gt;3331626 bytes read&lt;br /&gt;Marvell&amp;gt;&amp;gt; nand erase clean 0x00100000 0x00400000;&lt;br /&gt;&lt;br /&gt;NAND erase: device 0 offset 0x100000, size 0x400000&lt;br /&gt;Erasing at 0x4e0000 -- 100% complete. Cleanmarker written at 0x4e0000.&lt;br /&gt;OK&lt;br /&gt;Marvell&amp;gt;&amp;gt; nand write.e 0x00800000 0x00100000 0x00400000&lt;br /&gt;&lt;br /&gt;NAND write: device 0 offset 0x100000, size 0x400000&lt;br /&gt;&lt;br /&gt;Writing data at 0x4ff800 -- 100% complete.&lt;br /&gt; 4194304 bytes written: OK&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv mainlineLinux yes&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv arcNumber 2097&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs_root ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv mtdpartitions mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs_console console=ttyS0,115200&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs $(bootargs_console) $(mtdpartitions) $(bootargs_root)&lt;br /&gt;Marvell&amp;gt;&amp;gt; saveenv&lt;br /&gt;Saving Environment to NAND...&lt;br /&gt;Erasing Nand...Writing to Nand... done&lt;br /&gt;Marvell&amp;gt;&amp;gt; setenv bootargs $(bootargs_console) $(mtdpartitions) root=/dev/ram0 rw ramdisk=0x01100000,8M install_type=nand; bootm 0x00800000 0x01100000&lt;/pre&gt;Now, because of the "bootm" command after the semicolon, this last command will make the plug boot automatically into the  Linux copy in RAM, which needs to be done at least once to setup your initial system on the NAND. If all is well, this one time Linux installer will run &amp;amp; setup your system, restart the plug, and you'll get the new Ubuntu 9.04 booting which you'll find is A LOT faster than the factory one!&lt;br /&gt;&lt;br /&gt;Next, we'll see how to recompile and install a vanilla kernel to boot the new distro.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5362246050067796034?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5362246050067796034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/upgrading-factory-sheevaplug-nand-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5362246050067796034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5362246050067796034'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/upgrading-factory-sheevaplug-nand-to.html' title='Upgrading the factory SheevaPlug nand to a more efficient version'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-8719767208728404008</id><published>2009-10-03T23:16:00.029+01:00</published><updated>2009-10-07T02:13:02.703+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JTAG'/><category scheme='http://www.blogger.com/atom/ns#' term='Sheevaplug'/><category scheme='http://www.blogger.com/atom/ns#' term='openocd'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='x86_64'/><title type='text'>OpenOCD and the SheevaPlug on Linux x86_64</title><content type='html'>This is a tutorial for people like me who want to start with JTAG and OpenOCD access on the SheevaPlug. Most of this stuff regarding the installation of OpenOCD on Linux x86_64 is of course generic and can be used for other FTDI based JTAG devices like.&lt;br /&gt;&lt;br /&gt;First of all, if you're running a 64 bit OS (Vista, Win7), a word of advice: Don't waste your time trying to get OpenOCD to work on a 64 bit Windows - there's no ready-made package that works (the 32 bit version just don't), so the only way is to recompile the whole shebang yourself, and it's a complete mess, as you will also need a 64 bit gcc-like compiler, and figure out how to get a 64 bit version of a the FTDI GPL library talk to the 64 bit libUSB drivers.&lt;br /&gt;If I ever manage to get a Windows version going, you'll be the first to hear about it, but for the time being, if you value your time, stick with Linux.&lt;br /&gt;&lt;br /&gt;Now, the distro I am using is Slackware x86_64. There are of course tutorials on how to compile OpenOCD for Linux here and there, but things are slightly different for 64 bit version, which is why I'm posting my own version.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Before anything else, you want to have the serial console to the SheevaPlug through the USB FTDI device. For that you need to compile the kernel driver for the "USB FTDI Single Port Serial Driver" either as a module, or directly in your kernel. You will find that option, in the kernel, under: "Device Drivers  ---&amp;gt; USB support  ---&amp;gt; USB Serial Converter support  ---&amp;gt; USB FTDI Single Port Serial Driver"&lt;br /&gt;Once you have the driver loaded, with the USB cable connected to the sheevaplug, you should get a /dev/ttyUSB0 device, which you can use as a regular serial port.&lt;br /&gt;The best way to connect to the SheevaPlug in Linux (or to any serial terminal for that matter) has to be to use screen, with a command like:&lt;br /&gt;&lt;pre class="brush: text"&gt;screen /dev/ttyUSB0 115200,-crtscts&lt;/pre&gt;Once you have confirmed that you can connect to the plug using the FTDI USB Serial converter driver, you can move to building OpenOCD, as it's a good indication that Linux should have no trouble accessing the rest of the FTDI chip functionalities&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;OPTION 1&lt;/span&gt;: Using the &lt;span style="font-weight: bold;"&gt;proprietary&lt;/span&gt; libftd2xx library from FTDI, provided for completion. Note that using this option will kill any opened serial console whenever you launch openocd, whereas this does not occur with OPTION 2 below, which I strongly advise you to use.&lt;br /&gt;On an x86_64 MUST pick up the 64 bit version of the Linux drivers from the FTDI website. At the time of this post, that means you must download libftd2xx0.4.16_x86_64.tar.gz, NOT libftd2xx0.4.16.tar.gz. What's more, when you install the library, it has to go into lib64, NOT lib else you will get the ominous&lt;br /&gt;&lt;pre&gt;checking whether ftd2xx library works...&lt;br /&gt;configure: error: Cannot build &amp;amp; run test program using ftd2xx.lib&lt;/pre&gt;Thus:&lt;br /&gt;&lt;pre class="brush: bash"&gt;cd /usr/src&lt;br /&gt;wget http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.16_x86_64.tar.gz&lt;br /&gt;tar -xzvf libftd2xx0.4.16_x86_64.tar.gz&lt;br /&gt;cp libftd2xx0.4.16_x86_64/libftd2xx.so.0.4.16 /usr/local/lib64&lt;br /&gt;ln -s /usr/local/lib64/libftd2xx.so.0.4.16 /usr/local/lib64/libftd2xx.so&lt;br /&gt;# even if you specify --libdir=/usr/local/lib64 on openocd compilation&lt;br /&gt;# it requires libftd2xx.so.0 in /usr/lib64!&lt;br /&gt;ln -s /usr/local/lib64/libftd2xx.so.0.4.16 /usr/lib64/libftd2xx.so.0&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;OPTION 2&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; (PREFERRED)&lt;/span&gt;: Using the &lt;span style="font-weight: bold;"&gt;GPL/Open source version&lt;/span&gt; of the FTDI library&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;pre class="brush: bash"&gt;cd /usr/src&lt;br /&gt;wget http://www.intra2net.com/en/developer/libftdi/download/libftdi-0.16.tar.gz&lt;br /&gt;tar -xzvf libftdi-0.16.tar.gz&lt;br /&gt;cd libftdi-0.16&lt;br /&gt;# by default, libftdi will go in /usr/local/lib, whereas, on x86_64, it should go to lib64, thus&lt;br /&gt;./configure --with--libdir=/usr/local/lib64&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;# openocd looks in /usr/lib64&lt;br /&gt;ln -s /usr/local/lib64/libftdi.so.1.16.0 /usr/lib64/libftdi.so.1&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Now it's time to get OpenOCD compiled. For that:&lt;br /&gt;&lt;pre class="brush: bash"&gt;svn checkout svn://svn.berlios.de/openocd/trunk openocd&lt;br /&gt;cd openocd&lt;br /&gt;./bootstrap&lt;br /&gt;# OPTION 1 - PROPRIETARY LIB FROM FTDI&lt;br /&gt;./configure --libdir=/usr/local/lib64 --enable-maintainer-mode --enable-ft2232_ftd2xx&lt;br /&gt;# OPTION 2 - GPL FTDI LIBRARY&lt;br /&gt;./configure --libdir=/usr/local/lib64 --enable-maintainer-mode --enable-ft2232_libftdi&lt;br /&gt;make&lt;br /&gt;make install&lt;/pre&gt;Note that if you don't use the "--enable-maintainer-mode" option, you will get an error when make reaches the creation of the documentation, which is not a problem per se, but will prevent the openocd configuration scripts to be copied over on make install&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If the above completed successfully, then you have openOCD ready to run. To connect to the SheevPlug then, issue a:&lt;br /&gt;&lt;pre class="brush: text"&gt;openocd -f /usr/local/share/openocd/scripts/board/sheevaplug.cfg&lt;/pre&gt;At this stage, if you are getting the following, then you need to reboot the plug and launch openOCD in the early stages of reboot:&lt;br /&gt;&lt;pre class="brush: text"&gt;Error: JTAG scan chain interrogation failed: all zeroes&lt;br /&gt;Error: Check JTAG interface, timings, target power, etc.&lt;br /&gt;Error: Trying to use configured scan chain anyway...&lt;br /&gt;Error: feroceon.cpu: IR capture error; saw 0x00 not 0x..1&lt;br /&gt;Warn : Errors during IR capture, continuing anyway...&lt;br /&gt;Error: unexpected Feroceon EICE version signature&lt;/pre&gt;What you really want to see when launching openOCD is:&lt;br /&gt;&lt;pre class="brush: text"&gt;root@stella:/usr/src/openocd# openocd -f /usr/local/share/openocd/scripts/board/sheevaplug.cfg&lt;br /&gt;Open On-Chip Debugger 0.3.0-in-development (2009-10-07-01:35) svn:2808&lt;br /&gt;$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $&lt;br /&gt;For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS&lt;br /&gt;2000 kHz&lt;br /&gt;jtag_nsrst_delay: 200&lt;br /&gt;jtag_ntrst_delay: 200&lt;br /&gt;dcc downloads are enabled&lt;br /&gt;Warn : use 'feroceon.cpu' as target identifier, not '0'&lt;br /&gt;Info : clock speed 2000 kHz&lt;br /&gt;Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3 (mfg: 0x1e9, part: 0x0a02, ver: 0x2)&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;OpenOCD is a client server software, so when you launch openOCD, you are really only launching the server part. To actually send JTAG commands and all that Jazz, you need to open a client session with:&lt;br /&gt;&lt;pre class="brush: text"&gt;telnet localhost 4444&lt;/pre&gt;This should then provide you with the On-Chip Debugger prompt.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Now, JTAG operations are  a bit tricky (there are various JTAG states involved) so you can't really send any JTAG command you want (eg. NAND ID) any time you like and expect a meaningful reply. If you looked in the cfg file for the SheevaPlug, you'll see that before any NAND access operation is performed, a "sheevaplug_init" command is being called, so this is what we'll do. Once it's run, you will get a whole lot of interesting commands working, as illustrated with the session below:&lt;br /&gt;&lt;pre class="brush: text"&gt;&amp;gt; sheevaplug_init&lt;br /&gt;target state: halted&lt;br /&gt;target halted in ARM state due to debug-request, current mode: Supervisor&lt;br /&gt;cpsr: 0x000000d3 pc: 0xffff0000&lt;br /&gt;MMU: disabled, D-Cache: disabled, I-Cache: disabled&lt;br /&gt;0 0 1 0: 00052078&lt;br /&gt;&amp;gt; scan_chain&lt;br /&gt;     TapName            | Enabled |   IdCode      Expected    IrLen IrCap  IrMask Instr&lt;br /&gt;---|--------------------|---------|------------|------------|------|------|------|---------&lt;br /&gt; 0 | feroceon.cpu       |    Y    | 0x20a023d3 | 0x20a023d3 | 0x04 | 0x01 | 0x0f | 0x0c&lt;br /&gt;&amp;gt; nand probe 0&lt;br /&gt;NAND flash device 'NAND 512MiB 3,3V 8-bit' found&lt;br /&gt;&amp;gt; nand list&lt;br /&gt;#0: NAND 512MiB 3,3V 8-bit (Hynix) pagesize: 2048, buswidth: 8,&lt;br /&gt;    blocksize: 131072, blocks: 4096&lt;br /&gt;&amp;gt; nand info 0&lt;br /&gt;#0: NAND 512MiB 3,3V 8-bit (Hynix) pagesize: 2048, buswidth: 8, erasesize: 131072&lt;br /&gt;#0: 0x00000000 (128kB) erase state unknown (block condition unknown)&lt;br /&gt;#1: 0x00020000 (128kB) erase state unknown (block condition unknown)&lt;br /&gt;(...)&lt;br /&gt;#4094: 0x1ffc0000 (128kB) erase state unknown (block condition unknown)&lt;br /&gt;#4095: 0x1ffe0000 (128kB) erase state unknown (block condition unknown)&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-8719767208728404008?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/8719767208728404008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/openocd-and-sheevaplug-on-linux-x8664.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8719767208728404008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8719767208728404008'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/openocd-and-sheevaplug-on-linux-x8664.html' title='OpenOCD and the SheevaPlug on Linux x86_64'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1787567545611815657</id><published>2009-10-02T18:34:00.003+01:00</published><updated>2010-08-11T21:01:05.732+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mmc'/><category scheme='http://www.blogger.com/atom/ns#' term='Sheevaplug'/><category scheme='http://www.blogger.com/atom/ns#' term='SD card'/><title type='text'>Accessing an SD card on the SheevaPlug</title><content type='html'>Not something I knew beforehand.&lt;br /&gt;USB devices are either auto detected or can be accessed as regular SCSI Disk devices (/dev/sda# - by the way, the SheevaPlug has  no problem powering a 7200 rpm 2.5" HDD [UPDATE: until you try it for a few days, and its &lt;a href="http://plugcomputer.org/plugforum/index.php?topic=1318.msg8145#msg8145"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;PSU blows up&lt;/span&gt;&lt;/a&gt;), but not SD Cards.&lt;br /&gt;&lt;br /&gt;The device name to use then is: &lt;code&gt;/dev/mmcblk0&lt;/code&gt; for the raw device and &lt;code&gt;/dev/mmcblk0p1&lt;/code&gt; for the first partition.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1787567545611815657?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1787567545611815657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/accessing-sd-card-on-sheevaplug.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1787567545611815657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1787567545611815657'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/accessing-sd-card-on-sheevaplug.html' title='Accessing an SD card on the SheevaPlug'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5240781334189451097</id><published>2009-10-02T17:45:00.005+01:00</published><updated>2009-10-02T17:57:17.940+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='streaming'/><category scheme='http://www.blogger.com/atom/ns#' term='Daily show'/><category scheme='http://www.blogger.com/atom/ns#' term='MTV'/><title type='text'>Watching the Daily Show if you're not in the US</title><content type='html'>Well, it finally happened. Daily video streaming for the last episode of the "The Daily Show" is no longer available from the Republic Of Ireland (was working fine 'till yesterday).&lt;br /&gt;&lt;br /&gt;The solution:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Get a VPS, private server, whatever box in the US with enough bandwidth and an ssh server&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Using putty add the following tunnel:&lt;br /&gt;- source port: 80&lt;br /&gt;- Destination: media.mtvnservices.com:80&lt;/li&gt;&lt;li&gt;Edit your C:\Windows\System32\drivers\etc\hosts file and add the line:&lt;br /&gt;127.0.0.1  media.mtvnservices.com&lt;/li&gt;&lt;li&gt;Establish an ssh connection, and then open a browser to www.thedailyshow.com&lt;/li&gt;&lt;/ul&gt;"No soup for you"? Yeah, I'd like to see you try!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5240781334189451097?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5240781334189451097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/watching-daily-show-if-youre-not-in-us.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5240781334189451097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5240781334189451097'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/watching-daily-show-if-youre-not-in-us.html' title='Watching the Daily Show if you&apos;re not in the US'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5139563806750717187</id><published>2009-10-02T15:27:00.007+01:00</published><updated>2009-10-04T00:53:38.351+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='arm'/><category scheme='http://www.blogger.com/atom/ns#' term='JTAG'/><category scheme='http://www.blogger.com/atom/ns#' term='Sheevaplug'/><category scheme='http://www.blogger.com/atom/ns#' term='globalscale'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='marvell'/><category scheme='http://www.blogger.com/atom/ns#' term='plug computer'/><title type='text'>SheevaPlug - Let's get cracking!</title><content type='html'>Alright, now that we have our new shiny SheevaPlug, let's get started.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Of course, first thing we want is a serial console to the Linux OS, so we'll plug the mini &lt;-&gt; std USB cable provided to one of our USB ports and find out if Vista (x64) is able to figure out the FT2232D driver itself... which it can't (surprise, surprise). No big deal. The PDF readme from the DevKit CD tells you that you can find the TeraTerm Windows drivers in the SheevaPlug_Host_SWsupportPackageWindowsHost.zip or, for a more up to date version, at &lt;a href="http://www.ftdichip.com/Drivers/D2XX.htm"&gt;http://www.ftdichip.com/Drivers/D2XX.htm&lt;/a&gt;. Installing the drivers with Vista autodetect is still a pain, as you don't get the option to browse to the driver directory (yes, Microsoft, all your users are complete tools - that's why they use your products in the first place!), but with the device manager, you're good to go. Yay, another COM port! Yay a set of USB Serial converters!&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Alrighty, if we have our COM port, so we're good to go with the ever versatile putty. The FIRST thing you want to know is that the serial console  is set to &lt;span style="font-weight: bold;"&gt;115200 bauds&lt;/span&gt;, and the SECOND thing is that the &lt;span style="font-weight: bold;"&gt;default logon&lt;/span&gt; is &lt;span style="font-weight: bold;"&gt;root/nosoup4u&lt;/span&gt; (Globalscale: even their passwords are cool!). And we're in... Niiiiiice! dmesg, df -h, top, they're all waiting for you, but first you might as well wanna change the date &amp;amp; time, as mine was set to Apr 22 1953. That's like, way old! Also, since you're gonna wanna try a reboot to see what the console spills out, I'll just mention that there's a very loooong pause during boot after the line "eth0: link up, full duplex, speed 1 Gbps", so just be patient, you will get your logon prompt. Oh and you'll see warnings here and there as well, but what do you expect.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;What do we have  here? Ubuntu? Huh, well, at least it's Debian based and we have a good chunk of space left. We could have fared much much worse (read anything that's based on Red Hat). We'll install armedslack soon enough but let's get cracking then. Of course, we'll want to recompile stuff on the device itself (something that can't be done on a WRT!). Let's start by compiling the very handy &lt;a href="http://pyropus.ca/software/memtester/"&gt;memtester&lt;/a&gt; to do a little bit of torture test, and see how much the baby heats up when using RAM.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;According to google, installing gcc on the SheevaPlug ios as easy as running: "apt-get install build-essential"... Except that you are missing the cache directory so the command fails. You need to issue a&lt;br /&gt;&lt;pre class="brush: text"&gt;mkdir -p /var/cache/apt/archives/partial&lt;/pre&gt;before you can use apt-get (and you might want to add this line to your /etc/rc.local as well). But we're still not out of the woods yet, as the package upgrade seems to start up fine, but after a while, you get errors like:&lt;pre class="brush: text"&gt;Failed to fetch http://ports.ubuntu.com/pool/main/b/binutils/binutils_2.19.0.20090110-0ubuntu1_armel.deb  404 Not Found&lt;/pre&gt;Checking that URL confirms that the package is no longer hosted there.&lt;br /&gt;Drats!&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The easiest solution at this stage is to update your system as a whole with "apt-get update". This might take a while, but it seemed to get the problem sorted, as the subsequent "apt-get install build-essential" completed hapilly. You might also want to run an "apt-get autoremove" after that, to free up some space. Good, now we can compile natively on the plug.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;"-bash: wget: command not found"? Who on earth delivers a system without wget? "apt-get install wget" then, but sheesh! But then...&lt;pre class="brush: text"&gt;root@debian:/usr/src# wget http://pyropus.ca/software/memtester/old-versions/memtester-4.1.2.tar.gz&lt;br /&gt;--2009-10-02 14:05:28--  http://pyropus.ca/software/memtester/old-versions/memtester-4.1.2.tar.gz&lt;br /&gt;Resolving pyropus.ca... failed: Name or service not known.&lt;br /&gt;wget: unable to resolve host address `pyropus.ca'&lt;/pre&gt;Indeed, DNS resolution doesn't seem to work out of the box and the default /etc/resolv.conf goes something like:&lt;pre class="brush: text"&gt;domain lan&lt;br /&gt;search lan&lt;br /&gt;nameserver 127.0.0.1&lt;/pre&gt;It's clear that with only these 3 lines, you're not gonna get very far (it's a wonder apt-get still managed to find its way - must be using direct IPs). Let's just comment the domain &amp;amp; search lines and add our ISP's nameservers before the 127.0.0.1 to get some resolution going. Now, please be aware that any changes you make here won't hold on reboot, so for more details on how to fix the default annoyance, you might as well have a look at the &lt;a href="http://www.openplug.org/plugwiki/index.php/New_Plugger_How_To"&gt;New Plugger Howto&lt;/a&gt;  from openplug.org.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Good, now we can wget memtester, compile it and run it (and it looks like our RAM is good). Maybe I'll try mprime later on as well... But to complete the setup of a half decent Linux system, let's issue an "apt-get install screen.&lt;/li&gt;&lt;/ol&gt;Next, we'll try to play with JTAG and OpenOCD...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5139563806750717187?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5139563806750717187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/sheevaplug-lets-get-cracking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5139563806750717187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5139563806750717187'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/sheevaplug-lets-get-cracking.html' title='SheevaPlug - Let&apos;s get cracking!'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5551365348764002705</id><published>2009-10-02T11:42:00.029+01:00</published><updated>2009-10-27T17:40:21.869Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='arm'/><category scheme='http://www.blogger.com/atom/ns#' term='JTAG'/><category scheme='http://www.blogger.com/atom/ns#' term='Sheevaplug'/><category scheme='http://www.blogger.com/atom/ns#' term='globalscale'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='marvell'/><category scheme='http://www.blogger.com/atom/ns#' term='plug computer'/><title type='text'>SheevaPlug - first impressions</title><content type='html'>At last, my SheevaPlug Development Kit has arrived!&lt;br /&gt;&lt;br /&gt;For those who don't know yet what the SheevaPlug is, you can have a look at this &lt;a href="http://news.cnet.com/8301-17938_105-10170648-1.html"&gt;short CNET article&lt;/a&gt; or &lt;a href="http://www.marvell.com/featured/plugcomputing.jsp"&gt;Marvell's slightly longer blurb&lt;/a&gt; about this wonderful little device.&lt;br /&gt;I ordered mine (UK version) from Globalscale about 2-3 weeks ago, to basically replace my long trusted WRT54G running openWRT with something that has a little more punch and I/O capabilities. The truth of the matter is, I almost never use the WRT for WiFi, but having an always on &amp;amp; completely customizable Linux low power "server" has proved invaluable (Samba share for easy data interchange between any machine, DHCP server, bootp/tftp server, nmap &amp;amp; other networking tools provider, etc.), and I had been waiting for some time to see something like Marvell's plug computer come out, as it's basically a glorified hacked WRT54G, without the unneeded Wifi/network hub features.&lt;br /&gt;&lt;br /&gt;For those who can't be bothered to read the whole post (and who can blame them!), I'll jump right into the main points of my first impressions:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The not so good:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Globascale's delays in shipment, and total lack of response when asked for  updates. Granted delays are likely unavoidable (I doubt they're shipping Sheevaplugs by the truckload right now), but that doesn't explain why it took about 2 weeks of repeated e-mails to sales to get a simple status update on the order.&lt;/li&gt;&lt;li&gt;No choice but to use Fedex for shipping if you're not in the US. Granted, once it's shipped, the delivery is fast indeed, but considering the shipping delay, you might as well want to use regular post and spare a few bucks.&lt;br /&gt;Also, since Fedex are really happy to help with the obnoxious EU VAT &amp;amp; Customs Duty extortion scheme, &lt;span style="font-weight: bold;"&gt;you will be hit by &lt;span style="color: rgb(255, 0, 0);"&gt;46% retroactive VAT&lt;/span&gt; on import &lt;/span&gt;(€31.20 - I really wish I was making this up), meaning that, &lt;span style="font-weight: bold;"&gt;as usual&lt;/span&gt;, no matter what you do, amount in $ = amount in €, and you still have to pay €99 for a bloody $99 item. Better believe this is the last time I import anything with Fedex. &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;HEED MY ADVICE - DO NOT IMPORT ANYTHING WITH FEDEX, EVER!!!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Unlike the most excellent US removable plug (see below), the UK plug is just a common adapter to fit over the US socket, so it's not as sleekly designed. Not that big a deal, but it adds to the overall height of the device when used in plug mode. It would have been nice to see an integrated UK plug in the way the US one is. Also, the Globalscale UK devkit photos don't make that as clear as they could.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The mainboard is now rev. 1.3 and very different from the reference mainboard you see in the documentation (see below). For starters, there is no longer a separate mainboard for JTAG and SDIO, and the solder-able port for an ARM JTAG connector is gone. Gone as well is the generic GPIO connector. There still seems to be a small JTAG port, but with only  8 connectors and a non-standard smaller socket too be fitted in, it  will be a pain to interface with. Not sure if many people would put single board vs 2 separate boards design as a disadvantage, but I was kind of planning on using the standalone expansion board as a cheap JTAG device (it has the very well known FT2232 JTAG IC on it) but now using the SheevaPlug hardware as a JTAG interface to other boards, or as a general purpose IO device, is going to be less of a possibility for your regular electronics hobbyist.&lt;br /&gt;UPDATE: for some of the new ports pinouts (still no JTAG desc), have a look &lt;a href="http://plugcomputer.org/plugforum/index.php?topic=683.msg4194#msg4194"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Even idle, the device seems to run a bit hotter than I anticipated (It's certainly running hotter than my WRT54G). Definitely not that hot (akin to one of the numerous power bricks you have in your house), and most likely the heat is due to the PSU rather than the chip themselves, but still, I've seen power bricks run cooler than that (the 12V DC WRT brick being one of those). Of course, anybody who hears "heat" automatically thinks "increased power consumption", so I don't know how that translates into wasted wattage. My guess is this might be due to using a 110V/220V compatible PSU. Using a localized source voltage PSU for 220V -&gt; 5V delivery would probably reduce the heat.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[UPDATE 2009.10.08]&lt;/span&gt; The Plug does run scaringly hot when running at full load for a prolonged period of time, as I just found out through a rogue process.&lt;br /&gt;The metal parts on both USB and network sockets are almost burning when running for a long time at 100% of the CPU, and you wouldn't want to leave something in contact with them then. Still probably not hot enough to light up paper or plastic that would be in contact, yet quite scary... And it looks like the PSU unit does play some part in raising the whole temperature of the plug on full load. I also found that I had to enlarge some of the vents on my plug with a knife because they had been pourly moulded and were not entirely open. Still, I don't think  Even then, there are too few vents on the current Plug and I don't think it is designed for adequate cooling! Something that definitely needs some improvement for later models.&lt;br /&gt;My advice: make sure you leave ample space around the plug, and check that all your vents are fully open.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The good:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Brilliant design from Globalscale. As somebody else said, whoever designed that removable socket for corded/plugged needs to have both a raise and a corner office. And despite the point I made above, the single mainboard layout is very well done (and rumour has it there is even an eSata port in there). Those guys have sharp engineers! The whole device itself feels both sturdy, inconspicuous, yet elegant. Even the cardboard packaging the plug is  shipped in is very good design, so much so that  I almost  felt like taking pictures of the packaging. But then I thought, only Apple fanboys ever do something like that...&lt;/li&gt;&lt;li&gt;Does exactly what it says on the tin. The layout design might have changed, but you still get 2 USB ports (1 for debug), 1 SDIO port, 1 Gb Ethernet port and a computer with 512 MB RAM, 512 MB Flash,  a most excellent 1.2 GHz ARM CPU, plus a JTAG device that's compatible with OpenOCD. Who could ask for more?&lt;/li&gt;&lt;li&gt;Can power a 2.5" USB HDD (tested with both a 5400 rpm 100 GB and a 7200 rpm 320 GB HDD). Impressive!&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Loads of free space on the flash with the default Ubuntu installation&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Alright, now it's time for opening the device and posting some pictures! Wait, are you telling me that the first thing you do when receiving a cool new toy is NOT tearing it apart to see what's inside? What on earth are you doing with your life?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Some pictures&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;That very well done removable socket/cord plug concealer&lt;/li&gt;&lt;/ul&gt;&lt;table style="width: auto;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/uHOJtiAqr7TbYP3XqPZwUw?feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_WJDvGbjnsG8/SsX1iACOlLI/AAAAAAAAACw/nCCsECzQXZ0/s800/Image%201.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: arial,sans-serif; font-size: 11px; text-align: right;"&gt;From &lt;a href="http://picasaweb.google.com/redirect.slash.nil/SheevaPlug?feat=embedwebsite"&gt;SheevaPlug&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt; Opening the plug (just remove the rubber pads to find the screws)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;table style="width: auto;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/PJn_mCwa3TtS4KMzVJb9cA?feat=embedwebsite"&gt;&lt;img src="http://lh4.ggpht.com/_WJDvGbjnsG8/SsX1iIjurrI/AAAAAAAAAC0/mhWXIS_KoVQ/s800/Image%202.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: arial,sans-serif; font-size: 11px; text-align: right;"&gt;From &lt;a href="http://picasaweb.google.com/redirect.slash.nil/SheevaPlug?feat=embedwebsite"&gt;SheevaPlug&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;Mainboard - top&lt;/li&gt;&lt;/ul&gt;&lt;table style="width: auto;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/ECwsFd2JPfOjNb8iNPbLlQ?feat=embedwebsite"&gt;&lt;img src="http://lh5.ggpht.com/_WJDvGbjnsG8/SsX1ifqaFNI/AAAAAAAAAC4/tD4zwZczG_s/s800/Image%203.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: arial,sans-serif; font-size: 11px; text-align: right;"&gt;From &lt;a href="http://picasaweb.google.com/redirect.slash.nil/SheevaPlug?feat=embedwebsite"&gt;SheevaPlug&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;Mainboard - underside, with heatsink&lt;/li&gt;&lt;/ul&gt;&lt;table style="width: auto;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/CwH41-UDUt-1RovHp2-pyw?feat=embedwebsite"&gt;&lt;img src="http://lh3.ggpht.com/_WJDvGbjnsG8/SsX1iWD0N6I/AAAAAAAAAC8/-HNnNJz4Hgw/s800/Image%204.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: arial,sans-serif; font-size: 11px; text-align: right;"&gt;From &lt;a href="http://picasaweb.google.com/redirect.slash.nil/SheevaPlug?feat=embedwebsite"&gt;SheevaPlug&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;Mainboard - underside, without heatsink&lt;/li&gt;&lt;/ul&gt;&lt;table style="width: auto;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/lvjQRniYazYx1PYi-0sSmg?feat=embedwebsite"&gt;&lt;img src="http://lh6.ggpht.com/_WJDvGbjnsG8/SsX1ikoK36I/AAAAAAAAADA/d0XGCE_mo20/s800/Image%205.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: arial,sans-serif; font-size: 11px; text-align: right;"&gt;From &lt;a href="http://picasaweb.google.com/redirect.slash.nil/SheevaPlug?feat=embedwebsite"&gt;SheevaPlug&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;The device in action&lt;/li&gt;&lt;/ul&gt;&lt;table style="width: auto;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://picasaweb.google.com/lh/photo/G4zrOEnp1PBckMTVNxmVTg?feat=embedwebsite"&gt;&lt;img src="http://lh6.ggpht.com/_WJDvGbjnsG8/SsX2SlnOslI/AAAAAAAAADE/7h3g_UeQHP4/s800/Image%206.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="font-family: arial,sans-serif; font-size: 11px; text-align: right;"&gt;From &lt;a href="http://picasaweb.google.com/redirect.slash.nil/SheevaPlug?feat=embedwebsite"&gt;SheevaPlug&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5551365348764002705?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5551365348764002705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/sheevaplug-first-impressions.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5551365348764002705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5551365348764002705'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/sheevaplug-first-impressions.html' title='SheevaPlug - first impressions'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_WJDvGbjnsG8/SsX1iACOlLI/AAAAAAAAACw/nCCsECzQXZ0/s72-c/Image%201.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-4960947538961292899</id><published>2009-10-01T19:02:00.011+01:00</published><updated>2009-10-01T21:41:31.978+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='initrd'/><category scheme='http://www.blogger.com/atom/ns#' term='LILO'/><title type='text'>LILO Warning: The initial RAM disk is too big</title><content type='html'>Just re-installed Slackware 13.0 x64 on the HTPC, this time using a small boot partition on the extra non fakeRAIDed HDD, which I recently added to the whole rig. This 4th HDD is now the boot disk for the whole rig, and contains the kernel and initrd (while the Linux partition itself is on the RAID5 set).&lt;br /&gt;&lt;br /&gt;Install went without much of a hitch, and even the first few kernel recompilations we fine, but lately, after adding more kernel features, I got the following LILO warning and the kernel simply doesn't boot:&lt;br /&gt;&lt;pre class="brush: text"&gt;    Warning: The initial RAM disk is too big to fit between the kernel and&lt;br /&gt;   the 15M-16M memory hole.  It will be loaded in the highest memory as&lt;br /&gt;   though the configuration file specified "large-memory" and it will&lt;br /&gt;   be assumed that the BIOS supports memory moves above 16M.&lt;/pre&gt;So much for checking the "Optimizing for size" kernel option.&lt;br /&gt;&lt;br /&gt;The root of the matter seems to be that &lt;b&gt;uncompressed&lt;/b&gt; kernel + &lt;b&gt;uncompressed&lt;/b&gt; initrd must fit within the 0-15 MB low memory addresses, and it looks like a bzipped 4.5 MB kernel + a gzipped 1.4 MB initrd don't cut it, regardless of whether your BIOS has set a hole for the 15M-16M range.&lt;br /&gt;&lt;br /&gt;Unlike what you might read elsewhere ("Remove options from your kernel to reduce its size! / Why are you using such a huge kernel?" - how's that helpful, guys?), there is a solution right there in the kernel conf, through the "General Setup -&gt; Initramfs source file(s)" option.&lt;br /&gt;Somehow when you do that, the kernel is able to find all the RAM it needs for the initrd.&lt;br /&gt;&lt;br /&gt;Now, I'll grant you that this makes it less convenient to modify your initrd options on the fly, yet I believe this is better than being restricted in your choice of kernel features. Plus it appears that the kernel boots a little bit faster when using the emebedded initrd.&lt;br /&gt;&lt;br /&gt;Of course, that means that you need to create your &lt;b&gt;uncompressed&lt;/b&gt; cpio archive from your initrd-tree before you can point to it, which can easily be done as follows:&lt;br /&gt;&lt;pre class="brush: text"&gt;cd /boot/initrd-tree&lt;br /&gt;find . | cpio -H newc -o &gt; ../initrd.cpio&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-4960947538961292899?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/4960947538961292899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/10/lilo-warning-initial-ram-disk-is-too.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4960947538961292899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4960947538961292899'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/10/lilo-warning-initial-ram-disk-is-too.html' title='LILO Warning: The initial RAM disk is too big'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7311022505777507603</id><published>2009-09-18T01:01:00.005+01:00</published><updated>2009-10-30T02:54:40.170Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='duplicate'/><category scheme='http://www.blogger.com/atom/ns#' term='nodes'/><category scheme='http://www.blogger.com/atom/ns#' term='XSL'/><category scheme='http://www.blogger.com/atom/ns#' term='XSLT'/><title type='text'>Grouping XML nodes using XSL 2.0</title><content type='html'>Man, that was painful!!! Curse those XML Committee morons that should have designed a transformation language based on Perl, rather than come with the atrocity that is XSL!&lt;br /&gt;&lt;br /&gt;So, let's say you have the following XML (This is a list of cross references between 8051 banks, custom generated by a popular disassembler), which you already sorted using the other XSL I posted today:&lt;pre class="brush: xml"&gt;&amp;lt;banks&amp;gt;&lt;br /&gt; &amp;lt;B0_000E/&amp;gt;&lt;br /&gt; &amp;lt;B0_000E/&amp;gt;&lt;br /&gt; &amp;lt;B0_000E/&amp;gt;&lt;br /&gt; &amp;lt;B0_000E/&amp;gt;&lt;br /&gt; &amp;lt;B0_49F8/&amp;gt;&lt;br /&gt; &amp;lt;B0_49F8/&amp;gt;&lt;br /&gt; &amp;lt;B0_49F8/&amp;gt;&lt;br /&gt; &amp;lt;B0_49F8/&amp;gt;&lt;br /&gt; &amp;lt;B0_49F8/&amp;gt;&lt;br /&gt; &amp;lt;B0_49F8/&amp;gt;&lt;br /&gt; &amp;lt;B0_520A/&amp;gt;&lt;br /&gt; &amp;lt;B0_520A&amp;gt;&lt;br /&gt;    &amp;lt;BD_2E9D/&amp;gt;&lt;br /&gt;    &amp;lt;BD_C4B5/&amp;gt;&lt;br /&gt; &amp;lt;/B0_520A&amp;gt;&lt;br /&gt; &amp;lt;B0_520A/&amp;gt;&lt;br /&gt; &amp;lt;B0_54F9/&amp;gt;&lt;br /&gt; &amp;lt;B0_54F9/&amp;gt;&lt;br /&gt; &amp;lt;B0_54F9&amp;gt;&lt;br /&gt;    &amp;lt;BB_E851/&amp;gt;&lt;br /&gt; &amp;lt;/B0_54F9&amp;gt;&lt;br /&gt; &amp;lt;B0_54F9/&amp;gt;&lt;br /&gt; &amp;lt;B0_59EC&amp;gt;&lt;br /&gt;    &amp;lt;B0_012F/&amp;gt;&lt;br /&gt; &amp;lt;/B0_59EC&amp;gt;&lt;br /&gt; &amp;lt;B0_59EC&amp;gt;&lt;br /&gt;    &amp;lt;BE_012F/&amp;gt;&lt;br /&gt; &amp;lt;/B0_59EC&amp;gt;&lt;br /&gt; &amp;lt;B0_59EC&amp;gt;&lt;br /&gt;    &amp;lt;BF_012F/&amp;gt;&lt;br /&gt; &amp;lt;/B0_59EC&amp;gt;&lt;br /&gt; &amp;lt;B0_CC5E/&amp;gt;&lt;br /&gt; &amp;lt;B0_CC5E&amp;gt;&lt;br /&gt;    &amp;lt;BC_DAA6/&amp;gt;&lt;br /&gt;    &amp;lt;BC_DF2E/&amp;gt;&lt;br /&gt; &amp;lt;/B0_CC5E&amp;gt;&lt;br /&gt; &amp;lt;B0_CC5E&amp;gt;&lt;br /&gt;    &amp;lt;BB_DA1C/&amp;gt;&lt;br /&gt; &amp;lt;/B0_CC5E&amp;gt;&lt;br /&gt; &amp;lt;B0_CC5E/&amp;gt;&lt;br /&gt;  &amp;lt;B0_E022/&amp;gt;&lt;br /&gt; &amp;lt;B0_E022&amp;gt;&lt;br /&gt;    &amp;lt;BE_E439/&amp;gt;&lt;br /&gt;    &amp;lt;BE_E458/&amp;gt;&lt;br /&gt;    &amp;lt;BE_EE05/&amp;gt;&lt;br /&gt;    &amp;lt;BE_EE28/&amp;gt;&lt;br /&gt;    &amp;lt;BE_F15B/&amp;gt;&lt;br /&gt;    &amp;lt;BE_F17A/&amp;gt;&lt;br /&gt;    &amp;lt;BE_F8E5/&amp;gt;&lt;br /&gt;    &amp;lt;BE_F8F9/&amp;gt;&lt;br /&gt; &amp;lt;/B0_E022&amp;gt;&lt;br /&gt; &amp;lt;B0_E022&amp;gt;&lt;br /&gt;    &amp;lt;BF_3BF0/&amp;gt;&lt;br /&gt;    &amp;lt;BF_6C6B/&amp;gt;&lt;br /&gt;    &amp;lt;BF_7F7E/&amp;gt;&lt;br /&gt;    &amp;lt;BF_7F9D/&amp;gt;&lt;br /&gt;    &amp;lt;BF_7FE0/&amp;gt;&lt;br /&gt;    &amp;lt;BF_7FFF/&amp;gt;&lt;br /&gt;    &amp;lt;BF_CD2C/&amp;gt;&lt;br /&gt;    &amp;lt;BF_D103/&amp;gt;&lt;br /&gt;    &amp;lt;BF_D126/&amp;gt;&lt;br /&gt;    &amp;lt;BF_D146/&amp;gt;&lt;br /&gt;    &amp;lt;BF_D169/&amp;gt;&lt;br /&gt; &amp;lt;/B0_E022&amp;gt;&lt;br /&gt; &amp;lt;B0_E022/&amp;gt;&lt;br /&gt; &amp;lt;B0_E022&amp;gt;&lt;br /&gt;    &amp;lt;BC_CE5A/&amp;gt;&lt;br /&gt; &amp;lt;/B0_E022&amp;gt;&lt;br /&gt; &amp;lt;B0_E022/&amp;gt;&lt;br /&gt; &amp;lt;B0_E022/&amp;gt;&lt;br /&gt; &amp;lt;B0_E201/&amp;gt;&lt;br /&gt; &amp;lt;B0_E201/&amp;gt;&lt;br /&gt;&amp;lt;/banks&amp;gt;&lt;/pre&gt;Obviously now, you would like to move all the sub nodes into a single one and remove all the duplicates to obtain a file like this:&lt;pre class="brush: xml"&gt;&amp;lt;banks&amp;gt;&lt;br /&gt; &amp;lt;B0_000E/&amp;gt;&lt;br /&gt; &amp;lt;B0_49F8/&amp;gt;&lt;br /&gt; &amp;lt;B0_520A&amp;gt;&lt;br /&gt;    &amp;lt;BD_2E9D/&amp;gt;&lt;br /&gt;    &amp;lt;BD_C4B5/&amp;gt;&lt;br /&gt; &amp;lt;/B0_520A&amp;gt;&lt;br /&gt; &amp;lt;B0_54F9&amp;gt;&lt;br /&gt;    &amp;lt;BB_E851/&amp;gt;&lt;br /&gt; &amp;lt;/B0_54F9&amp;gt;&lt;br /&gt; &amp;lt;B0_59EC&amp;gt;&lt;br /&gt;    &amp;lt;B0_012F/&amp;gt;&lt;br /&gt;    &amp;lt;BE_012F/&amp;gt;&lt;br /&gt;    &amp;lt;BF_012F/&amp;gt;&lt;br /&gt; &amp;lt;/B0_59EC&amp;gt;&lt;br /&gt; &amp;lt;B0_CC5E&amp;gt;&lt;br /&gt;    &amp;lt;BC_DAA6/&amp;gt;&lt;br /&gt;    &amp;lt;BC_DF2E/&amp;gt;&lt;br /&gt;    &amp;lt;BB_DA1C/&amp;gt;&lt;br /&gt; &amp;lt;/B0_CC5E&amp;gt;&lt;br /&gt; &amp;lt;B0_E022&amp;gt;&lt;br /&gt;    &amp;lt;BE_E439/&amp;gt;&lt;br /&gt;    &amp;lt;BE_E458/&amp;gt;&lt;br /&gt;    &amp;lt;BE_EE05/&amp;gt;&lt;br /&gt;    &amp;lt;BE_EE28/&amp;gt;&lt;br /&gt;    &amp;lt;BE_F15B/&amp;gt;&lt;br /&gt;    &amp;lt;BE_F17A/&amp;gt;&lt;br /&gt;    &amp;lt;BE_F8E5/&amp;gt;&lt;br /&gt;    &amp;lt;BE_F8F9/&amp;gt;&lt;br /&gt;    &amp;lt;BF_3BF0/&amp;gt;&lt;br /&gt;    &amp;lt;BF_6C6B/&amp;gt;&lt;br /&gt;    &amp;lt;BF_7F7E/&amp;gt;&lt;br /&gt;    &amp;lt;BF_7F9D/&amp;gt;&lt;br /&gt;    &amp;lt;BF_7FE0/&amp;gt;&lt;br /&gt;    &amp;lt;BF_7FFF/&amp;gt;&lt;br /&gt;    &amp;lt;BF_CD2C/&amp;gt;&lt;br /&gt;    &amp;lt;BF_D103/&amp;gt;&lt;br /&gt;    &amp;lt;BF_D126/&amp;gt;&lt;br /&gt;    &amp;lt;BF_D146/&amp;gt;&lt;br /&gt;    &amp;lt;BF_D169/&amp;gt;&lt;br /&gt;    &amp;lt;BC_CE5A/&amp;gt;&lt;br /&gt; &amp;lt;/B0_E022&amp;gt;&lt;br /&gt; &amp;lt;B0_E201/&amp;gt;&lt;br /&gt;&amp;lt;/banks&amp;gt;&lt;/pre&gt;&lt;br /&gt;Well, using the XSL (2.0) below,  now you can!&lt;pre class="brush: xml"&gt;&amp;lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&amp;gt;&lt;br /&gt;&amp;lt;xsl:output omit-xml-declaration="yes" indent="yes"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template match="/"&amp;gt;&lt;br /&gt;  &amp;lt;banks&amp;gt; &amp;lt;!-- Our XML root element. Modify according to yours! --&amp;gt;&lt;br /&gt;    &amp;lt;!-- Select all nodes that are immediate children of our root&lt;br /&gt;         element ("/*/*") and group them according to their node&lt;br /&gt;         names ("local-name()")  --&amp;gt;&lt;br /&gt;    &amp;lt;xsl:for-each-group select="/*/*" group-by="local-name()"&amp;gt;&lt;br /&gt;      &amp;lt;!-- Output a (single) node for each of these groups --&amp;gt;&lt;br /&gt;      &amp;lt;xsl:element name="{local-name()}"&amp;gt;&lt;br /&gt;      &amp;lt;!-- NB: To remove empty nodes, move the &amp;lt;xsl:element&amp;gt;&lt;br /&gt;           section inside the &amp;lt;xsl:for-each-group&amp;gt; below, and use&lt;br /&gt;           {local-name(parent::*)} instead of {local-name()} --&amp;gt;&lt;br /&gt;        &amp;lt;!-- Select all the children nodes from the above group&lt;br /&gt;             ("current-group()/*) - Don't bother to group them. --&amp;gt;&lt;br /&gt;        &amp;lt;xsl:for-each-group select="current-group()/*" group-by="."&amp;gt;&lt;br /&gt;          &amp;lt;!-- Here we copy the whole (group) branch as is --&amp;gt;&lt;br /&gt;          &amp;lt;xsl:copy-of select="current-group()"/&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:for-each-group&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:element&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:for-each-group&amp;gt;&lt;br /&gt;  &amp;lt;/banks&amp;gt; &amp;lt;!-- Close our root --&amp;gt;&lt;br /&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7311022505777507603?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7311022505777507603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/09/grouping-xml-nodes-using-xsl-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7311022505777507603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7311022505777507603'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/09/grouping-xml-nodes-using-xsl-20.html' title='Grouping XML nodes using XSL 2.0'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-2372900201910261415</id><published>2009-09-17T19:25:00.004+01:00</published><updated>2009-09-17T20:45:10.368+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VISTA'/><category scheme='http://www.blogger.com/atom/ns#' term='Backwards Security'/><category scheme='http://www.blogger.com/atom/ns#' term='VirtualStore'/><title type='text'>Now, Vista, where's my file actually?</title><content type='html'>If security done backwards is better than no security at all, then Microsoft are the kings of running in reverse.&lt;br /&gt;&lt;br /&gt;You might have used some programs to edit files in "System" directories, only to wonder why the files that are there don't reflect your changes. &lt;br /&gt;The answer is that, when Microsoft is unhappy about the location you edit a file in (eg: C:\Program Files (x86)\&amp;lt;some program&gt;\&amp;lt;some file&amp;gt;), it creates a duplicate in C:\Users\&amp;lt;your user name&amp;gt;\AppData\Local\VirtualStore\ (eg: C:\Users&amp;lt;your user name&amp;gt;\AppData\Local\VirtualStore\Program Files (x86)\&amp;lt;some program&amp;gt;\&amp;lt;some file&amp;gt;).&lt;br /&gt;&lt;br /&gt;Pretty sure that having 2 copies of one file is gonna be a thrill for people who want to backup their data...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-2372900201910261415?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/2372900201910261415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/09/now-vista-wheres-my-file-actually.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2372900201910261415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2372900201910261415'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/09/now-vista-wheres-my-file-actually.html' title='Now, Vista, where&apos;s my file actually?'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1437247053344568212</id><published>2009-09-17T17:11:00.003+01:00</published><updated>2009-09-17T17:19:19.162+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='brushes'/><category scheme='http://www.blogger.com/atom/ns#' term='SyntaxHighlighter'/><title type='text'>...and the class blurb for SyntaxHighlighter</title><content type='html'>Great tool that &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter"&gt;SyntaxHighlighter&lt;/a&gt;. Followed &lt;a href="http://spenthil.com/2009/04/12/syntaxhighlighter-2-0-on-blogger/#"&gt;this post&lt;/a&gt; and got exactly what's written on the tin.&lt;br /&gt;&lt;br /&gt;Now, since I'm of a forgetful nature,  the syntax for the &amp;lt;pre&amp;gt; modifier is &amp;lt;pre class="brush: &amp;lt;brushname&amp;gt;"&amp;gt; where &amp;lt;brushname&amp;gt; is one of text, bash, xml, cpp or any of the keywords highlighted &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1437247053344568212?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1437247053344568212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/09/and-class-blurb-for-syntaxhighlighter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1437247053344568212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1437247053344568212'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/09/and-class-blurb-for-syntaxhighlighter.html' title='...and the class blurb for SyntaxHighlighter'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1959920459658151617</id><published>2009-09-17T15:58:00.008+01:00</published><updated>2009-09-17T20:45:41.502+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='ULTRAEDIT'/><category scheme='http://www.blogger.com/atom/ns#' term='code'/><category scheme='http://www.blogger.com/atom/ns#' term='Macro'/><title type='text'>...and the UltraEdit Macro script to convert code for blogger publishing</title><content type='html'>Courtesy of &lt;a href="http://robertmarkbramprogrammer.blogspot.com/2008/09/ultraedit-macro-act-on-selected-text-or.html"&gt;Rob&lt;/a&gt;, to which I added the &amp;amp; -&gt; &amp;amp;amp; conversion:&lt;br /&gt;&lt;pre class="brush: text"&gt;InsertMode&lt;br /&gt;ColumnModeOff&lt;br /&gt;HexOff&lt;br /&gt;UnixReOff&lt;br /&gt;IfSel&lt;br /&gt;Find SelectText "&amp;amp;"&lt;br /&gt;Replace All "&amp;amp;amp;"&lt;br /&gt;Find SelectText "&amp;lt;"&lt;br /&gt;Replace All "&amp;amp;lt;"&lt;br /&gt;Find SelectText "&amp;gt;"&lt;br /&gt;Replace All "&amp;amp;gt;"&lt;br /&gt;Find SelectText """&lt;br /&gt;Replace All "&amp;amp;quot;"&lt;br /&gt;Find SelectText "^t"&lt;br /&gt;Replace All "  "&lt;br /&gt;Else&lt;br /&gt;GotoLine 1 1&lt;br /&gt;Find "&amp;amp;"&lt;br /&gt;Replace All "&amp;amp;amp;"&lt;br /&gt;Find "&amp;lt;"&lt;br /&gt;Replace All "&amp;amp;lt;"&lt;br /&gt;Find "&amp;gt;"&lt;br /&gt;Replace All "&amp;amp;gt;"&lt;br /&gt;Find """&lt;br /&gt;Replace All "&amp;amp;quot;"&lt;br /&gt;Find "^t"&lt;br /&gt;Replace All "  "&lt;br /&gt;EndIf&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1959920459658151617?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1959920459658151617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/09/and-ultraedit-macro-script-to-convert.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1959920459658151617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1959920459658151617'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/09/and-ultraedit-macro-script-to-convert.html' title='...and the UltraEdit Macro script to convert code for blogger publishing'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-4599793143606776376</id><published>2009-09-17T15:35:00.015+01:00</published><updated>2009-09-17T21:09:39.267+01:00</updated><title type='text'>XSLT script to sort nodes alphabetically</title><content type='html'>The simple XSL sample you have been looking for. Works great with Saxon. "version" set to 2.0 here to prevent a warning with the latest version of Saxon, but you can change it to 1.0 for older XSLT engines.&lt;br /&gt;&lt;pre class="brush: xml"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:stylesheet version=&amp;quot;2.0&amp;quot; xmlns:xsl=&amp;quot;http://www.w3.org/1999/XSL/Transform&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;xsl:output omit-xml-declaration=&amp;quot;no&amp;quot; indent=&amp;quot;yes&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;xsl:strip-space elements=&amp;quot;*&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template match=&amp;quot;/&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;xsl:apply-templates /&amp;gt;&lt;br /&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template match=&amp;quot;@*|node()&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;xsl:copy&amp;gt;&lt;br /&gt;    &amp;lt;xsl:apply-templates select=&amp;quot;@*|node()&amp;quot;&amp;gt;&lt;br /&gt;      &amp;lt;xsl:sort select=&amp;quot;@typeName&amp;quot;/&amp;gt;&lt;br /&gt;      &amp;lt;xsl:sort select=&amp;quot;name(.)&amp;quot;/&amp;gt;&lt;br /&gt;      &amp;lt;xsl:sort /&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:apply-templates&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:copy&amp;gt;&lt;br /&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Oh, and the saxon commandline syntax to apply an XSL (which should really be provided in a straightforward fashion in the commandline help) is:&lt;br /&gt;&lt;pre class="brush: text"&gt;C:\&amp;gt;saxon -s:banks.xml -xsl:sort.xsl -o:banks_sorted.xml&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-4599793143606776376?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/4599793143606776376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/09/xslt-script-to-sort-nodes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4599793143606776376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4599793143606776376'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/09/xslt-script-to-sort-nodes.html' title='XSLT script to sort nodes alphabetically'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-3840718650607082583</id><published>2009-09-16T15:06:00.004+01:00</published><updated>2009-09-17T17:01:23.445+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C2039. Visual C++'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>.NET, or the solution to a problem that didn't exist</title><content type='html'>So, you're using Visual Studio Express and you want to use that supposedly nice SerialPort .NET class (after spending more than half a day trying to make a standard COM port app that can talk nicely to putty - hint: don't rely on anything else but putty's actual port initialization code if you want something that works!).&lt;br /&gt;&lt;br /&gt;And yeah, you're like me, so you don't care much about whatever the hell .NET brings to the OO paradigm. You just want to use a class that works ASAP, so you followed the tutorials on the net that tell you: "Just add a 'using namespace System::IO::Ports;' and then you can define a SerialPort instance", which you promptly did.&lt;br /&gt;&lt;br /&gt;But now, of course, you're getting the bleeping error:&lt;pre&gt;error C2039: 'Ports' : is not a member of 'System::IO'&lt;/pre&gt;Yeah, that's because with all this supposedly improved technology, Visual Studio is still not able to tell you that you need to add a&lt;br /&gt;&lt;pre&gt;#include "system.dll"&lt;/pre&gt;&lt;br /&gt;before you can see &lt;span style="font-weight: bold;"&gt;ALL&lt;/span&gt; of the System namespace. "Intellisense", my ass!&lt;br /&gt;&lt;br /&gt;In short: C0239 = need to add a #include to a dll (?!?, when did that become a C++ standard) BEFORE you can start using "using namespace"&lt;br /&gt;&lt;br /&gt;Oh, and good luck figuring that one out if you don't (want to) have a clue about .NET...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-3840718650607082583?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/3840718650607082583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/09/net-or-solution-to-problem-that-didnt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3840718650607082583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3840718650607082583'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/09/net-or-solution-to-problem-that-didnt.html' title='.NET, or the solution to a problem that didn&apos;t exist'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5794263530491028969</id><published>2009-08-28T11:05:00.008+01:00</published><updated>2009-09-17T16:57:00.394+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firmware'/><category scheme='http://www.blogger.com/atom/ns#' term='8051'/><category scheme='http://www.blogger.com/atom/ns#' term='8032'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='Mediatek'/><title type='text'>More 8032 / 8051 trickery</title><content type='html'>Don't worry, the (serial) printf handler is coming. In the meantime, some more hard to spot Mediatek 8032/8051 (Geez, couldn't at least agree on the base architecture name, and use declinations that make sense?) compiler trickery with lcall:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: text"&gt;ROM:C32C                 lcall   ROM_B613&lt;br /&gt;ROM:C32F                 lcall   copy_4_bytes_to_xRAM ; input: DPTR = dest xRAM address&lt;br /&gt;ROM:C32F                                         ;        PC   = src bytes address&lt;br /&gt;ROM:C32F ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:C332                 .byte 0x00,0xC,0x00,0x00         ; 0&lt;br /&gt;ROM:C336 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:C336                 mov     DPTR, #0xFFFC&lt;br /&gt;ROM:C339                 lcall   ROM_B613&lt;br /&gt;ROM:C33C                 lcall   copy_4_bytes_to_xRAM ; input: DPTR = dest xRAM address&lt;br /&gt;ROM:C33C                                         ;        PC   = src bytes address&lt;br /&gt;ROM:C33C ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:C33F                 .byte 0,0xC,0,0         ; 0&lt;br /&gt;ROM:C343 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:C343                 mov     R6, #0x12&lt;br /&gt;ROM:C345                 mov     R7, #0&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When people extensively start/have to use instructions in other ways than they were designed for (shouldn't all  lcalls' return flow of execution pcik up right after the instruction itself?), you know that you have a poorly designed CPU, no matter what people manage to achieve with it.&lt;br /&gt;&lt;br /&gt;Yeah, it's another lcall'ed function that doesn't return where it's supposed to and breaks our nice disassembly flow. Thanks for making us having to manually edit our subroutine ends in IDA Pro, morons!&lt;br /&gt;&lt;br /&gt;So, how does it work this time? Similarly to the previous trick actually:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: text"&gt;ROM:B498 ; =============== S U B R O U T I N E =======================================&lt;br /&gt;ROM:B498&lt;br /&gt;ROM:B498 ; input: DPTR = dest xRAM address&lt;br /&gt;ROM:B498 ;        PC   = src bytes address&lt;br /&gt;ROM:B498&lt;br /&gt;ROM:B498 copy_4_bytes_to_xRAM:                   ; CODE XREF: ROM:2A49p&lt;br /&gt;ROM:B498                                         ; ROM:2A77p ...&lt;br /&gt;ROM:B498                 mov     R0, DPL&lt;br /&gt;ROM:B49A                 mov     B, DPH          ; DPTRd [DPHd DPLd] -&gt; B R0 = Dest Pointer&lt;br /&gt;ROM:B49D                 pop     DPH&lt;br /&gt;ROM:B49F                 pop     DPL             ; DPTRs [DPHs DPLs] = Src Pointer&lt;br /&gt;ROM:B4A1                 lcall   copy_byte&lt;br /&gt;ROM:B4A4                 lcall   copy_byte&lt;br /&gt;ROM:B4A7                 lcall   copy_byte&lt;br /&gt;ROM:B4AA                 lcall   copy_byte&lt;br /&gt;ROM:B4AD                 clr     A&lt;br /&gt;ROM:B4AE                 jmp     @A+DPTR         ; DPTRs (= original return PC) has&lt;br /&gt;ROM:B4AE ; End of function copy_4_bytes_to_xRAM  ; been incremented 4 times at this stage&lt;br /&gt;ROM:B4AE&lt;br /&gt;ROM:B4AF&lt;br /&gt;ROM:B4AF ; =============== S U B R O U T I N E =======================================&lt;br /&gt;ROM:B4AF&lt;br /&gt;ROM:B4AF&lt;br /&gt;ROM:B4AF copy_byte:                              ; CODE XREF: copy_4_bytes_to_xRAM+9p&lt;br /&gt;ROM:B4AF                                         ; copy_4_bytes_to_xRAM+Cp ...&lt;br /&gt;ROM:B4AF                 clr     A&lt;br /&gt;ROM:B4B0                 movc    A, @A+DPTR      ; read [DPTRs]&lt;br /&gt;ROM:B4B1                 inc     DPTR            ; DPTRs++ (as well as [DPTRs] -&gt; A)&lt;br /&gt;ROM:B4B2                 xch     A, DPH&lt;br /&gt;ROM:B4B4                 xch     A, B            ; DPTRs &lt;-&gt; DPTRd (B R0)&lt;br /&gt;ROM:B4B6                 xch     A, DPH&lt;br /&gt;ROM:B4B8                 xch     A, R0&lt;br /&gt;ROM:B4B9                 xch     A, DPL&lt;br /&gt;ROM:B4BB                 xch     A, R0           ; A is still [DPTRs] at this stage&lt;br /&gt;ROM:B4BC                 movx    @DPTR, A        ; [DPTRs] -&gt; [DPTRd]&lt;br /&gt;ROM:B4BD                 inc     DPTR            ; DPTRd++&lt;br /&gt;ROM:B4BE                 xch     A, DPH          ; DPTRs &lt;-&gt; DPTRd&lt;br /&gt;ROM:B4C0                 xch     A, B&lt;br /&gt;ROM:B4C2                 xch     A, DPH&lt;br /&gt;ROM:B4C4                 xch     A, R0&lt;br /&gt;ROM:B4C5                 xch     A, DPL&lt;br /&gt;ROM:B4C7                 xch     A, R0&lt;br /&gt;ROM:B4C8                 ret&lt;br /&gt;ROM:B4C8 ; End of function copy_byte&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Gotta love these scores of xch instructions. Kind of the 3 cups &amp;amp; one red ball street magician classic. The only thing you need to know though, is that all a sequence like the following 3 lines does:&lt;br /&gt;&lt;pre class="brush: text"&gt;xch A, register1&lt;br /&gt;xch A, register2&lt;br /&gt;xch A, register1&lt;/pre&gt;&lt;br /&gt;is simply exchanging the content of register 1 &amp;amp; register 2, and keeping A unchanged.&lt;br /&gt;&lt;br /&gt;I won't say this isn't a nice trick to access a small amount of data right within your program, but I'll take my general purpose register generous 68000 any time over your crappy 8051. It's a wonder really: How comes there are so few consumer devices using embedded 68000, when it would be so much more efficient for embedded applications? If you're gonna play with these kind of intel x32/x51 hurdles, it won't be that much different to go RISC all the way!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5794263530491028969?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5794263530491028969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/08/more-8032-8051-trickery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5794263530491028969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5794263530491028969'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/08/more-8032-8051-trickery.html' title='More 8032 / 8051 trickery'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-4593222980693136078</id><published>2009-08-26T16:59:00.004+01:00</published><updated>2009-09-17T17:26:01.071+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='8051'/><category scheme='http://www.blogger.com/atom/ns#' term='IDA Pro'/><category scheme='http://www.blogger.com/atom/ns#' term='search'/><title type='text'>Search for low pointer values in IDA Pro</title><content type='html'>Use the following regexp: &lt;pre class="brush: text"&gt;DPTR, #0x[0-9A-F]{3}$&lt;/pre&gt;&lt;br /&gt;This will lock only on DPTR assignment values in 0x0000 0x0FFF&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-4593222980693136078?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/4593222980693136078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/08/search-for-low-pointer-values-in-ida.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4593222980693136078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4593222980693136078'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/08/search-for-low-pointer-values-in-ida.html' title='Search for low pointer values in IDA Pro'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-8348925906528742712</id><published>2009-08-26T12:55:00.005+01:00</published><updated>2009-09-17T16:58:16.888+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firmware'/><category scheme='http://www.blogger.com/atom/ns#' term='switch statement'/><category scheme='http://www.blogger.com/atom/ns#' term='8051'/><category scheme='http://www.blogger.com/atom/ns#' term='disassembly'/><category scheme='http://www.blogger.com/atom/ns#' term='8032'/><category scheme='http://www.blogger.com/atom/ns#' term='reverse engineering'/><title type='text'>Switch statements, 8032/8051 style</title><content type='html'>Now this next trick is a little bit more clever.&lt;br /&gt;&lt;br /&gt;If, when disassembling 8032 / 8051 code, you ever see the start of an lcall'ed routine that looks like this&lt;br /&gt;&lt;pre class="brush: text"&gt;ROM:0000B5BA                 pop     DPH             ; Data Pointer, High Byte&lt;br /&gt;ROM:0000B5BC                 pop     DPL             ; Data Pointer, Low Byte&lt;/pre&gt;and then proceeds to use DPTR for movc instructions, the effective DPTR address used in that routine will be the next address after the LCALL (because  lcall did push the current PC on the stack)&lt;br /&gt;&lt;br /&gt;This is effectively used by, hum, some code, to implement switch statements that might be a bit tricky to detect during reverse engineering, as the disassembler obviously expect lcall to return, and will start disassembly the switch table.&lt;br /&gt;&lt;br /&gt;Example code:&lt;br /&gt;&lt;pre class="brush: text"&gt;ROM:00006CA7 ROM_6CA7:                               ; CODE XREF: ROM_6C60+15j&lt;br /&gt;ROM:00006CA7                                         ; ROM_6C60+1Bj ...&lt;br /&gt;ROM:00006CA7                 mov     DPTR, #0xC46A&lt;br /&gt;ROM:00006CAA                 movx    A, @DPTR&lt;br /&gt;ROM:00006CAB                 xrl     A, #0x60&lt;br /&gt;ROM:00006CAD                 jnz     ROM_6CF4&lt;br /&gt;ROM:00006CAF                 mov     DPTR, #0xB03E&lt;br /&gt;ROM:00006CB2                 movx    A, @DPTR&lt;br /&gt;ROM:00006CB3                 lcall   case_switch_byte&lt;br /&gt;ROM:00006CB3 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:00006CB6                 .word ROM_6CE4&lt;br /&gt;ROM:00006CB8                 .byte 0&lt;br /&gt;ROM:00006CB9                 .word ROM_6CE4&lt;br /&gt;ROM:00006CBB                 .byte 0x20&lt;br /&gt;ROM:00006CBC                 .word ROM_6CE0&lt;br /&gt;ROM:00006CBE                 .byte 0x2A&lt;br /&gt;ROM:00006CBF                 .word ROM_6CDC&lt;br /&gt;ROM:00006CC1                 .byte 0x2B&lt;br /&gt;ROM:00006CC2                 .word ROM_6CDE&lt;br /&gt;ROM:00006CC4                 .byte 0x2D&lt;br /&gt;ROM:00006CC5                 .word ROM_6CE2&lt;br /&gt;ROM:00006CC7                 .byte 0x2F&lt;br /&gt;ROM:00006CC8                 .word ROM_6CDA&lt;br /&gt;ROM:00006CCA                 .byte 0x39&lt;br /&gt;ROM:00006CCB                 .word ROM_6CD2&lt;br /&gt;ROM:00006CCD                 .byte 0x5A&lt;br /&gt;ROM:00006CCE                 .word 0&lt;br /&gt;ROM:00006CD0                 .word 0x6CEC&lt;br /&gt;ROM:00006CD2 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:00006CD2&lt;br /&gt;ROM:00006CD2 ROM_6CD2:                               ; DATA XREF: ROM_6C60+6Bo&lt;br /&gt;ROM:00006CD2                 mov     DPTR, #0xB03E&lt;br /&gt;ROM:00006CD5                 mov     A, #0x30 ; '0'&lt;br /&gt;ROM:00006CD7                 movx    @DPTR, A&lt;br /&gt;ROM:00006CD8                 sjmp    ROM_6D54&lt;br /&gt;ROM:00006CDA ; ---------------------------------------------------------------------------&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;with case_switch_byte being:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: text"&gt;ROM:B5BA&lt;br /&gt;ROM:B5BA ; =============== S U B R O U T I N E =======================================&lt;br /&gt;ROM:B5BA&lt;br /&gt;ROM:B5BA ; Iput: A = matching case value (byte)&lt;br /&gt;ROM:B5BA&lt;br /&gt;ROM:B5BA case_switch_byte:                       ; CODE XREF: ROM:4046p&lt;br /&gt;ROM:B5BA                                         ; ROM_4552+178p ...&lt;br /&gt;ROM:B5BA                 pop     DPH             ; Data Pointer, High Byte&lt;br /&gt;ROM:B5BC                 pop     DPL             ; DPTR = lcall return address&lt;br /&gt;ROM:B5BE                 mov     R0, A&lt;br /&gt;ROM:B5BF&lt;br /&gt;ROM:B5BF loop_through_cases:                     ; CODE XREF: case_switch_byte+24j&lt;br /&gt;ROM:B5BF                 clr     A&lt;br /&gt;ROM:B5C0                 movc    A, @A+DPTR      ; NB: @ is confusing. It's just A+DPTR&lt;br /&gt;ROM:B5C1                 jnz     valid_dest      ; make sure dest @ != 0&lt;br /&gt;ROM:B5C3                 mov     A, #1&lt;br /&gt;ROM:B5C5                 movc    A, @A+DPTR&lt;br /&gt;ROM:B5C6                 jnz     valid_dest&lt;br /&gt;ROM:B5C8                 inc     DPTR&lt;br /&gt;ROM:B5C9                 inc     DPTR            ; if null dest, just use the next&lt;br /&gt;ROM:B5C9                                         ; word as dest address&lt;br /&gt;ROM:B5CA&lt;br /&gt;ROM:B5CA dest_match:                             ; CODE XREF: case_switch_byte+1Fj&lt;br /&gt;ROM:B5CA                 movc    A, @A+DPTR&lt;br /&gt;ROM:B5CB                 mov     R0, A&lt;br /&gt;ROM:B5CC                 mov     A, #1&lt;br /&gt;ROM:B5CE                 movc    A, @A+DPTR&lt;br /&gt;ROM:B5CF                 mov     DPL, A          ; Data Pointer, Low Byte&lt;br /&gt;ROM:B5D1                 mov     DPH, R0         ; dest into DPTR&lt;br /&gt;ROM:B5D3                 clr     A&lt;br /&gt;ROM:B5D4                 jmp     @A+DPTR&lt;br /&gt;ROM:B5D5 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:B5D5&lt;br /&gt;ROM:B5D5 valid_dest:                             ; CODE XREF: case_switch_byte+7j&lt;br /&gt;ROM:B5D5                                         ; case_switch_byte+Cj&lt;br /&gt;ROM:B5D5                 mov     A, #2&lt;br /&gt;ROM:B5D7                 movc    A, @A+DPTR&lt;br /&gt;ROM:B5D8                 xrl     A, R0           ; cmp val with parameter&lt;br /&gt;ROM:B5D9                 jz      dest_match&lt;br /&gt;ROM:B5DB                 inc     DPTR&lt;br /&gt;ROM:B5DC                 inc     DPTR&lt;br /&gt;ROM:B5DD                 inc     DPTR            ; skip 3 bytes to next switch table entry&lt;br /&gt;ROM:B5DE                 sjmp    loop_through_cases&lt;br /&gt;ROM:B5DE ; End of function case_switch_byte&lt;br /&gt;ROM:B5DE&lt;br /&gt;ROM:B5E0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The same kind of routine also exists for a word parameter instead of a byte.&lt;br /&gt;Most of the time, the case values will follow some kind of logical order, so if you see a bunch of sequencing bytes of word, interlaced with what look like offsets, and preceded by an lcall, you might want to chack what's on the other end of that lcall.&lt;br /&gt;&lt;br /&gt;OR, the preferred way once you have made your initial pass at identifying code, look for a function that starts by popping DPH and DPL, and seek all the lcalls that cross reference to it to identify the switch tables.&lt;br /&gt;&lt;br /&gt;Oh, and for those who might wonder, of course, as soon as you pop the PC address that's been enqueued on the stack, the lcall never returns, and becomes exactly like a jump.&lt;br /&gt;&lt;br /&gt;Coming next: How the hell are these bloody strings and other data sitting in standalone data sections referenced, where there does not appear to be any obvious address referencing to them anywhere in the disassembly...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-8348925906528742712?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/8348925906528742712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/08/switch-statements-80328051-style.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8348925906528742712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8348925906528742712'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/08/switch-statements-80328051-style.html' title='Switch statements, 8032/8051 style'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-2194234880722463233</id><published>2009-08-24T16:49:00.015+01:00</published><updated>2009-09-17T16:58:59.758+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Samsung'/><category scheme='http://www.blogger.com/atom/ns#' term='8051'/><category scheme='http://www.blogger.com/atom/ns#' term='LCD'/><category scheme='http://www.blogger.com/atom/ns#' term='MT8226'/><category scheme='http://www.blogger.com/atom/ns#' term='fimrware'/><category scheme='http://www.blogger.com/atom/ns#' term='8032'/><category scheme='http://www.blogger.com/atom/ns#' term='multiple banks'/><category scheme='http://www.blogger.com/atom/ns#' term='switching'/><title type='text'>Now I remember why I hate the 8032...</title><content type='html'>...and pretty much EVERY CPU designed by intel, ever.&lt;br /&gt;&lt;br /&gt;It's not like they could have turned a 16 bit CPU into a 24 or 32 bit addressing one, because that's way harder to do than extending the 32 bit x86 to 64 bit for instance (or the original 16 bit x86 to 32 bit)...&lt;br /&gt;&lt;br /&gt;"Look Ma! It's a flock of randomly chosen flying search engine terms to direct &lt;span style="font-style: italic;"&gt;a certain kind of people&lt;/span&gt; here!": &lt;span style="font-style: italic;"&gt;Mediatek, MT8226, 8226, LCD, Samsung, 8032, 8051, MT13x9, bank, page, 0xFFFF, reverse engineering, firmware.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The usual trick, apparently originally devised by Philips, is to use one of the 8032 ports (usually P1) as an extention of the 16 bit address bus, thus acting as a ROM bank selector =&gt; if you use 8 bits of that port, you now have 24 bit addressing.&lt;br /&gt;&lt;br /&gt;Of course, this doesn't mean that your PC will suddenly become 24 bit aware, and since it still remains 16 bit, you need to have overlap code, for each of your 64 KB banks ([0000-FFFF]) so that, as far as the CPU is concerned, the same bank is still being used.&lt;br /&gt;&lt;br /&gt;This usually results in LOADS AND LOADS of ROM space wasted with the following kind of crap:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: text"&gt;ROM:8301 ; --------------------------------------------------------------------------&lt;br /&gt;ROM:8301                 mov     DPTR, #0x7E2D&lt;br /&gt;ROM:8304                 ljmp    bank_0E&lt;br /&gt;ROM:8307 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:8307                 mov     DPTR, #0xE4D1&lt;br /&gt;ROM:830A                 ljmp    bank_0B&lt;br /&gt;ROM:830D ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:830D                 mov     DPTR, #0xF51E&lt;br /&gt;ROM:8310                 ljmp    bank_0F&lt;br /&gt;ROM:8313 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:8313                 mov     DPTR, #0xFA0D&lt;br /&gt;ROM:8316                 ljmp    bank_0F&lt;br /&gt;ROM:8319 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:8319                 mov     DPTR, #0xF924&lt;br /&gt;ROM:831C                 ljmp    bank_0F&lt;br /&gt;ROM:831F ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:831F                 mov     DPTR, #0xFDA7&lt;br /&gt;ROM:8322                 ljmp    bank_0D&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;with the bank switching function of the like:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: text"&gt;ROM:8288 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:8288 bank_0E:                                ; CODE XREF: ROM:84F6j&lt;br /&gt;ROM:8288                                         ; ROM:852Cj ...&lt;br /&gt;ROM:8288                 mov     A, P1           ; Port 1&lt;br /&gt;ROM:828A                 anl     A, #0xF         ; 8 bits for high addressing =&gt; 16 banks&lt;br /&gt;ROM:828C                 cjne    A, #0xE, ROM_8291 ; bank 15 (0x0E)&lt;br /&gt;ROM:828F                 clr     A&lt;br /&gt;ROM:8290                 jmp     @A+DPTR&lt;br /&gt;ROM:8291 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:8291 ROM_8291:                               ; CODE XREF: ROM:828Cj&lt;br /&gt;ROM:8291                 swap    A&lt;br /&gt;ROM:8292                 rr      A&lt;br /&gt;ROM:8293                 push    ACC             ; Accumulator&lt;br /&gt;ROM:8295                 mov     A, #0xBF ; '+'&lt;br /&gt;ROM:8297                 push    ACC             ; Accumulator&lt;br /&gt;ROM:8299                 push    DPL             ; Data Pointer, Low Byte&lt;br /&gt;ROM:829B                 push    DPH             ; Data Pointer, High Byte&lt;br /&gt;ROM:829D                 ljmp    ROM_BF70&lt;br /&gt;ROM:82A0 ; ---------------------------------------------------------------------------&lt;br /&gt;(...)&lt;br /&gt;ROM:BF70 ; ---------------------------------------------------------------------------&lt;br /&gt;ROM:BF70 ROM_BF70:                               ; CODE XREF: ROM:829Dj&lt;br /&gt;ROM:BF70                 anl     P1, #0xF0       ; Go trough bank 0&lt;br /&gt;ROM:BF73                 orl     P1, #0xE        ; Set the high address lines to bank 0x0E on Port 1&lt;br /&gt;ROM:BF76                 ret&lt;br /&gt;ROM:BF76 ; ---------------------------------------------------------------------------&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As indicated above, each bank has to DUPLICATE this whole bank switching business at the exact same address. And there will be a short period where code is actually ran in Bank 0 (right after the "anl P1, #0xF0") before switching to the actual destination bank (here Bank 0Eh)&lt;br /&gt;&lt;br /&gt;Only thing I can say is, seeing how crappy a CPU it is (don't get me started about how poorly optimized all the 8032 code I see seems to be), licensing for the 8032 must come really REALLY cheap!&lt;br /&gt;&lt;br /&gt;But then again, having SoC makers like MediaTek design their systems on the cheap might have its advantages...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-2194234880722463233?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/2194234880722463233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/08/now-i-remember-why-i-hate-8032.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2194234880722463233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2194234880722463233'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/08/now-i-remember-why-i-hate-8032.html' title='Now I remember why I hate the 8032...'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7326190213206083347</id><published>2009-07-23T17:14:00.006+01:00</published><updated>2009-08-28T11:41:39.033+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='MediaShield'/><category scheme='http://www.blogger.com/atom/ns#' term='RAID'/><category scheme='http://www.blogger.com/atom/ns#' term='nVIDIA'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Why does windows find the need to modify the partition table at boot...</title><content type='html'>...or how I almost lost 1.5 TB of data today.&lt;br /&gt;&lt;br /&gt;If you use software/fake RAID, this might happen to you too.&lt;br /&gt;&lt;br /&gt;See, this morning I thought I would upgrade my HTPC's BIOS just for the heck of it. This is the PC that has a 2TB RAID5 array based on nVIDIA's MediaShield.&lt;br /&gt;Now, despite what I had selected during the BIOS update, the BIOS settings and DMI data were reset after reboot, which means that the HDDs were back to individual IDE emulated drives, rather than members of the RAID array.&lt;br /&gt;&lt;br /&gt;Normally, this wouldn't be a big deal, except that, before I cancelled the Windows boot, it was apparently able to look at the disks (using the MediaShield driver), find out that the capacity of the disk it was booting from (now a single 1TB IDE/AHCI HDD) was less than the capacity reported in the partition table, and &lt;span style="font-weight: bold;"&gt;re-write&lt;/span&gt; the partition table of HDD1 to reduce the dimensions of the last partition.&lt;br /&gt;&lt;br /&gt;Of course, re-writting a partition table &lt;span style="font-weight: bold;"&gt;without anybody asking you to&lt;/span&gt; is the shortest way to screw up a disk or RAID array, and screw up it did: As soon as I restored the RAID settings in the BIOS and booted Windows, my 1.5 TB data partition was now identified as unformatted and gone! Talk about massive data loss...&lt;br /&gt;&lt;br /&gt;No respectable O/S should ever modify a partition table without asking the user first. It's just common sense: The O/S is never, and I have to stress out that part, NOT EVER, smarter than its user (no matter what the O/S developers might think, or how smart they think they are themselves). You do not modify a partition table without asking, EVER, it's really simple as that!&lt;br /&gt;&lt;br /&gt;Now, after much cursing, and some accidental good luck, I found that if the first drive was disconnected from the RAID5 array (which happened accidentally as I was trying to invert HDD#2 and HDD#3, since it originally looked like the BIOS upgrade has modified the SATA IDs), the rest of the array booted fine, albeit in degraded mode, and saw the old 1.5 TB data partition alright. Definitely makes sense with the fact that Windows would of course only have modified the partition table of the boot drive while the HDDs were in IDE mode.&lt;br /&gt;But of course, as soon as you remove one drive from your RAID5 array, and boot in degraded mode, the array will flag that drive as failed on next reboot&lt;br /&gt;&lt;br /&gt;From there on, the solution is to re-add the drive to the array to resync. Takes a while, but if you trust your other disks not to fail duing the super-lengthy re-sync, probably the safest solution.&lt;br /&gt;Otherwise, it's probably a good idea to have a copy of the Master Boot Record (i.e. the first 512 bytes) of every single drive from your array, and restore it &lt;span style="font-weight: bold;"&gt;using a decent O/S like Linux&lt;/span&gt;. Plus, as experience will show you time and again, it's also always good practice to keep a copy of the MBRs of all your disks that contain important data, so that you can try to address any kind of partition formatting catastrophe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7326190213206083347?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7326190213206083347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/07/why-does-windows-find-need-to-modify.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7326190213206083347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7326190213206083347'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/07/why-does-windows-find-need-to-modify.html' title='Why does windows find the need to modify the partition table at boot...'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-3268664108768621854</id><published>2009-07-20T10:03:00.004+01:00</published><updated>2011-07-16T00:44:54.860+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='International Domain Name'/><category scheme='http://www.blogger.com/atom/ns#' term='IE'/><category scheme='http://www.blogger.com/atom/ns#' term='spoofing'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Displaying International Domain Names in the browser's address bar</title><content type='html'>&lt;ul&gt;&lt;li&gt;In IE (&gt;7): Tools -&gt; Internet Options -&gt; Advanced -&gt; International -&gt; Always show encoded addresses -&gt; &lt;span style="font-weight: bold;"&gt;Un&lt;/span&gt;check&lt;br /&gt;A typical "All or nothing" Microsoft solution to a problem that demands a smart approach. Well done Redmond!&lt;/li&gt;&lt;li&gt;In Firefox (from &lt;a href="http://marcblanchet.blogspot.com/2007/02/using-internationalized-domain-names.html"&gt;Marc Blanchet's post&lt;/a&gt;): about:config and filter using keyword "IDN". There you have two possibilities:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a "network.IDN.whitelist.com" boolean key and set it to true =&gt; will display all the .com IDNs using their Unicode characters, a.k.a. "the Microsoft way"&lt;/li&gt;&lt;li&gt;Create a new network.IDN.whitelist boolean entry for your full domain (eg: "network.IDN.whitelist.xn--abc.com") and set it to true.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ul&gt;Of course, none of this is really satisfying, as domains that do not present any risk of &lt;a href="http://en.wikipedia.org/wiki/IDN_homograph_attack"&gt;homograph attack&lt;/a&gt; (eg: sequence of glyphs that are not used in any language, or one glyph characters that cannot be mistaken for any other), are still not displayed as Unicode by default in those browsers, which really sucks.&lt;br /&gt;&lt;br /&gt;The way to address this issue would be for unicode.org to maintain a list of lookalike characters (i.e. characters considered as dangerous to use in an IDN because they can easily be mistaken for another character). The browser could then use this list (along with a list of all the valid Unicode characters at the time the list was created, as you want to take provision against new spoofable Unicode characters) to sort this issue.&lt;br /&gt;&lt;br /&gt;Of course, Unicode is likely to have cold feet about producing such a list, as they could end up being sued if they miss a lookalike and end up being sued as a result, but really, as the authority, it should be part of their role...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-3268664108768621854?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/3268664108768621854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/07/getting-international-domain-names-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3268664108768621854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3268664108768621854'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/07/getting-international-domain-names-to.html' title='Displaying International Domain Names in the browser&apos;s address bar'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-339846626042424270</id><published>2009-07-16T19:26:00.004+01:00</published><updated>2009-08-24T17:23:41.650+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='character'/><category scheme='http://www.blogger.com/atom/ns#' term='chart'/><category scheme='http://www.blogger.com/atom/ns#' term='Unicode'/><title type='text'>Unicode charts as a single image</title><content type='html'>Well, &lt;a href="http://ian-albert.com/misc/unichart.php"&gt;one guy&lt;/a&gt; was crazy enough to create a single image containing all the Unicode charts from unicode.org and put it online, and he was even nice enough to provide both &lt;a href="http://ian-albert.com/misc/zoom-unicode.php"&gt;an interface&lt;/a&gt; to dynamically visualize the rendered image, as well as allow people to download the whole thing (which, even if slightly outdated, I find super useful).&lt;br /&gt;&lt;br /&gt;Props to Ian then!&lt;br /&gt;&lt;br /&gt;Update 2009.08.24 - You might also be interested in &lt;a href="http://www.ftrain.com/unicode/#9241"&gt;this&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-339846626042424270?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/339846626042424270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/07/unicode-charts-as-single-image.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/339846626042424270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/339846626042424270'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/07/unicode-charts-as-single-image.html' title='Unicode charts as a single image'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-6633412119170188540</id><published>2009-07-15T11:51:00.003+01:00</published><updated>2009-07-20T10:50:20.869+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UTF8'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='command prompt'/><title type='text'>Windows Command Prompt in UTF-8</title><content type='html'>&lt;ol&gt;&lt;li&gt;Change the default font to Lucida&lt;br /&gt;&lt;/li&gt;&lt;li&gt;issue the command &lt;code&gt;chcp 65001&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-6633412119170188540?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/6633412119170188540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/07/windows-command-prompt-in-utf-8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6633412119170188540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6633412119170188540'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/07/windows-command-prompt-in-utf-8.html' title='Windows Command Prompt in UTF-8'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5572501104930300515</id><published>2009-06-15T11:30:00.023+01:00</published><updated>2009-07-20T10:50:47.752+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='alpha channel'/><category scheme='http://www.blogger.com/atom/ns#' term='photoshop'/><title type='text'>Convert a grayscale or RGB layer to an alpha channel in Photoshop CS 4</title><content type='html'>Goddammit! I don't know if &lt;span style="font-weight: bold;"&gt;3D&lt;/span&gt; graphics designer use Photoshop or not, and if they do, how they manage to put with it all day, but talk about a product not being intuitive... On the other hand, it's true that I know a thing or two about how Adobe doesn't care that much about any of the software they design to be either customer friendly or intuitive...&lt;br /&gt;&lt;br /&gt;So, today, in our new "What we thought we'd do in about 30 seconds in Photoshop CS4 but ended up doing in hours" saga, we'll see how to convert a shadow effect layer into an alpha channel.&lt;br /&gt;&lt;br /&gt;The purpose here is to display a nice transparent text overlay texture, with a &lt;span style="font-weight: bold;"&gt;blending&lt;/span&gt; shadow against a non uniform background in a 3D animation (eg. DirectX, OpenGL, ...). And because I'm in a generous mood today, I'm even gonna drop some illustrations here in there.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_WJDvGbjnsG8/SjYq2h2NgdI/AAAAAAAAAAM/goE5wJFBEYA/s1600-h/alpha+channel+1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 182px;" src="http://4.bp.blogspot.com/_WJDvGbjnsG8/SjYq2h2NgdI/AAAAAAAAAAM/goE5wJFBEYA/s320/alpha+channel+1.png" alt="" id="BLOGGER_PHOTO_ID_5347508723836092882" border="0" /&gt;&lt;/a&gt;Let's say that you are creating an animated "motivational poster", like the one on the left, and your goal is to do some nice animation of the motto like a zoom out for instance, while making sure the motto has a shadow for added impact. You will of course break down your animation between a static background and a text layer, loaded as a texture, and animate the latter.&lt;br /&gt;Now, if you merely save the text layer with a shadow effect in Photoshop and use that as your texture, it will not blend nicely at all, as the shadow will be a solid colour, and eat part of the the nice aperture green logo. Therefore you want to add an alpha component to your texture, which you'll use for shadow blending.&lt;br /&gt;&lt;br /&gt;At this stage, I'll suppose that you have your nice text layer with its shadow effect. The good part about all this ordeal is that you won't have to create a separate layer out of the effect, or play with adding/substracting selections, because a black text display with its shadow is pretty much exactly what you need to use for the alpha channel. The only thing is, if you use coloured or texturized text, you'll want to convert it to solid black before the next operations, through a duplicate layer or something.&lt;br /&gt;&lt;br /&gt;Now, if you're a Photoshop novice and you've done your research, you should be aware that the alpha components of an image is dealt with as a channel in Photoshop, and that there is a tab for that (again non-intuitive as hell: where my "right click -&gt; new channel" option, Adobe? And how am I supposed to know what the  small icons at the bottom represent when &lt;span style="font-weight: bold;"&gt;there is no bleeping contextual help&lt;/span&gt; in your product?!?). So you'd think that, with all the grpahics people dealing with channels, depths masks and alpha all day long, there'd be a bloody "Convert Layer to Channel" function readily available by default in the interface. Well, if it was straightforward to work with alpha channels in Photoshop, that would make the life of graphics designers too easy, and obviously this is not something that you would ever want. So, after cursing for about 10 minutes about those non-intuitive menus, we have to fallback to looking on the internet for some helpful souls (and I got to give it to CreativeCow there, &lt;a href="http://forums.creativecow.net/thread/244/860437#860537"&gt;for providing all the actual solution steps&lt;/a&gt;):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Search into your Photoshop installation directory for .atn files (AcTioNs) and locate the one labelled "Video Actions.atn". Mine was in "D:\Program Files\Adobe\Adobe Photoshop CS4 (64 Bit)\Presets\Actions"&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;In Photoshop, go to Window -&gt; Actions. You will see a set of "Default Actions", but of course, not all the Actions that come with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Photoshop&lt;/span&gt;&lt;/span&gt; have been loaded by default in &lt;span style="font-weight: bold;"&gt;one of the more obscure menu of the product, where &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;noone&lt;/span&gt;&lt;/span&gt; would mind if they had been&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_WJDvGbjnsG8/SjY_o9jr2RI/AAAAAAAAAA8/wd2zcLd2hr8/s1600-h/alpha+channel+4.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 320px; height: 84px;" src="http://3.bp.blogspot.com/_WJDvGbjnsG8/SjY_o9jr2RI/AAAAAAAAAA8/wd2zcLd2hr8/s320/alpha+channel+4.png" alt="" id="BLOGGER_PHOTO_ID_5347531580500597010" border="0" /&gt;&lt;/a&gt;Then click on what has to be the most useful button for advanced users, and therefore the one that's been made as easy to overlook as possible, namely that bleeping contextual &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;dropdown&lt;/span&gt;&lt;/span&gt; menu.&lt;br /&gt;&lt;br /&gt;And I really have to wonder what is it with this late redesign of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;UIs&lt;/span&gt;&lt;/span&gt; by Adobe and Microsoft (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;eg&lt;/span&gt;&lt;/span&gt;. Office 2007), whose only purpose seems to make the power users' life a living hell by hiding the most powerful feature in a place where the sun don't shine no more...&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;In that menu, you will find a "Load Action" option, which you should use to navigate to the folder where you spotted the "Video Actions.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;atn&lt;/span&gt;&lt;/span&gt;" file, and open that file.&lt;br /&gt;Alternatively, you can skip step 1 and directly select "Video Actions" in that menu to make the Video Actions appear. Why "Video Actions" is in that menu but not in the main action window by default is really beyond me here...&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;OK, now we're talking: In the "Video Actions" section, the first 2 actions are: "Alpha Channel from Visible Layers" and "Alpha Channel from Visible Layers (inverted)". &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_WJDvGbjnsG8/SjZeydFzLNI/AAAAAAAAABM/nChv8taqHgg/s1600-h/alpha+channel+2.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 320px; height: 182px;" src="http://1.bp.blogspot.com/_WJDvGbjnsG8/SjZeydFzLNI/AAAAAAAAABM/nChv8taqHgg/s320/alpha+channel+2.png" alt="" id="BLOGGER_PHOTO_ID_5347565828444466386" border="0" /&gt;&lt;/a&gt;The Ark of the Covenant at last! And all we had to do was get our face and soul melted for it - a bargain! Merrily we go then by setting only our "black text with shadow" layer visible (make sure you don't select the background) and then clicking the little "Play" button in the Actions menu with "Alpha Channel from Visible Layers" selected. You should end up with a new channel that looks like the one on the left. In this image, white is for pixels with no alpha (completely opaque) whereas black is for pixels with 100% alpha (completely transparent).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Now, before we save our image with its &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;newfound&lt;/span&gt;&lt;/span&gt; alpha channel, we want to lay it over black solid background for the shadow, so just create one and save only the text layer (with or without the shadow effect - it shouldn't matter) over the black background as your image with alpha. You might want to enable the alpha channel (set the eye) after creating the black background to have a better idea of what exactly you're saving.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Now because there does not appear to be clear conventions as to what a zero alpha value is meant to represent (this can vary from application to application), you might find that the alpha mask you get in your application does the opposite effect of what you wanted. If that,s the case, rather than redo the steps using the "Inverse" function for layer to alpha we've seen in the menu, you can simply double click on your Alpha &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;channel&lt;/span&gt; in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;Photoshop&lt;/span&gt;&lt;/span&gt; and toggle between "Color Indicates Masked Area" / "Color Indicates Selected Area", as this will invert your Alpha channel&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;And that, sir, is how you do it. Of course, if you look at the actions, you can probably figure out how to achieve the same from the various menus (haven't really figured that one just yet, especially where a on/off selection is converted to a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;grayscale&lt;/span&gt;&lt;/span&gt; range). I also haven't figured out how you can insert one of those actions into the standard &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;Photoshop&lt;/span&gt;&lt;/span&gt; menus (wouldn't it sit nicely in the layer menu?).&lt;br /&gt;&lt;br /&gt;Oh and finally, if like me you've cursed &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;Photoshop's&lt;/span&gt;&lt;/span&gt; stupid and uninformative handling of undo (Why is it that a 10 year old program like Paint Shop Pro 5 does a much better job at undo than &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;Photoshop&lt;/span&gt;&lt;/span&gt;?), note that you can access the undo history from the Window menu as well, where you will actually get a &lt;span style="font-weight: bold;"&gt;description&lt;/span&gt; of the actions you have taken.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5572501104930300515?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5572501104930300515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/06/convert-grayscale-or-rgb-layer-to-alpha.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5572501104930300515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5572501104930300515'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/06/convert-grayscale-or-rgb-layer-to-alpha.html' title='Convert a grayscale or RGB layer to an alpha channel in Photoshop CS 4'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_WJDvGbjnsG8/SjYq2h2NgdI/AAAAAAAAAAM/goE5wJFBEYA/s72-c/alpha+channel+1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7442620999044955540</id><published>2009-04-20T11:31:00.002+01:00</published><updated>2009-04-20T11:35:55.907+01:00</updated><title type='text'>More vi search and replace</title><content type='html'>To replace ^M characters that did not quite make it into carriage return when displayed in vi:&lt;br /&gt;&lt;pre&gt;:%s/&lt;ctrl-v&gt;&lt;ctrl-m&gt;&amp;lt;Ctrl-V&amp;gt;&amp;lt;Ctrl-M&amp;gt;/&lt;/ctrl-m&gt;&lt;/ctrl-v&gt;&amp;lt;Ctrl-V&amp;gt;&amp;lt;Enter&amp;gt;&lt;ctrl-v&gt;&lt;ctrl-m&gt;&lt;ctrl-v&gt;&lt;enter&gt;/g&lt;/enter&gt;&lt;/ctrl-v&gt;&lt;/ctrl-m&gt;&lt;/ctrl-v&gt;&lt;/pre&gt;Note that &lt;ctrl-v&gt; &amp;lt;Ctrl-V&amp;gt; is a magic sequence that allows vi to uninterpret the next special key, inserting its control code instead.&lt;/ctrl-v&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7442620999044955540?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7442620999044955540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/04/more-vi-search-and-replace.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7442620999044955540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7442620999044955540'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/04/more-vi-search-and-replace.html' title='More vi search and replace'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-575516512621185377</id><published>2009-03-12T12:36:00.002Z</published><updated>2009-07-20T10:51:14.513+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mdadm'/><category scheme='http://www.blogger.com/atom/ns#' term='chkconfig'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='raid services'/><title type='text'>redhat/centos services and mdadm quicknotes</title><content type='html'>Always seem to forget stuff there. The command I'm looking for to manage services/change runlevel on redhat/centos is chkconfig (chkconfig --list).&lt;br /&gt;&lt;br /&gt;Also, to re-add a partition to an existing (failed) RAID array:&lt;br /&gt;&lt;pre&gt;mdadm /dev/md0 --manage --add /dev/sdb1&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-575516512621185377?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/575516512621185377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/03/redhatcentos-services-and-mdadm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/575516512621185377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/575516512621185377'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/03/redhatcentos-services-and-mdadm.html' title='redhat/centos services and mdadm quicknotes'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-8707969817061411101</id><published>2009-03-09T23:27:00.005Z</published><updated>2009-07-20T10:51:34.224+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='log'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Mysql logging</title><content type='html'>One day or another, you'll want to check what exactly your MySQL server is doing (to check for SQL injections for instance). Therefore:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;To log all SQL queries, add the following to your my.cnf (in the [mysqld] section)&lt;br /&gt;&lt;pre&gt;log=/var/log/mysqld.log&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;To log queries that actually modify the database:&lt;br /&gt;&lt;pre&gt;log-bin&lt;/pre&gt;If you don't modify the default log-bin parameters, this would create a &amp;lt;servername&lt;servername&gt;&amp;gt;-bin.###### &amp;amp; index in your /var/lib/mysql, which you can then analyze with mysqlbinlog&lt;br /&gt;&lt;/servername&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-8707969817061411101?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/8707969817061411101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/03/mysql-logging.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8707969817061411101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8707969817061411101'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/03/mysql-logging.html' title='Mysql logging'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-2632525830655141680</id><published>2009-03-09T15:52:00.004Z</published><updated>2009-03-09T16:08:23.948Z</updated><title type='text'>Getting some bloody files from Gigabyte</title><content type='html'>There's not ONE motherboard manufacturer to save the others. NOT ONE!&lt;br /&gt;Listen, we all know that you're hardware developers, and that providing files is an afterthough, but that is no reason to:&lt;br /&gt;- force customers to use God-awful, slow, and completely useless interfaces on your website when all they want is access BIOSes or drivers&lt;br /&gt;- host your bloody files on a server that must still be powered by DX2 66MHz CPU with 8 MB RAM. Yeah, it really looks that slow from our end!!!&lt;br /&gt;- suddenly decide that you're gonna change all the files location, because it was a bit too convenient for customer to google and access the data directly, so what better way to say "f*ck you!" than changing the interface and means of accessing the files every 6 months or so.&lt;br /&gt;&lt;br /&gt;Asus, Gigabyte, MSI, Supermicro, whatever: YOUR SUPPORT &amp;amp; DOWNLOADS WEBISTES ALL SUCK, BIG TIME!!!&lt;br /&gt;&lt;br /&gt;It's not like we're asking for much. We just want to access the BIOS, drivers and utilities without having to jump in slow motion (or should I say bullet-time, considering how time crawling to a standstill page refreshes appear to be) through hoops. And I won't hold you much of a grudge for designing websites that suck, because that's not your main area of expertise, but having them run on underperforming hardware is hardly the best way to put your customers in confidence.&lt;br /&gt;&lt;br /&gt;All this rant to tell you that, if you actually want to download a file from GigaByte, don't bother going to gigabyte.com.tw. Just use &lt;a href="ftp://download.gigabyte.ru/"&gt;ftp://download.gigabyte.ru/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-2632525830655141680?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/2632525830655141680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/03/getting-some-bloody-files-from-gigabyte.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2632525830655141680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2632525830655141680'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/03/getting-some-bloody-files-from-gigabyte.html' title='Getting some bloody files from Gigabyte'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-6439288771676920031</id><published>2009-02-26T13:36:00.004Z</published><updated>2009-10-06T18:06:33.219+01:00</updated><title type='text'>isw: Could not find disk /dev/sd# in the metadata error with dmraid</title><content type='html'>Reinstalled my old rig yesterday, to switch from a RAID0 to a RAID1 conf, now that the bulk of my data is stored in the RAID5 array from my HTPC. As usual, using the Motherboard's fakeraid driver. This time it's the intel's ICH8R Matrix Storage RAID driver (and boy is it slow on rebuilding RAID1 arrays, which I had to do since I only got a &lt;span style="font-weight: bold;"&gt;brand new&lt;/span&gt; Vista64 stable for four hours before a complete freezout that required a hard reset!).&lt;br /&gt;&lt;br /&gt;As usual, went through a Linux reinstall, only to find out that dmraid 1.0.0.rc15 would return the following:&lt;pre class="brush: text"&gt;root@dusk:/usr/src/dmraid/1.0.0.rc15# dmraid -ay&lt;br /&gt;ERROR: isw: Could not find disk /dev/sdc in the metadata&lt;br /&gt;ERROR: isw: Could not find disk /dev/sdb in the metadata&lt;br /&gt;no raid disks&lt;/pre&gt;Well, once again, it was Debian patches to the rescue. Just make sure you apply the latest dmraid_######.diff patches to your dmraid install (just like we did for grub, see below) and voila!:&lt;pre class="brush: text"&gt;root@dusk:/usr/src/dmraid/1.0.0.rc15# dmraid -ay&lt;br /&gt;RAID set "isw_dadaadaecb_Ark" was activated&lt;br /&gt;RAID set "isw_dadaadaecb_Ark1" was activated&lt;br /&gt;RAID set "isw_dadaadaecb_Ark2" was activated&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-6439288771676920031?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/6439288771676920031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/02/isw-could-not-find-disk-devsd-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6439288771676920031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6439288771676920031'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/02/isw-could-not-find-disk-devsd-in.html' title='isw: Could not find disk /dev/sd# in the metadata error with dmraid'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-998609616533429543</id><published>2009-02-24T12:58:00.003Z</published><updated>2009-10-06T18:05:12.166+01:00</updated><title type='text'>Booting with a failed primary HDD on a Linux RAID1 array</title><content type='html'>Thought it would be straightforward, and that the system would automagically take care of it by itself, think again:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;GRUB is dumb, until we tell it exactly what to do, so, assuming your /boot partition is located on sda1/sdb1, you need to make sure that you &lt;span style="font-weight: bold;"&gt;manually&lt;/span&gt; setup both disks, using:&lt;br /&gt;&lt;pre class="brush: text"&gt;[root@whatever ~]# grub&lt;br /&gt;&lt;br /&gt;    GNU GRUB  version 0.95  (640K lower / 3072K upper memory)&lt;br /&gt;&lt;br /&gt; [ Minimal BASH-like line editing is supported.  For the first word, TAB&lt;br /&gt;   lists possible command completions.  Anywhere else TAB lists the possible&lt;br /&gt;   completions of a device/filename.]&lt;br /&gt;&lt;br /&gt;grub&gt; root (hd0,0)&lt;br /&gt; Filesystem type is ext2fs, partition type 0xfd&lt;br /&gt;&lt;br /&gt;grub&gt; setup (hd0)&lt;br /&gt; Checking if "/boot/grub/stage1" exists... yes&lt;br /&gt; Checking if "/boot/grub/stage2" exists... yes&lt;br /&gt; Checking if "/boot/grub/e2fs_stage1_5" exists... yes&lt;br /&gt; Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  15 sectors are embedded.&lt;br /&gt;succeeded&lt;br /&gt; Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/boot/grub/stage2&lt;br /&gt;/boot/grub/grub.conf"... succeeded&lt;br /&gt;Done.&lt;br /&gt;&lt;br /&gt;grub&gt; root (hd1,0)&lt;br /&gt; Filesystem type is ext2fs, partition type 0xfd&lt;br /&gt;&lt;br /&gt;grub&gt; setup (hd1)&lt;br /&gt; Checking if "/boot/grub/stage1" exists... yes&lt;br /&gt; Checking if "/boot/grub/stage2" exists... yes&lt;br /&gt; Checking if "/boot/grub/e2fs_stage1_5" exists... yes&lt;br /&gt; Running "embed /boot/grub/e2fs_stage1_5 (hd1)"...  15 sectors are embedded.&lt;br /&gt;succeeded&lt;br /&gt; Running "install /boot/grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/boot/grub/stage2&lt;br /&gt;/boot/grub/grub.conf"... succeeded&lt;br /&gt;Done.&lt;br /&gt;&lt;br /&gt;grub&gt; quit&lt;/pre&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you have additional disks that you fsck (last columns of your fstab), be mindful that libsata will reorganize their names around, so if you set your /dev/sdc1 to be checked at bootime, you might end up getting stuck with fsck not finding the disk, and not being able to boot at all!&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-998609616533429543?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/998609616533429543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/02/booting-with-failed-primary-hdd-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/998609616533429543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/998609616533429543'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/02/booting-with-failed-primary-hdd-on.html' title='Booting with a failed primary HDD on a Linux RAID1 array'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-4359661709775785860</id><published>2009-02-10T12:39:00.012Z</published><updated>2009-10-06T18:03:16.561+01:00</updated><title type='text'>Booting fakeraid RAID5 Linux, the less half assed way</title><content type='html'>This will be the final episode of our ongoing installation of Linux on a nVidia MediaShield fakeraid RAID5 array.&lt;br /&gt;&lt;br /&gt;By now, you should have a kernel and an initrd.gz image that allow you to boot onto your RAID5 partition, the only last remaining problem being that you need an external non RAID5 disk to do so. That disk could probably be put to better use, so let's remove it from the equation. And no, we're not gonna use an USB stick, CD-ROM or even a floppy, because what we need is a solution always at our fingertips, that we can rely on 24/7, without having to look for a flimsy little device/disc, that we're sure to lose or scratch anyway. Instead, we're going to use something MUCH better.&lt;br /&gt;&lt;br /&gt;Re-introducing, the best invention since sliced bread: the fully hacked WRT54G, with supporting cast: PXE!&lt;br /&gt;&lt;br /&gt;If by now you don't have a hacked WRT54G in your house, you're an idiot, and if you didn't get a motherboard + ethernet controller that supports PXE, you also need to rethink your life.&lt;br /&gt;&lt;br /&gt;You'll find plenty of (seriously confusing) guides on how to use PXE, so I'll just cut down to the chase. What we need here is a PXE executable that can boot our vmlinuz + initrd.gz, as well as relinquish the boot operation to the default disk device, so that we can chose between Vista and Linux.&lt;br /&gt;If you do the groundwork, you'll probably find out that GRUB can be compiled to be run from PXE. The only issue we have here is that the nForce forcedeth network driver is not embedded with GRUB 0.97, and while you can pick one up from gPXE (which is where all the network drivers from GRUB come from anyway), if you want to do things clean, you'll have to recreate the configure/Makefile settings to add the forcedeth, which is a major pain in the ass (or you can simply hijack one of the existing drivers files, and replace it with the forcedeth.c code, but this lazyman's option of choice is not really gratifying).&lt;br /&gt;&lt;br /&gt;Instead, we're going to use &lt;a href="http://syslinux.zytor.com/wiki/index.php/PXELINUX"&gt;PXELINUX&lt;/a&gt;, a spinoff of the Syslinux project.&lt;br /&gt;Since our WRT router is using DNSMasq, we'll practically follow the instructions from the link above, so if you need more than what I am to present below, feel free to refer to the official documentation.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a tftpboot directory on your multipurpose router. For convenience, I am creating mine in /share/tftpboot as the /share directory is already shared using Samba, and this of course gives us great convenience to setup our PXE server files&lt;/li&gt;&lt;li&gt;Copy your vmlinuz and initrd.gz images in this directory&lt;/li&gt;&lt;li&gt;Download and extract the latest syslinux.zip from &lt;a href="http://www.kernel.org/pub/linux/utils/boot/syslinux/"&gt;kernel.org&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Copy the pxelinux.0 from the syslinux.zip core/ directory into your tftpboot dir&lt;/li&gt;&lt;li&gt;Copy menu.c32 from /com32/menu into your tftpboot dir&lt;/li&gt;&lt;li&gt;It's also a nice feature to be able to boot DOS floppy images using PXE as well (eg: Win98 bootdisk, Memtest86+, etc.). To do that, copy memdisk from the memdisk/ directory to your tftpboot dir. Note that memdisk can also handle gzip compressed images, which can help reduce transfer time&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Optional: If you want to confirm that memdisk works, or if you simply want to have the Memtest86+ option, you can also download the compressed Memtest86+ v2.10 image that I am providing &lt;a href="http://nil.rpc1.org/files/memtestp.gz"&gt;here&lt;/a&gt;. Note that this is the same memtestp.bin that you can download from &lt;a href="http://www.memtest.org/"&gt;http://www.memtest.org/&lt;/a&gt; except padded to reach the standard 1.44 MB floppy size. Despite multiple attempts, I haven't yet found how to get memdisk to auto-pad floppy images...&lt;br /&gt;Oh, and the reason I use Memtest86+ rather than Memtest86 is that the latter didn't seem to handle my 4 GB RAM properly&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create a pxelinux.cfg/ &lt;span style="font-weight: bold;"&gt;directory&lt;/span&gt; in your tftpboot dir&lt;/li&gt;&lt;li&gt;Create a graphics.conf text file there, with the following content:&lt;pre class="brush: text"&gt;menu color tabmsg 37;40      #80ffffff #00000000&lt;br /&gt;menu color hotsel 30;47      #40000000 #20ffffff&lt;br /&gt;menu color sel 30;47         #40000000 #20ffffff&lt;br /&gt;menu color scrollbar 30;47   #40000000 #20ffffff&lt;br /&gt;menu master passwd yourpassword&lt;br /&gt;menu width 80&lt;br /&gt;menu margin 22&lt;br /&gt;menu passwordmargin 26&lt;br /&gt;menu rows 6&lt;br /&gt;menu tabmsgrow 15&lt;br /&gt;menu cmdlinerow 15&lt;br /&gt;menu endrow 24&lt;br /&gt;menu passwordrow 12&lt;br /&gt;menu timeoutrow 13&lt;br /&gt;menu vshift 6&lt;br /&gt;menu passprompt enter password:&lt;br /&gt;noescape 1&lt;br /&gt;allowoptions 1&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Create a default text file in the pxelinux.cfg directory, and adapt the following content to your needs (NB: By default, this menu will apply to all PXE devices. If you want to target specific MACs, just change the "default" name to the MAC address of your interface (eg: "01-88-99-aa-bb-cc-dd"):&lt;pre class="brush: text"&gt;default menu.c32&lt;br /&gt;prompt 0&lt;br /&gt;&lt;br /&gt;menu title PXE Boot Menu&lt;br /&gt;menu include pxelinux.cfg/graphics.conf&lt;br /&gt;menu autoboot Starting Local System in # seconds&lt;br /&gt;&lt;br /&gt;label bootlocal&lt;br /&gt;menu label ^Local System&lt;br /&gt;menu default&lt;br /&gt;localboot 0&lt;br /&gt;timeout 35&lt;br /&gt;    &lt;br /&gt;label linux&lt;br /&gt;menu label Slackware 12.2 (RAID5)&lt;br /&gt;kernel vmlinuz&lt;br /&gt;append initrd=initrd.gz vga=791 vt.default_utf8=1&lt;br /&gt;&lt;br /&gt;label dos&lt;br /&gt;menu label DOS (Win98)&lt;br /&gt;kernel memdisk&lt;br /&gt;append floppy initrd=win98.gz&lt;br /&gt;&lt;br /&gt;label memtest&lt;br /&gt;menu label Memtest86+&lt;br /&gt;kernel memdisk&lt;br /&gt;append floppy initrd=memtestp.gz&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Now, you need to tell your DHCP server that it should handle PXE, and which files it should provide. If you are using DNSMasq, this is as trivial as adding the following lines:&lt;pre class="brush: bash"&gt;# PXE Booting&lt;br /&gt;enable-tftp&lt;br /&gt;tftp-root=/share/tftpboot&lt;br /&gt;# This is the file that will be ftpd's accross&lt;br /&gt;dhcp-boot=pxelinux.0&lt;br /&gt;&lt;/pre&gt;and then restarting the daemon (/etc/init.d/dnsmaq restart)&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Finally, you can enable PXE in your PC BIOS, and watch in awe as you can now conveniently boot whatever you want from the network. If it doesn't work, I'd suggest you run a test with memdisk and a bootdisk (eg: memtest), as it shouldn't require much of any configuration to run properly.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-4359661709775785860?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/4359661709775785860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/02/booting-fakeraid-raid5-linux-less-half.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4359661709775785860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/4359661709775785860'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/02/booting-fakeraid-raid5-linux-less-half.html' title='Booting fakeraid RAID5 Linux, the less half assed way'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1543052721134975511</id><published>2009-02-10T12:29:00.005Z</published><updated>2009-02-10T12:38:57.927Z</updated><title type='text'>RE: Installing XBox controller on Vista 64</title><content type='html'>Well, I already gave you &lt;a href="http://nil-techno.blogspot.com/2008/08/installing-unsigned-drivers-on-vista-64.html"&gt;some tips&lt;/a&gt;, but each time I do it, it's a complete pain finding the right driver and getting it to work. I'll tell you; there are WAY TO MANY versions of the xbcd driver floating on the internet.&lt;br /&gt;&lt;br /&gt;The one you want to use then is the one listed from &lt;a href="http://redcl0ud.1.forumer.com/index.php?showtopic=1816&amp;amp;st=0"&gt;this thread&lt;/a&gt; (0.2.6 at the time of this article - I also put a copy of the installer &lt;a href="http://nil.rpc1.org/files/XBCD_Installer_0.2.6.exe"&gt;here&lt;/a&gt; if you need). Don't bother installing anything else.&lt;br /&gt;Then the nice thing is that this latest version is already self signed, and the installer will also prompt you to install the driver's root CA, so if you're in test mode, you're golden.&lt;br /&gt;&lt;br /&gt;2 things to know though:&lt;br /&gt;- To access the setup utility, you need to have disabled UAC (use msconfig for that). You can re-enable it afterwards&lt;br /&gt;- If you already installed an xbcd driver, or if it simply doesn't appear to work, just select "update driver" on the device, and point it to your Windows\Inf directory. The update should get you sorted.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1543052721134975511?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1543052721134975511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/02/re-installing-xbox-controller-on-vista.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1543052721134975511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1543052721134975511'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/02/re-installing-xbox-controller-on-vista.html' title='RE: Installing XBox controller on Vista 64'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-6949161797349699238</id><published>2009-02-06T15:58:00.015Z</published><updated>2010-08-13T12:58:39.907+01:00</updated><title type='text'>Booting fakeraid RAID5 Linux, the half assed way</title><content type='html'>OK, by now you have a whole Linux system sitting idly on one of your RAID5 device mapper partitions. First thing you want to do then is edit the etc/fstab there to have the root filesysten point to the right device (in our case /dev/mapper/nvidia_aeejfdbep2). Not that it's actually necessary considered how we are going to boot, but it can't hurt.&lt;br /&gt;&lt;br /&gt;If you've done your groundwork, you found out by now that using GRUB or LILO as is won't be of much help, as none of them is able to handle a RAID5 device mapper array. We don't have a choice her but have to run dmraid -ay before we try to access the disks, and of course, that means we need to build an initrd image.&lt;br /&gt;As a side note, RAID1 or RAID0 shouldn't be an issue with GRUB, so you can probably follow this tutorial and complete the bootloader installation on your main RAID5 array, and have it work.&lt;br /&gt;&lt;br /&gt;Now, our final solution here will still require an external partition with a /boot directory that the bootloader can refer to at boottime, but for the sake of this exercise, and also for our final solution, which will no longer require an external non RAID5 partition (more about that in the next post), we're gonna setup our RAID5 Linux system as close to standalone as possible, which means that what we ultimately want is the ability to run the bootloader from our RAID5 system (so that the day we have a bootloader that properly handles RAID5, we can just install it on the RAID5 MBR rather than the external disk, and ditch the latter in a heartbeat).&lt;br /&gt;Unfortunatley, this means that we'll need to use GRUB rather than LILO, so we'll break things in 2 parts: First we'll configure initrd and setup LILO from the non RAID Linux to boot our RAID, and once we're there we'll setup GRUB to boot our RAID from the RAIDed Linux (but still using the non RAIDed boot). If you're confused, just hang on.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Part 1: Setting up initrd to boot the RAID5 Linux&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Well, time and time again, I find more compelling reasons to use Slackware, the last one being /boot/README.initrd, which is installed by default, and in which Patrick Volkerding tells you anything you want to know about how to create initrd. Not that there is much you need to know in the end as:&lt;pre class="brush: text"&gt;root@stella# cd /boot&lt;br /&gt;root@stella# mkinitrd -c&lt;/pre&gt;is all you need for now. The mkninitrd will have created a brand new initrd-tree and initrd.gz for you - isn't that nice?&lt;br /&gt;&lt;br /&gt;Now, obviously, we need to add our dmraid executable to the initrd-tree and recreate initrd.gz. But if you're thinking "fine, we'll just pick up the exec", think again!&lt;br /&gt;The dmraid executable we built was the dynamically linked version, so if you strace the files used, you'll see that we're gonna have to copy a whole bunch of libraries as well:&lt;br /&gt;&lt;pre class="brush: text"&gt;root@stella# strace -e trace=file dmraid -ay 2&gt;&amp;amp;1 | more&lt;br /&gt;execve("/sbin/dmraid", ["dmraid", "-ay"], [/* 35 vars */]) = 0&lt;br /&gt;access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)&lt;br /&gt;open("/etc/ld.so.cache", O_RDONLY)      = 3&lt;br /&gt;open("/lib/libdevmapper.so.1.02", O_RDONLY) = 3&lt;br /&gt;open("/lib/libc.so.6", O_RDONLY)        = 3&lt;br /&gt;open("/proc/mounts", O_RDONLY)          = 3&lt;br /&gt;(...)&lt;br /&gt;RAID set "nvidia_aeejfdbe" already active&lt;br /&gt;RAID set "nvidia_aeejfdbep1" already active&lt;br /&gt;RAID set "nvidia_aeejfdbep2" already active&lt;br /&gt;RAID set "nvidia_aeejfdbep3" already active&lt;/pre&gt;NB: The removed output above has to do with /proc, /dev or /sys, which won't be an issue.&lt;br /&gt;&lt;br /&gt;The smart way (or lazy way, which is even better), is to compile dmraid as a static binary, so that we don't have to care about those pesky libraries. Therefore:&lt;br /&gt;&lt;pre class="brush: text"&gt;root@stella# cd /usr/src/dmraid/1.0.0.rc15/&lt;br /&gt;root@stella# make clean&lt;br /&gt;root@stella# ./configure --enable-static_link&lt;br /&gt;root@stella# make&lt;br /&gt;root@stella# ls -alF tools/dmraid /sbin/dmraid&lt;br /&gt;-rwxr-xr-x 1 root root 204658 2009-02-05 23:01 /sbin/dmraid*&lt;br /&gt;-rwxr-xr-x 1 root root 816664 2009-02-06 16:47 tools/dmraid*&lt;br /&gt;root@stella# cp tools/dmraid /boot/initrd-tree/sbin/&lt;/pre&gt;That's 600 KB more to our initrd right there, but at least we know that we have everything we need.&lt;br /&gt;Now, all that's left is editing the init script in /boot/initrd-tree to call our command.&lt;br /&gt;Depending on your distro, the name &amp;amp; content of the init script could be very different, so you might have to be creative. In the case of slackware, the init script is called "init" (which makes sense, because then you don't have to specify it as a kernel parameter), and in the&lt;pre class="brush: text"&gt;if [ "$RESCUE" = "" ]; then&lt;/pre&gt; section, which already contains some disk detection routines, we're gonna add:&lt;pre class="brush: text"&gt;  # Initialize DMRAID:&lt;br /&gt;if [ -x /sbin/dmraid ]; then&lt;br /&gt;/sbin/dmraid -ay&lt;br /&gt;fi&lt;/pre&gt;Now, we shall rebuild our initrd:&lt;br /&gt;&lt;pre class="brush: text"&gt;mkinitrd -r /dev/mapper/nvidia_aeejfdbep2&lt;/pre&gt;&lt;br /&gt;The stage is now setup to see if we can boot our RAID5 system using LILO, by adding the following section in /etc/lilo.conf:&lt;br /&gt;&lt;pre class="brush: text"&gt;image = /boot/vmlinuz&lt;br /&gt;initrd = /boot/initrd.gz&lt;br /&gt;root = /dev/mapper/nvidia_aeejfdbep2&lt;br /&gt;label = RAID5_Linux&lt;br /&gt;read-only&lt;/pre&gt;Now, reinstall LILO:&lt;br /&gt;&lt;pre class="brush: text"&gt;root@stella# lilo&lt;br /&gt;Warning: '/proc/partitions' does not match '/dev' directory structure.&lt;br /&gt;Name change: '/dev/dm-0' -&gt; '/dev/disk/by-name/nvidia_aeejfdbe'&lt;br /&gt;Warning: Name change: '/dev/dm-1' -&gt; '/dev/disk/by-label/Vista64'&lt;br /&gt;Warning: Name change: '/dev/dm-2' -&gt; '/dev/disk/by-name/nvidia_aeejfdbep2'&lt;br /&gt;Warning: Name change: '/dev/dm-3' -&gt; '/dev/disk/by-label/Media'&lt;br /&gt;Added RAID5_Linux *&lt;br /&gt;Added Slack_New&lt;br /&gt;Added Slack_Old&lt;br /&gt;Added Rescue_1&lt;br /&gt;4 warnings were issued.&lt;/pre&gt;&lt;br /&gt;Don't worry too much about the warnings. Just reboot and, yay, it works!... Err, well... kinda, because while you should have seen the dmraid disks being mapped, and you do end up with everything running as it should from the RAID5 partition, you might end up with a boot where the rc.d/init scripts from Slackware are not being displayed on the console at bootime as they should.&lt;br /&gt;If you look in /var/log/messages, you will see that all the scripts do indeed run, but you're being left with a very silent screen right before you end up with the prompt.&lt;br /&gt;&lt;br /&gt;The problem is actually due to udev screwing up the /dev repository after the root filesystem is mounted. The solution to that? Keep the /dev used by the kernel even after root is mounted by compiling your kernel with:&lt;br /&gt;Device Drivers ---&gt; Generic Driver Options ---&gt; "Create a kernel maintained /dev tmpfs  (EXPERIMENTAL)" and "Automount devtmpfs at /dev" bot selected.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Part 2: Setting up GRUB on the RAID5 Linux partition&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are 2 (well 3) reasons why we want to replace LILO with GRUB here:&lt;br /&gt;1. GRUB is more likely to be patched for full RAID5 support compared to LILO, so when that happens, we want to be ready&lt;br /&gt;2. If you're using RAID0/RAID1 instead of RAID5, GRUB should actually be able to install the bootloader on your RAID array&lt;br /&gt;3. Having GRUB handle RAID takes some trickery which you probably want to read about.&lt;br /&gt;&lt;br /&gt;Once more, we'll be using grub 0.97, however, if you use the vanilla version, no matter what you do or where your /boot partition might be located (even on a standard non-RAID disk), you might end up with the infamous:&lt;pre class="brush: text"&gt;grub&gt; setup (hd0)&lt;br /&gt;Checking if "/boot/grub/stage1" exists... no&lt;br /&gt;Checking if "/grub/stage1" exists... no&lt;br /&gt;&lt;br /&gt;Error 2: Bad file or directory type&lt;/pre&gt;AFAIK, this could be due to GRUB 0.97 being unable to access ext3 256 bytes inodes, OR it could happen if you have more than 2 GB RAM, or it could have to do with the 2.6 kernel new geometry. Well, all I know is that one of the grub 0.97 patches from Debian fixes the problem. Thus:&lt;pre class="brush: text"&gt;4) Reinstall grub on RAID:&lt;br /&gt;root@stella# wget ftp://alpha.gnu.org/gnu/grub/grub-0.97.tar.gz&lt;br /&gt;root@stella# tar -xvzf grub-0.97.tar.gz&lt;br /&gt;root@stella# cd grub-0.97&lt;br /&gt;root@stella# wget http://ftp.de.debian.org/debian/pool/main/g/grub/grub_0.97-47lenny2.diff.gz&lt;br /&gt;root@stella# gunzip grub_0.97-47lenny2.diff.gz&lt;br /&gt;root@stella# patch -p1 &amp;lt; grub_0.97-47lenny2.diff&lt;br /&gt;root@stella# cat debian/patches/00list&lt;/pre&gt;OK, that last line gives us the order in which we should do the installation of the patches, so from there on you just need to run a bunch of:&lt;pre class="brush: text"&gt;patch -p1 &amp;lt; whatever.patch&lt;/pre&gt;In the order provided from the 00list file (i.e. starting with cvs-sync.patch and ending with use_grub-probe_in_grub-install.diff). Once you're there, just compile and install grub so that we move to the final phase. Now, we'll still tell GRUB to use our /boot directory on /dev/sdc1, because we don't really have a choice here (if you don't believe me, you can try installing on RAID5 and see your 'setup (hd#)' command fail miserably), but we will also tell it how to "see" our RAID5 array, and to be able to do that, we will need to know our disk geometry, which we can get from fdisk. What we want are the C(ylinders) H(eads) and S(sectors) value:&lt;br /&gt;&lt;pre class="brush: text"&gt;root@stella# fdisk /dev/mapper/nvidia_aeejfdbe&lt;br /&gt;Command (m for help): p&lt;br /&gt;&lt;br /&gt;Disk /dev/mapper/nvidia_aeejfdbe: 2000.4 GB, 2000409722880 bytes&lt;br /&gt;255 heads, 63 sectors/track, 243202 cylinders&lt;/pre&gt;These days, most disks have 255 heads and 63 tracks anyway (which are the greatest values you can set), so what you really need is the number of cylinders. This we will use to provide the geometry of our RAID5 "disk" to GRUB, in C H S order, because it is unable to figure it our by itself. And also, since we are doing a GRUB installation from scratch, we have to copy the stage1 &amp;amp; stage2 files to the /boot/grub directory (which is information that the clueless people using ready made packages are apparently unable to provide - damn you Ubuntu!):&lt;br /&gt;&lt;pre class="brush: text"&gt;mount /dev/sdc1 /mnt/hd&lt;br /&gt;mkdir /mnt/hd/boot/grub&lt;br /&gt;cp /usr/local/lib/grub/i386-pc/* /mnt/hd/boot/grub/&lt;br /&gt;grub --device-map=/dev/null&lt;br /&gt;grub&gt; device (hd0) /dev/sdc&lt;br /&gt;&lt;br /&gt;grub&gt; device (hd1) /dev/mapper/nvidia_aeejfdbe&lt;br /&gt;&lt;br /&gt;grub&gt; geometry (hd1) 243202 255 63&lt;br /&gt;drive 0x81: C/H/S = 243202/255/63, The number of sectors = -387927166, /dev/map&lt;br /&gt;per/nvidia_aeejfdbe&lt;br /&gt;Partition num: 0,  Filesystem type unknown, partition type 0x7&lt;br /&gt;Partition num: 1,  Filesystem type is ext2fs, partition type 0x83&lt;br /&gt;Partition num: 2,  Filesystem type unknown, partition type 0x7&lt;br /&gt;&lt;br /&gt;grub&gt; find /boot/grub/stage1&lt;br /&gt;(hd0,0)&lt;br /&gt;&lt;br /&gt;grub&gt; root (hd0,0)&lt;br /&gt;Filesystem type is ext2fs, partition type 0x83&lt;br /&gt;&lt;br /&gt;grub&gt; setup (hd0)&lt;br /&gt;Checking if "/boot/grub/stage1" exists... yes&lt;br /&gt;Checking if "/boot/grub/stage2" exists... yes&lt;br /&gt;Checking if "/boot/grub/e2fs_stage1_5" exists... yes&lt;br /&gt;Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.&lt;br /&gt;succeeded&lt;br /&gt;Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2&lt;br /&gt;/boot/grub/menu.lst"... succeeded&lt;br /&gt;Done.&lt;br /&gt;&lt;/pre&gt;Good, now we're ready to create our boot menu:&lt;br /&gt;&lt;pre class="brush: text"&gt;vi /mnt/hd/boot/grub/menu.lst&lt;br /&gt;&lt;br /&gt;default 0&lt;br /&gt;timeout 3&lt;br /&gt;&lt;br /&gt;title  Vista (64 bit)&lt;br /&gt;rootnoverify (hd1,0)&lt;br /&gt;chainloader +1&lt;br /&gt;&lt;br /&gt;title  Slackware 12.2 (RAID5)&lt;br /&gt;root   (hd1,1)&lt;br /&gt;kernel (hd0,0)/boot/vmlinuz root=/dev/mapper/nvidia_aeejfdbep2&lt;br /&gt;initrd (hd0,0)/boot/initrd.gz&lt;br /&gt;&lt;/pre&gt;This allows us to boot both Vista and Slackware on the RAID5 array using the /boot partition on the non RAID disk. Note that at this stage, it is probably a good idea to duplicate the /boot directory from the non RAID to the RAID partition, and recreate a small boot partition from scratch on the non RAID.&lt;br /&gt;&lt;br /&gt;Of course, as mentionned before, because we still need a non RAID HDD, this is an half assed solution. In the next post, we'll see a better assed solution, where we do away with that extra HDD, and where we'll explore some new interesting stuff...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-6949161797349699238?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/6949161797349699238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/02/booting-fakeraid-raid5-linux-half-assed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6949161797349699238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/6949161797349699238'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/02/booting-fakeraid-raid5-linux-half-assed.html' title='Booting fakeraid RAID5 Linux, the half assed way'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-9108862583559183153</id><published>2009-02-05T21:40:00.021Z</published><updated>2010-08-11T19:17:37.777+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RAID5'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='boot'/><category scheme='http://www.blogger.com/atom/ns#' term='nVidia MediaShield'/><title type='text'>And here we go again - RAID5 fakeraid + Linux</title><content type='html'>It's that time of the decade where I get a new machine, this time an nVidia MCP79 (a.k.a. GeForce 9400) based &lt;a href="http://www.gigabyte.com.tw/Products/Motherboard/Products_Overview.aspx?ProductID=2946"&gt;motherboard from Gigabyte&lt;/a&gt;. Oh, and yes, the MCP79 is the same all-inclusive nForce chipset nVidia uses in the new MacBook Pros, as well as their &lt;a href="http://vr-zone.com/articles/nvidia-mcp79-based-atom-nettop-first-look/6313.html?doc=6313"&gt;Atom "can of whoop-ass"&lt;/a&gt; for set top HDTV boxes.&lt;br /&gt;&lt;br /&gt;As most people, I'm pleasantly surprised by the features of the chipset. My goal was to build an HTPC, and with one good durable mobo (with both HDMI and optical SPDIF), the adding of a 45 nm quad core and 4 GB dirt cheap DDR2 RAM, I should have a solution that will last for some time. Oh, and of course, since we're hopefully going to store a lot of media data there, we can't forget the 3x 1 TB Samsung SpinPoint HDDs in a RAID5 array, which is what brings us here today.&lt;br /&gt;&lt;br /&gt;Yep, as you guessed from the title, it's ye olde getting Linux to work with fakeraid. And the first thing I gotta say is I'm sick and tired of all the posts you see on the net where people asking how to make Linux work with their fakeraid are met with a "why don't you use Linux's md instead".&lt;br /&gt;Well, I'm sorry, but there are still people out there who want to dual boot with Vista and trust nVidia RAID5 driver (MediaShield) enough not to want to make a complete mess of their Windows installation. Hell, I'd rather spend time figuring out how to make my RAID5 work in Linux than have to spend time doing the same thing in Windows. Plus, I like the convenience of having my BIOS handle things like RAID.&lt;br /&gt;&lt;br /&gt;Here we are then, with Vista installed and painfully updated at last (see below) and a blank partition on the nVidia RAID5 MediaShield array that's just dying to get Linux installed.&lt;br /&gt;&lt;br /&gt;OK, it's not that I mind a challenge here, but I've got a blank HDD lying around, so this time, what we're going to do is install Linux on that standalone drive, conf it so that it sees the RAID5 partition, and then move over our system rather than have to create our own custom RAID5 installation CD.&lt;br /&gt;&lt;br /&gt;As usual, I'm gonna use the latest Slackware (12.2) so ymmv.&lt;br /&gt;&lt;br /&gt;1. Slackware install with ALL the options you really want in the end (we'll be using that partition as the source) and LILO booting the single HDD = piece of cake. Just make sure that you don't install LILO on anything else BUT the HDD that's not part of the array&lt;br /&gt;2. First bad surprise - if you keep your 2.6 kernel as is, no matter what you try, dmraid will return:&lt;pre class="brush: text"&gt;ERROR: device-mapper target type "raid45" not in kernel&lt;/pre&gt;Don't waste your time changing the raid45 to raid456 identifiers in dmraid either - you'll still get the same error. The kernel actually needs to be patched for dmraid to be happy.&lt;br /&gt;&lt;br /&gt;[UPDATED]One year later, and still a mess. As of 2.6.35, the dm-raid45 module still hadn't been integrated to the kernel, plus the evil people at Red Hat who were supposed to maintain that module have &lt;a href="http://people.redhat.com/%7Eheinzm/sw/dm/dm-raid45/"&gt;completely dropped the ball&lt;/a&gt;, the Gentoo people also have &lt;a href="http://en.gentoo-wiki.com/wiki/RAID/dm-raid45"&gt;dropped the ball (after 2.6.31)&lt;/a&gt; and the last set of dm-raid45 patches I could only go to 2.6.33 (and don't work against 2.6.35). So I guess we're stuck with 2.6.33 then. This last set of dmraid patch can be found from &lt;a href="http://tmb.mine.nu/Mandriva/Cooker/dm-raid/"&gt;Mandriva&lt;/a&gt;. Can't help but find it strange that, while the dm-raid45 module is commonly used in Ubuntu (except that dmraid itself is useless with large disks as it doesn't support GPT), nobody seems to care about trying to merge it with the official kernel tree. Oh well...&lt;pre class="brush: text"&gt;root@stella# cd /usr/src/linux-2.6.33/&lt;br /&gt;root@stella# wget http://tmb.mine.nu/Mandriva/Cooker/dm-raid/dm-raid45_2.6.33-rc1-20091126.patch&lt;br /&gt;root@stella# patch -p1 &amp;lt; dm-raid45_2.6.33-rc1-20091126.patch&lt;br /&gt;root@stella# wget http://tmb.mine.nu/Mandriva/Cooker/dm-raid/dm-raid45-buildfix-for-2.6.33.patch&lt;br /&gt;root@stella# patch -p1 &amp;lt; dm-raid45-buildfix-for-2.6.33.patch&lt;/pre&gt;OK, so you just go through your usual kernel recompile. Now, a couple of things I wanna point out:&lt;br /&gt;- You do want to reduce the size of your kernel if you're planning to remove the standalone HD and still boot your RAID5 array Linux partition with a decent solution&lt;br /&gt;- Of course you want to add Device mapper support (Device drivers -&gt; Multiple devices driver support (RAID and LVM)) and the new experimental "RAID 4/5 target" that was added by the kernel patch&lt;br /&gt;- Despite being a Gb adpater, the nForce Ethernet driver (forcedeth) is to be found in: Ethernet (10 or 100Mbit) -&gt;  EISA, VLB, PCI and on board controllers -&gt;  nForce Ethernet support&lt;br /&gt;- if you're using ext4 for root, don't forget to include ext2 support as well, as your root partition cannot be mounted without it.&lt;br /&gt;&lt;br /&gt;Once you have a kernel that boots, you can move on to the dmraid install. This time, no need for devmapper. Just download the current dmraid source from &lt;a href="http://people.redhat.com/%7Eheinzm/sw/dmraid/src/"&gt;http://people.redhat.com/~heinzm/sw/dmraid/src/&lt;/a&gt;:&lt;pre class="brush: text"&gt;root@stella# cd /usr/src&lt;br /&gt;root@stella# wget http://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-current.tar.bz2&lt;br /&gt;root@stella# tar -xjvf dmraid-current.tar.bz2&lt;br /&gt;root@stella# cd dmraid/1.0.0.rc15&lt;br /&gt;root@stella# ./configure; make; make install&lt;br /&gt;root@stella# dmraid -ay&lt;br /&gt;RAID set "nvidia_aeejfdbe" was activated&lt;br /&gt;RAID set "nvidia_aeejfdbep1" was activated&lt;br /&gt;RAID set "nvidia_aeejfdbep2" was activated&lt;br /&gt;RAID set "nvidia_aeejfdbep3" was activated &lt;/pre&gt;Yay! it works!&lt;br /&gt;&lt;br /&gt;If you only see see the RAW disk (&lt;code&gt;nvidia_aeejfdbe&lt;/code&gt;) but not the partitions, that's probably because you're using a GPT disk. In that case, you need to also run &lt;code&gt;kpartx&lt;/code&gt; as follows:&lt;pre class="brush: text"&gt;root@stella# kpartx -a -v /dev/mapper/nvidia_aeejfdbe&lt;br /&gt;add map nvidia_aeejfdbe1 (252:1): 0 262144 linear /dev/mapper/nvidia_aeejfdbe 34&lt;br /&gt;add map nvidia_aeejfdbe2 (252:2): 0 209715200 linear /dev/mapper/nvidia_aeejfdbe 264192&lt;br /&gt;add map nvidia_aeejfdbe3 (252:3): 0 186478592 linear /dev/mapper/nvidia_aeejfdbe 209979392&lt;br /&gt;add map nvidia_aeejfdbe4 (252:4): 0 11324626944 linear /dev/mapper/nvidia_aeejfdbe 396457984&lt;/pre&gt;kpartx itself can be obtained from the &lt;a href="http://ftp.de.debian.org/debian/pool/main/m/multipath-tools/multipath-tools_0.4.8.orig.tar.gz"&gt;multipath-tools&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;OK, so now we can get going. Be sure you format the RELEVANT partition. In my case, I'll be using &lt;code&gt;nvidia_aeejfdbep2&lt;/code&gt;, the second partition on the RAID5 array for the GNU/Linux system.&lt;br /&gt;&lt;pre class="brush: text"&gt;root@stella# mkfs.ext4 /dev/mapper/nvidia_aeejfdbep2&lt;br /&gt;root@stella# mount /dev/mapper/nvidia_aeejfdbep2 /mnt/hd&lt;br /&gt;root@stella# mkdir /mnt/hd/proc&lt;br /&gt;root@stella# mkdir /mnt/hd/sys&lt;br /&gt;root@stella# cp -ax / /mnt/hd&lt;/pre&gt;This could take a while...&lt;br /&gt;Note that the -x option ensures that we stay on a single file system&lt;br /&gt;&lt;br /&gt;OK, in the next post we'll see the grub way to (kinda) boot this whole mess&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-9108862583559183153?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/9108862583559183153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/02/and-here-we-go-again-raid5-fakeraid.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/9108862583559183153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/9108862583559183153'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/02/and-here-we-go-again-raid5-fakeraid.html' title='And here we go again - RAID5 fakeraid + Linux'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-225091010181652196</id><published>2009-02-04T13:32:00.001Z</published><updated>2009-02-04T13:34:02.501Z</updated><title type='text'>These are not the ads you're looking for</title><content type='html'>Here's a link to the hosts file I use on my Windows systems:&lt;br /&gt;&lt;a href="http://www.mvps.org/winhelp2002/hosts.htm"&gt;http://www.mvps.org/winhelp2002/hosts.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-225091010181652196?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/225091010181652196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/02/these-are-not-ads-youre-looking-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/225091010181652196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/225091010181652196'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/02/these-are-not-ads-youre-looking-for.html' title='These are not the ads you&apos;re looking for'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7672954162702662460</id><published>2009-02-02T12:18:00.004Z</published><updated>2009-03-14T01:52:42.249Z</updated><title type='text'>Windows update error 0x8024402c</title><content type='html'>Well, like &lt;a href="http://www.updatexp.com/0x8024402c.html"&gt;everybody else&lt;/a&gt;, this error has been driving me nuts. Plus it manifested itself in such a weird way I couldn't believe.&lt;br /&gt;&lt;br /&gt;I already had that issue last week on a brand new Vista 64 install, and somehow, it appeared that resetting the LAN paramaters to default did the trick, and after a short hour struggle, I was able to apply the updates.&lt;br /&gt;&lt;br /&gt;I was not so lucky with that old laptop of mine running XP, which was badly in need of critical updates, but that couldn't seem to download them. Well, actually, at first, it started to download the updates alright (got through about 8-10 of them) but then it failed! Tried every hint from the link above. None worked...&lt;br /&gt;&lt;br /&gt;This is a job for... Is it a bird? Is it a plane? No, it's &lt;a href="http://www.wireshark.org/"&gt;Wireshark&lt;/a&gt;!&lt;br /&gt;OK, so Wireshark reveals that, despite everything Microsoft wants to make you believe, the issue is really with au.download.windowsupdate.com not being resolved. Of course, one has to wonder why an Irish based Windows has to pick up its updates from Australia, but hey, that's Microsoft for you.&lt;br /&gt;Indeed, a few tests from the commandline show that au.download.microsoft.com is indeed not resolvable. OK, let's see what the DSL router (which can also do basic diagnostic checks) has to say about it... WTF? The DSL router sees no issue there:&lt;br /&gt;&lt;pre&gt;Resolving au.download.windowsupdate.com ... 65.54.84.196&lt;br /&gt;Reply from 65.54.84.196&lt;br /&gt;Reply from 65.54.84.196&lt;br /&gt;Reply from 65.54.84.196&lt;br /&gt;Ping Host Successful&lt;/pre&gt;And this is where it gets really weird, as it appears that my Linux machines also cannot resolve the host... while the router can?!?! No way!&lt;br /&gt;&lt;br /&gt;OK, by now I need to apply these updates badly, and therefore, yes, you got it, we're gonna edit the systems32/drivers/etc/hosts file of course and get done with it.&lt;br /&gt;So here goes:&lt;br /&gt;&lt;pre&gt;65.54.84.196 au.download.windowsupdate.com&lt;/pre&gt;and try downloading the updates again (with Wireshark still running in the background).&lt;br /&gt;What the hell?!? No difference - We still get DNS requests for au.download.windowsupdate.com that don't seem to resolve. But how on earth is that possible with a triple checked hosts file?&lt;br /&gt;&lt;br /&gt;The answer of course is that Microsoft &lt;a href="http://permalink.gmane.org/gmane.comp.security.full-disclosure/43878"&gt;&lt;span style="font-weight: bold;"&gt;deliberately&lt;/span&gt; screwed up their DNS resolution&lt;/a&gt; so that their update servers can NOT be overridden by the hosts file. Yeah, I can understand the logic of it, but how about relying on https and certificates instead, to check that the server is legit, rather than breaking down DNS. Talk about another half assed approach to security...&lt;br /&gt;&lt;br /&gt;Well, that will teach me to try to work around a problem rather than solve it, because with no DNS override, I'm back to square one. And I'm not really willing to install my own DNS server just to work around this problem either.&lt;br /&gt;&lt;br /&gt;Now, further use of nslookup with various Irish DNS seem to indicate that they ALL have the same issue??? Is someone out there to get me or what, because none of this makes any sense!&lt;br /&gt;&lt;br /&gt;At this stage, instead of banging your head against the wall, you gotta try to apply logic. If all of the Irish DNSs were failing to resolve the Windows Update servers, you'd probably get people armed with pitchforks on the streets within minutes, so &lt;span style="font-weight: bold;"&gt;I&lt;/span&gt; must be doing something wrong.&lt;br /&gt;A quick change of NS lookup tool actually confirms it (DON'T USE NSLOOKUP ANY MORE STUPID!). dig quickly shows that it's only the DNS that I was using (Eircom's 159.134.237.6 &amp;amp; 159.134.248.17 - never trust the incumbant!) can't resolve the bloody server, while my own ISP's DNS can.&lt;br /&gt;&lt;br /&gt;A quick change of DNS servers on the DSL router, a full reboot (ipconfig /release + /renew would probably have done the trick, but with M$, you can never be too sure), and Windows Update is happy again.&lt;br /&gt;&lt;br /&gt;Good thing I didn't have anything better to do this morning. And just to sum up the lessons for today:&lt;br /&gt;- 0x8024402c happens if Windows cannot resolve the IP of the download servers&lt;br /&gt;- Windows update CAN switch download servers on the fly while downloading (!)&lt;br /&gt;- Use Wireshark to find out which download servers Windows Update is trying to use&lt;br /&gt;- Windows name resolution is screwed so that it will always try to use DNS and not the hosts file for the download servers&lt;br /&gt;- Don't trust what your DSL router tells you about Name Resolution - it might not be using the configured DNS servers!&lt;br /&gt;- DON'T USE NSLOOKUP ANY MORE! Use dig instead.&lt;br /&gt;- Screw Eircom!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7672954162702662460?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7672954162702662460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/02/windows-update-error-0x8024402c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7672954162702662460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7672954162702662460'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/02/windows-update-error-0x8024402c.html' title='Windows update error 0x8024402c'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-8552610024519401109</id><published>2009-01-15T11:47:00.009Z</published><updated>2009-09-17T17:00:55.680+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='partition'/><category scheme='http://www.blogger.com/atom/ns#' term='xfs'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='recovery'/><category scheme='http://www.blogger.com/atom/ns#' term='ext2'/><category scheme='http://www.blogger.com/atom/ns#' term='swap'/><category scheme='http://www.blogger.com/atom/ns#' term='ext3'/><title type='text'>This script will save your life!</title><content type='html'>Or at least your data.&lt;br /&gt;&lt;br /&gt;I have been unofficially sysadm'ing a bunch of HP DL380 running Linux over the past few years, and over the Christmas period, one of those, which had a complex mix of ReiserFS, SWAP and XFS partitions on a RAID5 Smart Array device (dev/cciss/c0d0), found nothing better than to start overwritting the MBR!&lt;br /&gt;&lt;br /&gt;What this meant of course was, bye bye partition table, and, as you might guess, I didn't find the need to backup the partition data, thinking: "Heck it's RAID5 - what's the worse that can happen?"&lt;br /&gt;&lt;br /&gt;ADVICE #1: If you're running a server in PROD, ALWAYS save a copy of the output of fdisk someplace safe!&lt;br /&gt;&lt;br /&gt;Thus, there I was, with a non bootable server and a blank partition table, but with data I very much wanted to get back to. And the only tool I had at my disposal (through a remote console connection, because of course, the server had to be remote) was just a Slackware boot CD (because it detects cciss drives) running busybox.&lt;br /&gt;&lt;br /&gt;ADVICE #2: If you have physical access to your server, and it's not using a nonstandard disk device, you can probably find a Linux rescue CD with &lt;a href="http://www.brzitwa.de/mb/gpart/index.html"&gt;gpart&lt;/a&gt; (but better use &lt;a href="http://ftp.debian.org/debian/pool/main/g/gpart/"&gt;the latest Debian version&lt;/a&gt;, which is more up to date) that supports more partitions types, and will do a much better job. The script below is really if you are in a hurry or you have limited resources.&lt;br /&gt;&lt;br /&gt;How difficult can it be to detect partitions with only a shell script then? Well not that difficult, as the script below will prove. But first let me be clear about what the script is meant to achieve:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;This script is meant to detect the POTENTIAL beginning of a partition only. It will tell you the first cylinder, but it will not tell you the size, so unless it's the last one on disk, you'll have to figure out where the next partition begins as well&lt;br /&gt;&lt;/li&gt;&lt;li&gt;This script will detect primary partitions only. If you have extended partitions, you're on your own&lt;/li&gt;&lt;li&gt;The script only detected EXT2/EXT3, ReiserFS, Swap (version 2) and XFS. It does not detect FAT or NTFS (because I had no use for it). However, if you know the Magic string and location of other partitions types, you should be able to easily modify the script to add them&lt;/li&gt;&lt;li&gt;Not counting the comments, I kept the script short and basic, because you're most likely to have to type it in by hand, so shorter is better&lt;/li&gt;&lt;li&gt;Be mindful that there are likely to be false positives&lt;br /&gt;&lt;/li&gt;&lt;li&gt;And of course, while I succesfully tested this script and all the partitions types on various systems, I am not responsible for any damage occuring from using it.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;OK, so below is the part you are interested in:&lt;br /&gt;&lt;pre class="brush: bash"&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;#    gpart.sh v1.1 - Linux partitions detection script&lt;br /&gt;#    Copyright (C) 2009  &gt;NIL:&lt;br /&gt;#    Based in part on gpart (C) 1999-2001 Michail Brzitwa et al.&lt;br /&gt;#&lt;br /&gt;#    This program is free software: you can redistribute it and/or modify&lt;br /&gt;#    it under the terms of the GNU General Public License as published by&lt;br /&gt;#    the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;#    (at your option) any later version.&lt;br /&gt;#&lt;br /&gt;#    This program is distributed in the hope that it will be useful,&lt;br /&gt;#    but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;#    GNU General Public License for more details.&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;## Set your disk parameters below&lt;br /&gt;#&lt;br /&gt;device="/dev/sda"&lt;br /&gt;cyl_start=1&lt;br /&gt;# To find your max cyl_end, use fdisk or cfdisk&lt;br /&gt;cyl_end=35697&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;## FS Magic length, string and offset&lt;br /&gt;## Uncomment only one of the sections below&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;## XFS&lt;br /&gt;#bs=4&lt;br /&gt;#magic="XFSB"&lt;br /&gt;#magic_offset=0x0&lt;br /&gt;&lt;br /&gt;## ReiserFS&lt;br /&gt;#bs=4&lt;br /&gt;#magic="ReIs"&lt;br /&gt;#magic_offset=0x10034&lt;br /&gt;&lt;br /&gt;## Swap space (v2 only!)&lt;br /&gt;#bs=4&lt;br /&gt;#magic="ACE2"&lt;br /&gt;#magic_offset=0x0FFC&lt;br /&gt;&lt;br /&gt;## Ext2 / Ext3&lt;br /&gt;bs=2&lt;br /&gt;## OK, here I have to curse the EXT FileSystem devs for&lt;br /&gt;## not chosing a *PROPER* ASCII Magic like everyone else,&lt;br /&gt;## but using 0x53 0xEF instead as this contains i-umlaut&lt;br /&gt;## Thank God for the -e option of echo, which translates&lt;br /&gt;## a "\0###" sequence into the relevant octal character&lt;br /&gt;magic=`echo -ne 'S\0357'`&lt;br /&gt;magic_offset=0x0438&lt;br /&gt;&lt;br /&gt;# on almost any recent disk, a cylinder is&lt;br /&gt;# 255(tracks)*63(sectors/track)*512(bytes/sector) = 8225280&lt;br /&gt;# If you're not sure, check what fdisk tells you&lt;br /&gt;cyl_bytes=8225280&lt;br /&gt;mbr_bytes=32256&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;## You shouldn't have to modify anything below this&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;# dd skips in multiples of bs, so we need to compute&lt;br /&gt;# the cylinder size and magic_offset in bs blocks&lt;br /&gt;cyl_blocks=$(($cyl_bytes / $bs))&lt;br /&gt;mbr_blocks=$(($mbr_bytes / $bs))&lt;br /&gt;magic_blocks=$(($magic_offset / $bs))&lt;br /&gt;&lt;br /&gt;for i in $(seq $cyl_start $cyl_end); do&lt;br /&gt;if [ $i == 1 ]; then&lt;br /&gt;  # For the first cylinder, we need to skip the MBR as well&lt;br /&gt;  skip=$(($magic_blocks + $mbr_blocks))&lt;br /&gt;else&lt;br /&gt;  skip=$(($(($i-1)) * $cyl_blocks + $magic_blocks))&lt;br /&gt;fi&lt;br /&gt;# Look for the magic block&lt;br /&gt;header=`dd if=$device bs=$bs count=1 skip=$skip 2&gt;/dev/null`&lt;br /&gt;if [ "$header" = "$magic" ]; then&lt;br /&gt;  echo "MATCH: cylinder $i ($header)"&lt;br /&gt;fi&lt;br /&gt;done&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-8552610024519401109?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/8552610024519401109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2009/01/this-script-will-save-your-life.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8552610024519401109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/8552610024519401109'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2009/01/this-script-will-save-your-life.html' title='This script will save your life!'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7320398677861535317</id><published>2008-12-17T18:09:00.004Z</published><updated>2009-01-13T11:49:20.044Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='openWRT'/><category scheme='http://www.blogger.com/atom/ns#' term='SSH'/><category scheme='http://www.blogger.com/atom/ns#' term='putty'/><title type='text'>Incoming packet was garbled on decryption (putty)</title><content type='html'>For &lt;span style="font-style: italic;"&gt;some reason&lt;/span&gt;, I decided to install openssh on openWRT (Kamikaze), and I have been getting "Incoming packet was garbled on decryption" in putty. This seems to be a ongoing issue linked to the encryption cyphers used by openSSH on low resources systems.&lt;br /&gt;&lt;br /&gt;The solution: In the Connection -&gt; SSH menu of putty, make sure 3DES is at the top, and the problem will go away&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7320398677861535317?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7320398677861535317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2008/12/incoming-packet-was-garbled-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7320398677861535317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7320398677861535317'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2008/12/incoming-packet-was-garbled-on.html' title='Incoming packet was garbled on decryption (putty)'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-2388884509350212064</id><published>2008-08-12T18:43:00.007+01:00</published><updated>2009-10-06T17:40:36.024+01:00</updated><title type='text'>mmc driver for openwrt, part deux</title><content type='html'>Went over the MMC configuration for my openWRT router yesterday, as I wanted to relinquish the use of the SES button by the driver (GPIO4) to use it instead as a toggle button for the Wifi, and use GPIO5 for DO.&lt;br /&gt;As I did just that, I also "fixed" the MMC driver to stop the Power LED from blinking every time the SD card was accessed.&lt;br /&gt;The way I did that was to use the following config.h:&lt;br /&gt;&lt;pre class="brush: text"&gt;#define SD_CS_POWER 0x82&lt;/pre&gt;And the modify the spi.c to have:&lt;br /&gt;&lt;pre class="brush: text"&gt;static inline void mmc_spi_cs_high(void) {&lt;br /&gt;port_state |= SD_CS_POWER;&lt;br /&gt;(...)&lt;/pre&gt;Also, as I am now using GPIOs #2,3,5,7, I had to add a line&lt;br /&gt;&lt;pre class="brush: text"&gt;echo "0xac" &gt; /proc/diag/gpiomask&lt;/pre&gt;in one of the init scripts.&lt;br /&gt;&lt;br /&gt;For /etc/hotplug.d/button/01-radio-toggle, I am currently using the following, but I might change that to just turn the radio on/off:&lt;br /&gt;&lt;pre class="brush: bash"&gt;if [ "$BUTTON" = "ses" ] ; then&lt;br /&gt;  if [ "$ACTION" = "pressed" ] ; then&lt;br /&gt;          WIFI_RADIOSTATUS=$(wlc radio)&lt;br /&gt;#               touch /tmp/$WIFI_RADIOSTATUS&lt;br /&gt;          case "$WIFI_RADIOSTATUS" in&lt;br /&gt;          0|"")&lt;br /&gt;                  uci set wireless.wl0.disabled=0&lt;br /&gt;                  uci commit wireless&lt;br /&gt;                  wifi&lt;br /&gt;                  wlc radio 1&lt;br /&gt;                  echo f &gt; /proc/diag/led/wlan&lt;br /&gt;          ;;&lt;br /&gt;          1)&lt;br /&gt;                  uci set wireless.wl0.disabled=1&lt;br /&gt;                  uci commit wireless&lt;br /&gt;                  wifi&lt;br /&gt;                  wlc radio 0&lt;br /&gt;                  echo 0 &gt; /proc/diag/led/wlan&lt;br /&gt;          ;;&lt;br /&gt;          esac&lt;br /&gt;  fi&lt;br /&gt;fi&lt;/pre&gt;&lt;br /&gt;Despite the non-quite-thought-through use of the GPIOs in the default MMC driver, I'm beginning to think openWRT is the best invention since sliced bread!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-2388884509350212064?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/2388884509350212064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2008/08/mmc-driver-for-openwrt-part-deux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2388884509350212064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/2388884509350212064'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2008/08/mmc-driver-for-openwrt-part-deux.html' title='mmc driver for openwrt, part deux'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7198685619387335065</id><published>2008-08-10T20:13:00.015+01:00</published><updated>2009-10-02T21:53:07.448+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vista 64'/><category scheme='http://www.blogger.com/atom/ns#' term='unsigned drivers'/><title type='text'>Installing unsigned drivers on Vista 64</title><content type='html'>OK, if you ended up here, it's probably because you've been trying to install an unsigned driver (eg. XBCD Xbox Gamepad, PSPLinkUSB), and found out about the requirement for all drivers to be signed in Vista 64.&lt;br /&gt;&lt;br /&gt;Now, you shouldn't rush with the first article you found on the web that tells you how to disable signed drivers in Vista altogether. The MUCH smarter way is to run Vista 64 in test mode instead, and self sign your drivers. And to be clear, NO, this does NOT require you to recompile the drivers! You can just pick up the drivers you got from someone and sign them away. Of course, one could comment on yet another of Microsoft's stupid "we don't trust our users" decisions of having to enable the test mode to have users install their self signed drivers. A MUCH SMARTER way would have been to do that outside of the test mode as well. After all, if a user went as far as installing their own root certificate, it's probably that it should be trusted.&lt;br /&gt;&lt;br /&gt;Anyway, the procedure is as follows (and it is described in much more details &lt;a href="http://www.rage3d.com/board/showthread.php?t=33920573"&gt;here&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;1. Get Vista to boot in test mode always with the command:&lt;br /&gt;&lt;pre class="brush: text"&gt;bcdedit.exe /store C:\Boot\BCD /set testsigning yes&lt;/pre&gt;(And there again, I have to curse Microsoft for NOT indicating with bcdedit /? that you can use the /store option to specify your store, and having to spend HOURS trying to figure out why I was getting the following error which is apparently expected, if you boot multiple OSes and don't let Microsoft take over your boot record:&lt;br /&gt;&lt;code&gt;The boot configuration data store could not be opened.&lt;br /&gt;The system cannot find the file specified.&lt;/code&gt;)&lt;br /&gt;&lt;br /&gt;After you enter that command, you MUST reboot Vista.&lt;br /&gt;&lt;br /&gt;Note: Once Test Mode is enabled, you will get the Windows Version as well as "Test Mode" displayed over the background image. If you're bothered by this, what on earth are you doing with your computer? Staring at the background?&lt;br /&gt;&lt;br /&gt;2. Download the necessary DDK SelfSign files, which I am CONVENIENTLY providing to you &lt;a href="http://nil.rpc1.org/files/SignTools_Vista.zip"&gt;HERE&lt;/a&gt;, as Microsoft is also an ass there - People shouldn't have to download 2.7 GB to gain access to 700 KB worth of files!&lt;br /&gt;Extract them to the directory where you have your driver&lt;br /&gt;&lt;br /&gt;3. Let's say you want to install the PSPLinkusb driver. First you want to generate your own root certificate for that driver with:&lt;br /&gt;&lt;pre class="brush: text"&gt;makecert -$ individual -r -pe -ss "Self Signed Drivers" -n CN="Self Signed Drivers" selfsign.cer&lt;/pre&gt;4. Then you install the certificate you just created to the trusted root directory:&lt;br /&gt;&lt;pre class="brush: text"&gt;certmgr /add selfsign.cer /s /r localMachine root&lt;/pre&gt;(NB: if you have UAC on, you will need to run this command in a "run as administrator" command prompt)&lt;br /&gt;&lt;br /&gt;5. Finally, you sign EACH .sys file using the certificate:&lt;br /&gt;&lt;pre class="brush: text"&gt;signtool sign /v /s "Self Signed Drivers" /n "Self Signed Drivers" libusb0.sys&lt;br /&gt;signtool sign /v /s "Self Signed Drivers" /n "Self Signed Drivers" libusb0_x64.sys&lt;/pre&gt;Voila! Now you can install these drivers and get on with your life.&lt;br /&gt;&lt;br /&gt;For completion, I am providing below the result of a successful certification for the libusb drivers:&lt;br /&gt;&lt;pre class="brush: text"&gt;E:\Program Files (x86)\OpenOCD\0.2.0\drivers\ft2232&amp;gt;makecert -$ individual -r -pe -ss "Self Signed Drivers" -n CN="Self Signed Drivers" selfsign.cer&lt;br /&gt;Succeeded&lt;br /&gt;&lt;br /&gt;E:\Program Files (x86)\OpenOCD\0.2.0\drivers\ft2232&amp;gt;certmgr /add selfsign.cer /s /r localMachine root&lt;br /&gt;CertMgr Succeeded&lt;br /&gt;&lt;br /&gt;E:\Program Files (x86)\OpenOCD\0.2.0\drivers\ft2232&amp;gt;signtool sign /v /s "Self Signed Drivers" /n "Self Signed Drivers" libusb0.sys&lt;br /&gt;The following certificate was selected:&lt;br /&gt;   Issued to: Self Signed Drivers&lt;br /&gt;   Issued by: Self Signed Drivers&lt;br /&gt;   Expires:   2040.01.01 00:59:59&lt;br /&gt;   SHA1 hash: E0CEAD6474EFD1BF0F6D47501FF3F069C20FD7C7&lt;br /&gt;&lt;br /&gt;Done Adding Additional Store&lt;br /&gt;&lt;br /&gt;Attempting to sign: libusb0.sys&lt;br /&gt;Successfully signed: libusb0.sys&lt;br /&gt;&lt;br /&gt;Number of files successfully Signed: 1&lt;br /&gt;Number of warnings: 0&lt;br /&gt;Number of errors: 0&lt;br /&gt;&lt;br /&gt;E:\Program Files (x86)\OpenOCD\0.2.0\drivers\ft2232&amp;gt;signtool sign /v /s "Self Signed Drivers" /n "Self Signed Drivers" libusb0_x64.sys&lt;br /&gt;The following certificate was selected:&lt;br /&gt;   Issued to: Self Signed Drivers&lt;br /&gt;   Issued by: Self Signed Drivers&lt;br /&gt;   Expires:   2040.01.01 00:59:59&lt;br /&gt;   SHA1 hash: E0CEAD6474EFD1BF0F6D47501FF3F069C20FD7C7&lt;br /&gt;&lt;br /&gt;Done Adding Additional Store&lt;br /&gt;&lt;br /&gt;Attempting to sign: libusb0_x64.sys&lt;br /&gt;Successfully signed: libusb0_x64.sys&lt;br /&gt;&lt;br /&gt;Number of files successfully Signed: 1&lt;br /&gt;Number of warnings: 0&lt;br /&gt;Number of errors: 0&lt;br /&gt;&lt;br /&gt;E:\Program Files (x86)\OpenOCD\0.2.0\drivers\ft2232&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7198685619387335065?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7198685619387335065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2008/08/installing-unsigned-drivers-on-vista-64.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7198685619387335065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7198685619387335065'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2008/08/installing-unsigned-drivers-on-vista-64.html' title='Installing unsigned drivers on Vista 64'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-3420651605381543761</id><published>2008-08-04T15:41:00.008+01:00</published><updated>2009-10-06T17:39:26.497+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ACCESS DENIED'/><category scheme='http://www.blogger.com/atom/ns#' term='VISTA'/><title type='text'>No more "Access Denied" for your files on Vista</title><content type='html'>Should really be in techno rant, because Vista's "security" is done completely backwards, but here we go. If you try to move/copy/delete/rename the file or directory C:\access_denied, this is what you need to do to recover access:&lt;br /&gt;&lt;br /&gt;Open an admin command prompt and issue the following:&lt;br /&gt;&lt;pre class="brush: text"&gt;takeown /f C:\access_denied&lt;br /&gt;icacls C:\access_denied /grant &amp;lt;username&amp;gt;:F&lt;/pre&gt;For what is worth, this is how you manage to delete the files from the infamous C:\Windows\System32\DriverStore\FileRepository, to stop Windows from being a BLEEPING BLEEP with the BLEEPING drivers. I'm gonna have the final say about WHICH driver I want to get installed dammit!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-3420651605381543761?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/3420651605381543761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2008/08/no-more-access-denied-for-your-files-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3420651605381543761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3420651605381543761'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2008/08/no-more-access-denied-for-your-files-on.html' title='No more &quot;Access Denied&quot; for your files on Vista'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-881620973956208263</id><published>2008-07-17T10:26:00.003+01:00</published><updated>2009-10-06T17:38:36.548+01:00</updated><title type='text'>Script to convert Unix time to a human readable date</title><content type='html'>unixtime:&lt;br /&gt;&lt;pre class="brush: bash"&gt;#!/bin/sh&lt;br /&gt;date -d @$1&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-881620973956208263?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/881620973956208263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2008/07/script-to-convert-unix-time-to-human.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/881620973956208263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/881620973956208263'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2008/07/script-to-convert-unix-time-to-human.html' title='Script to convert Unix time to a human readable date'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7266791427735561556</id><published>2008-07-10T23:07:00.006+01:00</published><updated>2008-08-10T20:52:52.076+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mmc driver'/><category scheme='http://www.blogger.com/atom/ns#' term='WRT54G'/><category scheme='http://www.blogger.com/atom/ns#' term='SD card'/><category scheme='http://www.blogger.com/atom/ns#' term='openWRT'/><title type='text'>adding a 2GB SD card on a WRT54G with openWRT</title><content type='html'>It's been documented to death, so I'm not gonna bother telling you how exactly I did it. Just make sure you use the optimised mmc.o driver from &lt;a href="http://forum.openwrt.org/viewtopic.php?id=9653"&gt;http://forum.openwrt.org/viewtopic.php?id=9653&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I will however document the errors you can get when there's something wrong with your soldering, as I can attest that, if it doesn't work, it doesn't come from the card or the code, it comes from lousy soldering.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;o [FATAL] mmc_card_init: invalid response from card: 03 found, waiting for 01&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is a short between your CLK line (usually GPIO3) and your DI line (usually GPIO2)&lt;br /&gt;This can happen if your connection to the white LED is also touching the amber LED. &lt;b&gt;TRIPLE&lt;/b&gt; check that your solder points are clean between the 2 front LEDs&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;o [WARN] mmc_init: impossible to get card indentification info for reason code: 01&lt;br /&gt;o [FATAL] mmc_init: got an error when trying to get card configuration registers: 02&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This one's a lot trickier. Just make sure you have the &lt;a href="http://downloads.openwrt.org/gpio.tar.gz"&gt;gpio tool&lt;/a&gt; at hand, and watch the amber LED closely. By default, it should be completely off. Then issue "gpio disable 3" and then "gpio enable 3". If you can now see a small residual light on the LED, that didn't exist before, then your LED is screwed and therefore your CLK is screwed.&lt;br /&gt;Always make sure that your "enabled" voltages on GPIO are 0V and stay 0V.&lt;br /&gt;&lt;br /&gt;I ended up removing the Amber LED (after a test using GPIO5 confirming that I had indeed an issue with GPIO3) and now everything works like a charm.&lt;br /&gt;&lt;br /&gt;Oh, and if you're running in mixed mode (root fs still using the onboard flash), chroot is your friend to install packages on the card with ipkg.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7266791427735561556?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7266791427735561556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2008/07/adding-2gb-sd-card-on-wrt54g-with.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7266791427735561556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7266791427735561556'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2008/07/adding-2gb-sd-card-on-wrt54g-with.html' title='adding a 2GB SD card on a WRT54G with openWRT'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1970364787480177542</id><published>2007-12-07T11:14:00.000Z</published><updated>2007-12-07T11:24:09.993Z</updated><title type='text'>Opening ports for remote access on ZyXEL DSL modem</title><content type='html'>I have to do this once in a while, then completely forget how it's done, and one year later, I spend 1 hour trying to figure it out again. Well, at least on the Prestige 660RU-T1 it's fairly easy from the web interface: NAT -&gt; SUA Only and add something like:&lt;br /&gt;&lt;table align="center" border="1" cellpadding="1" cellspacing="0" width="90%"&gt;&lt;tbody&gt;&lt;tr align="center"&gt;                    &lt;td class="TableTilte" height="30" width="7%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class="TableTilte" height="30" width="30%"&gt;                    Start Port No.                  &lt;/td&gt;&lt;td class="TableTilte" height="30" width="30%"&gt;                    End Port No.                  &lt;/td&gt;&lt;td class="TableTilte" width="33%"&gt;                    IP Address                  &lt;/td&gt;&lt;/tr&gt;&lt;tr align="center"&gt;                    &lt;td class="TableItem"&gt;1&lt;/td&gt;&lt;td&gt;All ports                  &lt;/td&gt;&lt;td&gt;All ports                  &lt;/td&gt;&lt;td&gt;&lt;input name="NATserverAddr1" size="15" maxlength="15" value="0.0.0.0" onfocus="this.select()" onblur="checkIPFormat(this)" type="text"&gt;                  &lt;/td&gt;&lt;/tr&gt;                &lt;tr align="center"&gt;&lt;td class="header2"&gt;                     2                 &lt;/td&gt;                  &lt;td&gt;                    &lt;input name="NATPortNo?2" size="5" maxlength="5" value="22" onkeypress="chk_num(event)" type="text"&gt;                   &lt;/td&gt;                  &lt;td&gt;                    &lt;input name="NATPortNoEnd?2" size="5" maxlength="5" value="22" onkeypress="chk_num(event)" type="text"&gt;                  &lt;/td&gt;                  &lt;td&gt;                    &lt;input name="NATserverAddr?2" size="15" maxlength="15" value="192.168.1.2" onfocus="this.select()" onblur="checkIPFormat(this)" type="text"&gt;                  &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Oh and just in case you wonder, the only mode of authentication allowed from the outside is private key, so good luck trying to break in!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1970364787480177542?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1970364787480177542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2007/12/opening-ports-for-remote-access-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1970364787480177542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1970364787480177542'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2007/12/opening-ports-for-remote-access-on.html' title='Opening ports for remote access on ZyXEL DSL modem'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-3033689927201799591</id><published>2007-11-06T11:20:00.002Z</published><updated>2009-10-06T17:35:08.756+01:00</updated><title type='text'>Disable hibernation in Vista</title><content type='html'>This can come handy if you have 4 GB RAM and plan to image your partition, as the last thing you want to archive is hiberfil.sys. From a command prompt, simply type:&lt;br /&gt;&lt;pre class="brush: text"&gt;powercfg -H off&lt;/pre&gt;and watch your hiberfil.sys turn to oblivion...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-3033689927201799591?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/3033689927201799591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2007/11/disable-hibernation-in-vista.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3033689927201799591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/3033689927201799591'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2007/11/disable-hibernation-in-vista.html' title='Disable hibernation in Vista'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5473949239774970835</id><published>2007-05-13T02:03:00.003+01:00</published><updated>2009-10-06T17:34:07.152+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fancontrol'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='sensors.conf'/><category scheme='http://www.blogger.com/atom/ns#' term='Slackware'/><category scheme='http://www.blogger.com/atom/ns#' term='ASUS P5B Deluxe'/><title type='text'>MY ASUS P5B Deluxe Linux (Slackware 11.0) settings</title><content type='html'>Putting this here so that, if I ever have to reinstall Slackware in a hurry (as happened the other day), I can quickly revert to them, but first I gotta give you a handful of &lt;b&gt;disclaimers&lt;/b&gt;&lt;br /&gt;&lt;b&gt;1.&lt;/b&gt; Because of ASUS &amp;amp; intel's new lousy 4 pin CPU fan control and the fact that my (whatever model) Zallman cooler only provides a 3 pin connector, my PSU is plugged to the CPU fan control, my CPU Fan is plugged to FAN2 or FAN3, and my side case fan is plugged to FAN1 or something. In short, my setup is nonstandard, so if you use my sensors.conf on a regular setup, your Fan labels will be screwed up (but all the rest should be OK)&lt;br /&gt;&lt;b&gt;2.&lt;/b&gt; Likewise, my fancontrol file is only meant to work for my rig! If you use it and fry yours, instead of running pwmconfig as you should, tough luck!&lt;br /&gt;&lt;b&gt;3.&lt;/b&gt; Kernel 2.6.21 has disabled one of the P5B Deluxe network adapters (the 88E8056), because the driver is reported as broken.&lt;br /&gt;To re-enable it, look for "broken" in drivers/net/sky2.c&lt;br /&gt;&lt;br /&gt;Here goes nothing:&lt;br /&gt;o &lt;b&gt;/etc/sensors.conf&lt;/b&gt; for MY Asus P5B-Deluxe&lt;br /&gt;&lt;pre class="brush: text"&gt;# Winbond W83627DHG configuration&lt;br /&gt;# This is for an Asus P5B Deluxe Edition&lt;br /&gt;chip "w83627dhg-*"&lt;br /&gt;# Temperatures&lt;br /&gt;label temp1 "MB Temp"&lt;br /&gt;set temp1_over 50.0&lt;br /&gt;set temp1_hyst 45.0&lt;br /&gt;label temp2 "CPU Temp"&lt;br /&gt;set temp2_over 60.0&lt;br /&gt;set temp2_hyst 50.0&lt;br /&gt;compute temp2 @+10,@-10&lt;br /&gt;ignore temp3&lt;br /&gt;# Fans&lt;br /&gt;label fan1 "Side Fan"&lt;br /&gt;set fan1_min 1000&lt;br /&gt;label fan2 "PSU Fan"&lt;br /&gt;set fan2_min 1000&lt;br /&gt;label fan5 "CPU Fan"&lt;br /&gt;set fan5_min 1000&lt;br /&gt;ignore fan3&lt;br /&gt;ignore fan4&lt;br /&gt;# Voltages&lt;br /&gt;label in0 "Vcore"&lt;br /&gt;set in0_min 1.32&lt;br /&gt;set in0_max 1.60&lt;br /&gt;label in1 "+12V"&lt;br /&gt;compute in1 @*(66/10), @/(66/10)&lt;br /&gt;set in1_min 12.0 * 0.95&lt;br /&gt;set in1_max 12.0 * 1.05&lt;br /&gt;label in2 "+3.3V"&lt;br /&gt;set in2_min 3.3 * 0.95&lt;br /&gt;set in2_max 3.3 * 1.05&lt;br /&gt;label in5 "+5V"&lt;br /&gt;compute in5 @*(32/10), @/(32/10)&lt;br /&gt;set in5_min 5.0 * 0.95&lt;br /&gt;set in5_max 5.0 * 1.05&lt;br /&gt;ignore in3&lt;br /&gt;ignore in4&lt;br /&gt;ignore in6&lt;br /&gt;ignore in7&lt;br /&gt;ignore in8&lt;/pre&gt;&lt;br /&gt;o MY &lt;b&gt;/etc/fancontrol&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush: text"&gt;INTERVAL=5&lt;br /&gt;FCTEMPS=hwmon0/device/pwm4=hwmon0/device/temp2_input&lt;br /&gt;FCFANS= hwmon0/device/pwm4=hwmon0/device/fan5_input&lt;br /&gt;MINTEMP=hwmon0/device/pwm4=0&lt;br /&gt;MAXTEMP=hwmon0/device/pwm4=45&lt;br /&gt;MINSTART=hwmon0/device/pwm4=30&lt;br /&gt;MINSTOP=hwmon0/device/pwm4=100&lt;/pre&gt;&lt;br /&gt;o MY &lt;b&gt;/etc/rc.d/rc.fancontrol&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush: bash"&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# /etc/rc.d/rc.fancontrol&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;fancontrol_start() {&lt;br /&gt;/usr/local/sbin/fancontrol | logger &amp;amp;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;fancontrol_stop() {&lt;br /&gt;killall fancontrol&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;fancontrol_restart() {&lt;br /&gt;fancontrol_stop&lt;br /&gt;sleep 5&lt;br /&gt;fancontrol_start&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;case "$1" in&lt;br /&gt;'start')&lt;br /&gt;fancontrol_start&lt;br /&gt;;;&lt;br /&gt;'stop')&lt;br /&gt;fancontrol_stop&lt;br /&gt;;;&lt;br /&gt;'restart')&lt;br /&gt;fancontrol_restart&lt;br /&gt;;;&lt;br /&gt;*)&lt;br /&gt;echo "usage $0 start|stop|restart" ;;&lt;br /&gt;esac&lt;/pre&gt;&lt;br /&gt;o My &lt;b&gt;/etc/rc.d/rc.local&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush: bash"&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# /etc/rc.d/rc.local:  Local system initialization script.&lt;br /&gt;#&lt;br /&gt;# Put any local startup commands in here.  Also, if you have&lt;br /&gt;# anything that needs to be run at shutdown time you can&lt;br /&gt;# make an /etc/rc.d/rc.local_shutdown script and put those&lt;br /&gt;# commands in there.&lt;br /&gt;&lt;br /&gt;# Why can't Linus respect the BIOS settings dammit!&lt;br /&gt;/usr/bin/setleds +num&lt;br /&gt;# ICH8R Software RAID Volumes&lt;br /&gt;echo Mounting RAID Volumes&lt;br /&gt;dmraid -ay&lt;br /&gt;mount -v -t ntfs /dev/mapper/isw_fhbagdjeh_Twix1 /mnt/vista32&lt;br /&gt;mount -v -t ntfs /dev/mapper/isw_fhbagdjeh_Twix2 /mnt/vista64&lt;br /&gt;mount -v -t ntfs /dev/mapper/isw_fhbagdjeh_Twix3 /mnt/strider&lt;br /&gt;mount -v -t ntfs /dev/mapper/isw_fhbagdjeh_Secure1 /mnt/secure&lt;br /&gt;# This is to use the nv framebuffer for X rather than nVidia's&lt;br /&gt;# lousy driver (plus it will remove the bootup penguins)&lt;br /&gt;/usr/sbin/fbset -depth 32&lt;br /&gt;# Harware monitoring stuff&lt;br /&gt;/usr/local/bin/sensors -s&lt;br /&gt;echo Starting Fan Control&lt;br /&gt;if [ -x /etc/rc.d/rc.fancontrol ]; then&lt;br /&gt;. /etc/rc.d/rc.fancontrol start&lt;br /&gt;fi&lt;/pre&gt;&lt;br /&gt;o &lt;b&gt;/etc/rc.d/rc.local_shutdown&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush: bash"&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# /etc/rc.d/rc.local_shutdown:  Local system shutdown script.&lt;br /&gt;&lt;br /&gt;if [ -x /etc/rc.d/rc.fancontrol ]; then&lt;br /&gt;. /etc/rc.d/rc.fancontrol stop&lt;br /&gt;fi&lt;/pre&gt;&lt;br /&gt;o And while I'm at it, my &lt;b&gt;/etc/fstab&lt;/b&gt;...&lt;br /&gt;&lt;pre class="brush: text"&gt;/dev/sda4        /                xfs         defaults         1   1&lt;br /&gt;/dev/sda1        /mnt/osx         hfsplus     rw               1   0&lt;br /&gt;/dev/sda2        /mnt/winxp       ntfs        rw               1   0&lt;br /&gt;/dev/sda3        /mnt/alfie       ntfs        rw               1   0&lt;br /&gt;/dev/cdrom       /mnt/cdrom       auto        noauto,owner,ro  0   0&lt;br /&gt;/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0&lt;br /&gt;devpts           /dev/pts         devpts      gid=5,mode=620   0   0&lt;br /&gt;proc             /proc            proc        defaults         0   0&lt;/pre&gt;&lt;br /&gt;o ...as well as my &lt;b&gt;~/.profile&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush: bash"&gt;alias a=alias&lt;br /&gt;a dir='ls -alFh'&lt;br /&gt;a dim='ls -alFh | most'&lt;br /&gt;a so='source ~/.profile'&lt;br /&gt;a s='screen -D -R'&lt;/pre&gt;&lt;br /&gt;I think that's about it really&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5473949239774970835?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5473949239774970835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2007/05/my-asus-p5b-deluxe-linux-slackware-110.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5473949239774970835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5473949239774970835'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2007/05/my-asus-p5b-deluxe-linux-slackware-110.html' title='MY ASUS P5B Deluxe Linux (Slackware 11.0) settings'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1606695214955546529</id><published>2007-05-10T02:38:00.003+01:00</published><updated>2009-10-06T17:28:58.424+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ICH8R'/><category scheme='http://www.blogger.com/atom/ns#' term='grub'/><category scheme='http://www.blogger.com/atom/ns#' term='RAID'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='dmraid'/><category scheme='http://www.blogger.com/atom/ns#' term='LILO'/><category scheme='http://www.blogger.com/atom/ns#' term='ASUS P5B Deluxe'/><title type='text'>A farewell to LILO (One bootloader to rule them all, part 2)</title><content type='html'>As &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;mentioned&lt;/span&gt; previously, I set up a bunch of disks in a mixed RAID configuration on my new P5B Deluxe system, and merrily went on installing OS after OS.&lt;br /&gt;&lt;br /&gt;The point of this exercise was to have my main OS (probably Vista 32) as well as a near half-a-terabyte partition set in RAID 0 mode, for &lt;span style="font-weight: bold;"&gt;speed&lt;/span&gt;, while some other stuff, for which disk performance is not that critical (OS-X, XP, Linux, more space), would reside quietly on a 3rd non raid disk. And while I'm at it, I would also setup a RAID 1 partition, as the Intel ICH8R "controller" of the P5B is now nice enough to allow you to create both a RAID0 and RAID1 drive out of the same 2 disks RAID array.&lt;br /&gt;&lt;br /&gt;Which leaves us with the obvious problem of booting that lot, a capital problem indeed ( especially now that Vista is being such an ass about its boot loader). As an aside, I would like to point out that this is what happens when a company has a near monopoly with regards to installed OS base: They will obviously do their darnedest to prevent ANY other OS from eating even the smallest part of their market share. And I could comment on OS-X too. What is wrong with a standard partition scheme that you will recognize once you get your hand forced anyway (but not any sooner)? Why are you not happy with a big fat bootable primary partition with af type setup for you with Linux's fdisk?&lt;br /&gt;And &lt;span style="font-weight: bold;"&gt;much much worse&lt;/span&gt;, how comes the partitions OS-X creates end up on the &lt;span style="font-weight: bold;"&gt;exact same block&lt;/span&gt; as the start of the next partition (have a look at your fdisk results in Linux - What the hell?)? I might talk about that later on, because this headache resulted in recently losing both a fresh install of XP along with a data partition and, what's worse, my Linux system. As the old proverb go, "Install XP, lose your data"...&lt;br /&gt;&lt;br /&gt;So, considering that I have now done this operation &lt;span style="font-weight: bold;"&gt;twice&lt;/span&gt;, let me give you the long awaited heads up on the &lt;span style="font-style: italic;"&gt;one bootloader to rule them all...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;font-size:130%;" &gt;Accessing the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;ICH&lt;/span&gt; RAID disks under Linux&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;o Compile kernel with device mapper&lt;br /&gt;o Pick up the latest &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;devmapper&lt;/span&gt; package from &lt;a href="ftp://sources.redhat.com/pub/dm/"&gt;ftp://sources.redhat.com/pub/dm/&lt;/a&gt;&lt;br /&gt;o Pick and compile &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;dmraid&lt;/span&gt;&lt;br /&gt;o &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;dmraid&lt;/span&gt; -&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;ay&lt;/span&gt; (if &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;dmraid&lt;/span&gt; complains about missing kernel options, add them!)&lt;br /&gt;o &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;dmraid&lt;/span&gt; -s (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;Yay!&lt;/span&gt;) or ls /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;dev&lt;/span&gt;/mapper&lt;br /&gt;&lt;br /&gt;And while you're at it, you can add something similar to this at the end of your /etc/rc.d/rc.local file (Slackware)&lt;br /&gt;&lt;pre class="brush: text"&gt;echo mounting RAID Volumes&lt;br /&gt;dmraid -ay&lt;br /&gt;mount -v -t ntfs /dev/mapper/isw_fhbagdjeh_Twix1 /mnt/vista32&lt;br /&gt;mount -v -t ntfs /dev/mapper/isw_fhbagdjeh_Twix2 /mnt/vista64&lt;br /&gt;mount -v -t ntfs /dev/mapper/isw_fhbagdjeh_Twix3 /mnt/strider&lt;br /&gt;mount -v -t ntfs /dev/mapper/isw_fhbagdjeh_Secure1 /mnt/secure&lt;/pre&gt;&lt;br /&gt;Becomes simple enough... when you've done that twice.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;font-size:130%;" &gt;So long LILO, and thanks for all the flawless boots...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One word if you stubbornly try to get LILO to boot one of the RAID0 partition as I did: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;Agh&lt;/span&gt;!!!&lt;br /&gt;&lt;br /&gt;Fatal: Sorry, don't know how to handle device 0&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;xfd&lt;/span&gt;02 =&gt; compile with latest source, as it will compile with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;devmapper&lt;/span&gt; (device-mapper or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;LVM&lt;/span&gt;2) if library is present. Look for -&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;DDEVMAPPER&lt;/span&gt; when compiling.&lt;br /&gt;OK then, added &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;devmapper&lt;/span&gt; option, make all, make install and...&lt;br /&gt;"Fatal : device mapper : only linear boot device supported"&lt;br /&gt;&lt;br /&gt;Enought with this. I'm sure the LILO &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;devs&lt;/span&gt; will add it some day, but for now grub it is then.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;font-size:130%;" &gt;Pub grub?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;GNU's&lt;/span&gt; versions: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;WTF&lt;/span&gt;? Pick up 1.95 and... configure: error: &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;LZO&lt;/span&gt; library version 1.02 or later is required&lt;br /&gt;OK then, &lt;a href="http://www.oberhumer.com/opensource/lzo/download/"&gt;http://www.oberhumer.com/opensource/lzo/download/&lt;/a&gt; to eventually &lt;span style="font-weight: bold;"&gt;realize&lt;/span&gt;: You should NOT grub 1.95. It's really grub 2.0 and too spanking new to be of any use. Instead, pick up grub 0.97 and live happily ever after!&lt;br /&gt;&lt;br /&gt;Now, some of you might see &lt;a href="http://download.talinux.tal.org/pub/talinux/patches/grub/grub-0.97-dmraid.patch"&gt;some mention&lt;/a&gt; of a grub 0.97 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_56"&gt;dmraid&lt;/span&gt; patch, but because I'm actually using the 3rd non RAID disk (actually 1st one on my system) to install the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_57"&gt;bootloader&lt;/span&gt;, as well as ultimately boot, patching grub is &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_58"&gt;unnecessary&lt;/span&gt;. I guess it would be necessary if we were to use our RAID0 as the boot disk. I'll have to try RAID5 one day, just for kicks :D&lt;br /&gt;&lt;br /&gt;So, without further adieu to LILO, and with &lt;a href="http://tienstra4.flatnet.tudelft.nl/%7Egerte/gen2dmraid/"&gt;thanks to the Gentoo users&lt;/a&gt;:&lt;br /&gt;&lt;pre class="brush: text"&gt;grub --device-map=/dev/null&lt;br /&gt;# My actual non-RAID boot disk&lt;br /&gt;grub&amp;gt; device (hd0) /dev/sda&lt;br /&gt;# The RAID0 array where the Vista's reside&lt;br /&gt;grub&amp;gt; device (hd1) /dev/mapper/isw_fhbagdjeh_Twix&lt;br /&gt;# Let's first add Linux, so that we can then edit the menu.lst&lt;br /&gt;# My Linux is on /dev/sda4, hence hd0,3 with zero based indexes&lt;br /&gt;grub&amp;gt; root (hd0,3)&lt;br /&gt;Filesystem type is xfs, partition type 0x83&lt;br /&gt;grub&amp;gt; setup (hd0,3)&lt;br /&gt;Checking if "/boot/grub/stage1" exists... yes&lt;br /&gt;Checking if "/boot/grub/stage2" exists... yes&lt;br /&gt;Checking if "/boot/grub/xfs_stage1_5" exists... yes&lt;br /&gt;Running "embed /boot/grub/xfs_stage1_5 (hd0,3)"... failed (this is not fatal)&lt;br /&gt;Running "embed /boot/grub/xfs_stage1_5 (hd0,3)"... failed (this is not fatal)&lt;br /&gt;Running "install /boot/grub/stage1 (hd0,3) /boot/grub/stage2 p /boot/grub/menu&lt;br /&gt;.lst "... succeeded&lt;br /&gt;Done.&lt;br /&gt;grub&amp;gt; quit&lt;/pre&gt;At this stage, you wanna check your /boot/grub/device.map file. If you don't see the /dev/mapper entry for (hd1) as expected, you will have to add it manually.&lt;br /&gt;&lt;br /&gt;From then on, you can go on creating your /boot/grub/menu.lst, which might eventually look something like this:&lt;br /&gt;&lt;pre class="brush: text"&gt;default 2&lt;br /&gt;timeout 3&lt;br /&gt;&lt;br /&gt;title  Slackware Linux 11.0&lt;br /&gt;kernel (hd0,3)/boot/vmlinuz root=/dev/sda4&lt;br /&gt;&lt;br /&gt;title  Slackware Linux 11.0 (Rescue)&lt;br /&gt;kernel (hd0,3)/boot/vmlinuz.rescue root=/dev/sda4&lt;br /&gt;&lt;br /&gt;title  Vista (32 bit)&lt;br /&gt;rootnoverify (hd1,0)&lt;br /&gt;chainloader +1&lt;br /&gt;&lt;br /&gt;title  Vista (64 bit)&lt;br /&gt;rootnoverify (hd1,1)&lt;br /&gt;chainloader +1&lt;br /&gt;&lt;br /&gt;title  Windows XP&lt;br /&gt;rootnoverify (hd0,1)&lt;br /&gt;chainloader +1&lt;br /&gt;&lt;br /&gt;title  MacOS 10.4.8&lt;br /&gt;rootnoverify (hd0,0)&lt;br /&gt;chainloader +1&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;font-size:130%;" &gt;Parting words&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And thus, I will be leaving with a "so long old Friend..." Since 1995, there haven't been much of a PC installed by yours truly which didn't display the unmistakable red greetings, and I had become such an expert at writing a /etc/lilo.conf, I could have done it blindfolded.&lt;br /&gt;Still, I gotta give it to the GNU guys... Their solution to the booting problem is deceivingly elegant. I'm especially impressed with the "modify menu.lst on the fly" aspect of things and the fact that dmraid "just" works...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1606695214955546529?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1606695214955546529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2007/03/farewell-to-lilo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1606695214955546529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1606695214955546529'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2007/03/farewell-to-lilo.html' title='A farewell to LILO (One bootloader to rule them all, part 2)'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5798419422562496105</id><published>2007-03-30T00:49:00.001+01:00</published><updated>2010-09-01T11:15:04.428+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='512MB'/><category scheme='http://www.blogger.com/atom/ns#' term='OS-X'/><category scheme='http://www.blogger.com/atom/ns#' term='nVIDIA'/><category scheme='http://www.blogger.com/atom/ns#' term='MacOS'/><category scheme='http://www.blogger.com/atom/ns#' term='ASUS P5B Deluxe'/><title type='text'>Yay! MacOS in 1680x1050 at last!</title><content type='html'>As I mentioned earlier, I am using an MSI 7950 GT with 512 MB on my new rig, and 512 MB have been well known to be incompatible with Titan/Natit and others.&lt;br /&gt;That is, until &lt;span style="font-weight: bold;"&gt;gotoh&lt;/span&gt; figured out that the issue was in the nVidia BIOS itself.&lt;br /&gt;A simple mod/reflash is all that's needed now to get a 512 MB GeForce card to be detected successfully in JasOS. Well, actually, that's was the easy part. The rest, if you're not that familiar with OS-X might be a bit confusing (and threads of more than 25 pages sure do not help!).&lt;br /&gt;Here's how I did proceed to get Natit installed and my card recognised (on an existing installation of Jas OS 10.4.8):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Flashed my Graphics Card following &lt;a href="http://www.macvidia.com/index.php?option=com_smf&amp;Itemid=67&amp;amp;topic=1082.0"&gt;these steps&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Downloaded the Natit_Dual_v0.2 package from &lt;a href="http://wiki.osx86project.org/wiki/index.php/Natit"&gt;this page&lt;/a&gt; (which got automatically extracted by Stuffit on the Desktop)&lt;/li&gt;&lt;li&gt;Copied over the content to /System/Library/Extensions with the command:&lt;br /&gt;sudo cp -R Desktop/Natit.kext /System/Library/Extensions&lt;/li&gt;&lt;li&gt;Fired up "System Profiler" in "Utilities" (which you can access with Finder) and found that the Device ID for my Graphics Card was 0x0295&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Edited Natit.kext/Contents/Info.plist and change the IOPCIMatch section string to 0x029510de...&lt;/li&gt;&lt;li&gt;in /System/Library/Extensions:&lt;br /&gt;sudo chown -R root:wheel Natit*&lt;/li&gt;&lt;li&gt;in /System/Library&lt;br /&gt;sudo rm -rf Extensions.mkext Extensions.kextcache&lt;/li&gt;&lt;li&gt;Rebooted and that was it!&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5798419422562496105?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5798419422562496105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2007/03/yay-macos-in-1680x1050-at-last.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5798419422562496105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5798419422562496105'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2007/03/yay-macos-in-1680x1050-at-last.html' title='Yay! MacOS in 1680x1050 at last!'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-181367567045032181</id><published>2007-03-28T23:09:00.001+01:00</published><updated>2009-10-06T17:25:03.719+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VISTA'/><category scheme='http://www.blogger.com/atom/ns#' term='ULTRAEDIT'/><title type='text'>UltraEdit 32 Explorer Integration in Vista</title><content type='html'>Looks like Vista broke the integration of UltraEdit in the shell (even with latest version 13.00), without whom life is not worth living. Seriously, not being able to Edit/HexEdit ANY file with a right click really makes life unbearable.&lt;br /&gt;&lt;br /&gt;Thankfully, &lt;a href="http://www.ultraedit.com/index.php?name=Forums&amp;amp;file=viewtopic&amp;amp;t=3435"&gt;other people&lt;/a&gt; have figured out how to do it, and it's really simple:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: text"&gt;Windows Registry Editor Version 5.00&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\*\shell\UltraEdit 32]&lt;br /&gt;@="UltraEdit"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\*\shell\UltraEdit 32\command&lt;br /&gt;@="\"C:\\Program Files\\IDM Computer Solutions\\UltraEdit-32\\uedit32.exe\" \"%1\""&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;(NB:If you create these keys manually, @ is the "(Default)" key in Regedit, and both keys are String values. Of course, quotes don't need to be escaped then)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-181367567045032181?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/181367567045032181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2007/03/ultraedit-32-explorer-integration-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/181367567045032181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/181367567045032181'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2007/03/ultraedit-32-explorer-integration-in.html' title='UltraEdit 32 Explorer Integration in Vista'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-5730495469620011365</id><published>2007-03-22T12:02:00.000Z</published><updated>2007-03-23T01:01:10.566Z</updated><title type='text'>The horror! The horror! (Hiding Vista partitions from one another)</title><content type='html'>I'll cut to the chase. As you know, Vista's new bootloader is complate PITA, because it aims at taking control of all bootloading activities without asking (how rude!), and in typical Microsoft arrogance style, it thinks it can do a better job than you (how inconsiderate!).&lt;br /&gt;&lt;br /&gt;Therefore, if you have any combination of XP, Vista, etc... that can be detected, you're pretty much screwed because Vista will insist on unifying the booting of all Windowses for you, which you might think is nice... until the day you remove the OS on which the bootloader is installed, and you realize that you can NO LONGER BOOT THE OTHERS. Don't believe me? Try that little experiment:&lt;br /&gt;Install Vista. Then install another Vista on a different partition. The boot &lt;span style="font-weight: bold;"&gt;block&lt;/span&gt; for the second Vista will be written on the &lt;span style="font-weight: bold;"&gt;first&lt;/span&gt; partition. Now format the first Vista and do your darnedest to boot the second Vista. No way Jose: There's no boot block on that second partition and it will never boot. Well, if you don't mind me saying, that's a really gay way of operating a system.&lt;br /&gt;&lt;br /&gt;So there's no way I'm gonna let that happen when I want to have a SINGLE bootloader under my COMPLETE CONTROL!&lt;br /&gt;&lt;br /&gt;And it is a little know secret that, despite insisting on being ZE bootloader, Vista will happily receive the boot from another botoloader, as long as it has been installed on a machine where it thinks it is the only Windows OS, which is why it's a good advice to install Vista first, or unplug disks where you might have other Windowses installed. Unfortunately, that method of hiding Vista from Vista (I deem it likely that Vista is horrified from looking at itself in the mirror, hence the title) will not work in our case, where we want to have both Vista32 and Vista64 installed on the same disk. Oh, and you can try to change the partition type of the first Vista you installed, that won't work either. Windows is apparently able to detect itself regardless of the partition type We'll need much more powerful &lt;span style="font-style: italic;"&gt;Maßnahmen gegen die Gewalt&lt;/span&gt; this time round.&lt;br /&gt;&lt;br /&gt;Our solution then: Change the partition type AND fill the Windows partition bootblock with zeros. This is where we open our Swiss Army Knife of anything advanced: Linux.&lt;br /&gt;Whatever you do, you should always install Linux before doing anything else (and be able to boot into it from a CD, floppy, whatever, even if the MBR is erased). Please chant with me now my brothers and sisters: &lt;span style="font-style: italic;"&gt;"There is no salvation in the computing world but in Linux"&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In my case, Linux is installed on HDD1 and the Vistas go to partition 1 &amp; 2 of the RAID0 ICH8R array (HDD 2&amp;amp;3). You will need to have dmraid setup in Linux to access the ICH8R RAID partitions, but I'll post on that later. So the course of operations is:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Unplug HDD1 and install Vista32 on the first partition of the RAID0 unit. I even let Vista do my partitioning on this drive. Probably not the best idea (cfdisk seems to have problems with how Vista partitioned the drive, but fdisk is fine and see nice primary partitions there). I tend to use the Vista partitioner when I don't really care because in Vista, Megabytes are Megabytes, and not these lousy 1000^2 Megabites cfdisk and others insist on using. Thus, when I enter 45056 MB for the size, I do get a 44 GB partition &lt;span style="font-weight: bold;"&gt;exactly&lt;br /&gt;&lt;/span&gt;While I'm at it, one piece of free advice. Don't reset your machine on Vista's first boot because you want to reinstall your bootloader or something. If Vista's first boot is interrupted, it will not be able to resume, so make sure that you can actually logon to Vista before you switch to doing something else.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Re-plug HDD1 and boot Linux. Fire up dmraid (dmraid -ay) to gain access to your RAID partitions.&lt;/li&gt;&lt;li&gt;Create a BACKUP of the Vista bootblock on RAID partition 1:&lt;br /&gt;dd if=/dev/mapper/isw_fhbagdjeh_Twix1 of=/backup/vista32 count=16&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note 1:&lt;/span&gt; The reason I use 16 blocks (16 x 512 bytes) is because the BOOTSECT.BAK backup copy of the original drive bootblock done by Vista on installation is 8 KB big. If it's good enough for Vista, it's good enough for me&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note 2:&lt;/span&gt; The reason my RAID0 array is called Twix has everything to do with the French rebranding of the famous caramel bar from "Raider" to "Twix" a few years ago&lt;br /&gt;Needless to say, if you ever lose that backup copy of your bootblock, you're screwed&lt;/li&gt;&lt;li&gt;Now we'll ERASE the backed up bootblock with:&lt;br /&gt;dd if=/dev/zero of=/dev/mapper/isw_fhbagdjeh_Twix1 count=16&lt;br /&gt;This makes sure that sneaky Windows will not be able to recognize this partition as one of its siblings&lt;br /&gt;&lt;/li&gt;&lt;li&gt;fire up fdisk (fdisk /dev/mapper/isw_fhbagdjeh_Twix) and un&lt;span style="font-weight: bold;"&gt;a&lt;/span&gt;ctivate the first partition, change its type to 'af' (how ironic, this is a MacOS partition type!) and &lt;span style="font-weight: bold;"&gt;a&lt;/span&gt;ctivate the second partition (if the partition on which you plan to install Vista is not set as active/bootable, Vista will refuse to install!)&lt;/li&gt;&lt;li&gt;Unplug HDD1 and install Vista64. Vista will see the first partition alright, but not recognize it, so it will install a second bootloader on the second partition, which is what you want&lt;/li&gt;&lt;li&gt;Re-plug HDD1, boot Linux, issue the dmraid command, and restore the Vista32 boot record:&lt;br /&gt;dd if=/backup/vista32 of=/dev/mapper/isw_fhbagdjeh_Twix1  count=16&lt;br /&gt;Fire up fdisk again, and restore the first partition type to '7' (NTFS) and &lt;span style="font-weight: bold;"&gt;a&lt;/span&gt;ctivate it (so that the 2 first partitions are marqued as bootable/active&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Use the bootloader of your choice to boot these 2 Vistas independently from one another and be freed from Microsoft's Vista bootloader tie in. One more step into our "One bootloader to rule them all" brainwa^H^H^H^H^H^H^H program...&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-5730495469620011365?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/5730495469620011365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2007/03/horror-horror-hiding-vista-partitions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5730495469620011365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/5730495469620011365'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2007/03/horror-horror-hiding-vista-partitions.html' title='The horror! The horror! (Hiding Vista partitions from one another)'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-7810454750482815847</id><published>2007-03-21T11:55:00.000Z</published><updated>2007-03-22T12:02:11.567Z</updated><title type='text'>One bootloader to rule them all, part 1</title><content type='html'>So, I bought myself an ASUS P5B Deluxe the other day, with all the good stuff that goes with it (Core 2 Duo E6400, 2 GB CAS 4 RAM, MSI GeForce 7950GX2 512 MB with passive cooling, etc.) and I also added 2 more of these relatively cheap Seagate 7200.10 ST3320620AS SATA II 298.1 GB drives (Hell will freeze over before I recognize that 1 GB is anything else but 1024^3 bytes!) to my existing one which brought my total to 3 of these units.&lt;br /&gt;&lt;br /&gt;By the way, my tip to all Seagate 7200.10 drives owners: &lt;span style="font-weight: bold;"&gt;REMOVE THE HDD JUMPER IF YOU HAVE A SATA II MOTHERBOARD!&lt;/span&gt; With the jumper on, transfers are limited to SATA 1 speeds, which will effectively max the drive out to 1.5 Gbps. Without the jumper, you can reach the theoretical SATA II speed of 3.0 Gbps, so that's probably a wise thing to do... even if I doubt any hardware out there, and especially these disks, are able to max out SATA 1 speeds.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;The Goal&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Have OS-X (Jas OS 10.4.8 or later) plus Windows XP SP2 plus Vista 32 bit plus Vista 64 bit plus Linux (Slackware 11.0) as well as a hefty &lt;span style="font-weight: bold;"&gt;faaaaast&lt;/span&gt; partition installed in a mixed RAID (ICH8R Software RAID) configuration.&lt;br /&gt;&lt;br /&gt;A lot of people will tell you that using the RAID0 ICHXR solution is stupid, that you will gain almost no performance, that it's too risky, and so on and so forth. Don't believe a word of it. I've been running a RAID0 array for my main OS and hefty 400 GB partition for the last 2 years, and I have been satisfied enough by this experience that I want to carry it over on my new machine. Preliminary tests show that I can effectively do a non RAID to RAID0 disk to disk copy at close to 70 MB/s (effective mean speed) on my new machine, while the earlier tests I remember with a non RAID0 destination were closer to 35 MB/s, so anybody who tells you that RAID0 doesn't bring anything is a fool.&lt;br /&gt;&lt;br /&gt;How is this going to work in practice? Well, first of all, OSX will probably not be too happy on a RAID drive (won't know how to boot) and Linux is not that happy either. Sure, you can make it boot with dmraid and all, but as soon as your MBR is erased (and it WILL be erased), you won't have dmraid support on your boot CD so it's going to be a pain to reinstall. Yeah, I know you can use a bootdisk, and I even created my own custom Slackware boot/install CDs with custom kernel (that's how bender.rpc1.org was installed by the way), but I have become &lt;span style="font-weight: bold;"&gt;much&lt;/span&gt; lazier over the years, and I want to use the default Slackware boot CDs because it's convenient.&lt;br /&gt;&lt;br /&gt;Therefeore, we're gonna keep on disk in AHCI (or so was the plan) to have OS-X, Linux, XP and other stuff for which we dont' care too much about perf, while we install the Vista's on the 2 other disks in RAID0 array.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;"Good news, everyone!"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, here comes the pleasant surprise: Contrary to what was the case in the past, and which was one of the major reasons of my being pissed at these lousy software RAID implementations that could come close to Linux's md, it is NOW possible (at least with ICH8R on an ASUS P5B Deluxe) to create a mixed RAID configurations on the same disk array.&lt;br /&gt;For instance, you can create BOTH a RAID0 unit for speed as well as a RAID1 unit for security with only 2 Disks. This really solves one of the major gripes I had with ICHR, because I want speed for most of my data (which is expandable), but I also want security for the limited set of my data which is not. In the past ICHR iterations, apart from buying 4 disks, you really didn't have a choice. With the latest one, you can have the cake and eat it too.&lt;br /&gt;&lt;br /&gt;Now there is a limit to all good things (expect on Linux), and you can only create two raid units on the same array. But as long as I can have a big RAID0 drive and a small RAID1 drive on the same disks, I'm fine with that, so not a problem.&lt;br /&gt;&lt;br /&gt;Here's how my current partitioning is done then:&lt;br /&gt;o Disk 0 (non RAID, P5B SATA controller 0): 4 primaries, with OS-X as part 1 (40 GB), WinXP as part 2 (40 GB) and Linux as the last partition (~8 GB). The 3rd partition is used for data&lt;br /&gt;o Disk 1 &amp; 2 (on P5B SATA controllers 1 &amp;amp; 4): One 588 GB RAID0 unit/disk and one 4.1 GB RAID1 unit/disk. The RAID0 unit is partitioned as follows: 44 GB primary for Vista 32, 44 GB primary for Vista 64 and 500 GB for "Strider", my hefty faaaaast data drive (I would of course have preferred 512 GB for the latter, for binary beauty, but I don't think I want to go under 40 GB for a Vista installation.)&lt;br /&gt;&lt;br /&gt;Booting all of these OSes will be the tricky part though, which I will detail in the upcoming "Farewell to LILO" post as well as probably part 2 of this post.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;"Bad news, nobody..."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And now for the unpleasant surprise (can't have it all). I already had Linux, OS-X and XP installed on the first non RAID HDD (in AHCI mode), and even though I am now in RAID mode instead of AHCI in the P5B Deluxe BIOS, the HDD is in non RAID mode and should still be seen as AHCI (there are 3 modes on the P5B: IDE, RAID or AHCI). Except that intel, in their great wisdom, seem to have decided that, when in RAID mode, non RAID disks should be set as IDE  or something, instead of AHCI, which means that WinXP won't boot (nothing that a good driver/reinstall won't fix) but more worrying, that OS-X is now unable to see its own drive as well...&lt;br /&gt;&lt;br /&gt;Well, this is bad news because there is no patch for JaS OS 10.4.8 to be compatible with whatever mode ICH8R defines the drives as (and using JMicron as primary SATA controller is not really an option, regardless of whether it is compatible with JaS or not).&lt;br /&gt;&lt;br /&gt;So I currently have to switch back from RAID to AHCI in the BIOS to be able to boot OS-X. Darn! The goal is to have "one bootloader to rule them all", not "one bootloader plus manual BIOS conf to rule them all"...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Sidenote&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;For those who might wonder why I didn't go for what would be considered as the more "sensible" approach of installing Vista(s) on a RAID1 partition, the answer, apart from the obvious hit in performance, is very simple: I tried just that, and then, after installing some updates, Windows refused to shut down for some reason, so I had to it reset. Once I rebooted, the RAID bios detected that my RAID1 array was out of sync and that it needed to be rebuilt. But when I did that in Windows, using the Intel Matrix Storage tools, I realized that this would take forever (about 1% per 30 secs or so on a 44 GB drive). Considering how stable Vista is on shutdown/reboot operations (I'm not even talking of sleep, which, as everybody knows, is simply dreadful and does not work), and how often I am likely to hit the reset button to show that OS who is the master, I'm not going to waste my life in degraded performance mode, having to wait for my array to be rebuilt.  This is only the reason why I went for a small RAID1 partition by all standards. I can afford a couple minutes to rebuild a 4 GB drive, but 1 hour for a 40+ one, no way!&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-7810454750482815847?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/7810454750482815847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2007/03/one-bootloader-to-rule-them-all-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7810454750482815847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/7810454750482815847'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2007/03/one-bootloader-to-rule-them-all-part-1.html' title='One bootloader to rule them all, part 1'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-261768414694528663.post-1983303873352124901</id><published>2007-03-03T02:52:00.001Z</published><updated>2009-07-16T18:06:03.533+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='All'/><title type='text'>You might remember me...</title><content type='html'>Hi, I'm hacker &gt;NIL: ("redirect 'slash' nil").&lt;br /&gt;&lt;br /&gt;You might remember me for such hacks as "Pioneer DVR-108 v1.18 RPC-1 + 12xRip + nx4all" or "The Matshita UJDA autopatcher", and events such as "Why the hell is rpc1.org down again?!?"...&lt;br /&gt;&lt;br /&gt;On this not-so-regularly updated blog, I purport to present you with the unglamorous vicissitudes of managing to make computers, and all things computer related, achieve what you want. &lt;br /&gt;&lt;br /&gt;And so, without further ado &lt;a href="http://nil-techno.blogspot.com/"&gt;...&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/261768414694528663-1983303873352124901?l=nil-techno.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nil-techno.blogspot.com/feeds/1983303873352124901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nil-techno.blogspot.com/2007/03/on-filesystems-and-deletion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1983303873352124901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/261768414694528663/posts/default/1983303873352124901'/><link rel='alternate' type='text/html' href='http://nil-techno.blogspot.com/2007/03/on-filesystems-and-deletion.html' title='You might remember me...'/><author><name>NIL</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
