Thread: iLiad SWAP on iLiad
View Single Post
Old 11-09-2007, 08:22 AM   #1
tirsales
MIA ... but returning som
tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.
 
tirsales's Avatar
 
Posts: 1,600
Karma: 511342
Join Date: Nov 2007
Location: Germany
Device: PRS-505 and *Really* not owning a PRS-700
SWAP on iLiad

Hi there,

as a warning note in advance: Currently I don't own an iLiad, nor do I have access to one ATM. Thus this is a purely theoretical approach and I don't have the means needed to implement this myself (okay, I could implement this, but I couldn't test it).

My questions:

1. I have read multiple times, that enabling swap would be a nice thing. Though I know why swap sometimes is a nice thing on a normal system, I don't see the main advantage for the iLiad: CF is relatively slow, thus I can't see a big improvement through this (okay, perhaps when running multiple applications).
Same applies to SD. I don't know if the DOC is faster, problems see at the bottom, alternative 1.

With a (not too-low quality) modern CF/SD card the number of read/write cycles shouldn't be too much of a problem (a number of embedded device manufacturers actually deliever devices using CF, allowing for swap and giving a 3-year-warranty). This specifically excludes any "standard CF"-cards (like SanDisk Standard vs SanDisk Extreme, Ultra, etc) as they typically allow for only a limited number of write cycles. And even if killed after a year, cards are cheap.

2. What is the big problem?
AFAIK one can install a new kernel to the iLiad via the CF-Bootloader. Correct?
The swap-utilities themselves should be available for XScale-cpus and an ARM-architecture already. Granted, I haven't had a bigger look into this, but I know for sure that the ARM-port of debian allows for swap ...

Thus one should be (easily) able to port a swap-enabled kernel & -utility to the iLiad. For enabling swap:
Write a short shellscript that tests for a CF-card and wether partition 2 on this card (yes, CF can be partitioned) and, if present and a swap-partition, enables swapping to that partition.
Write a second shellscript that disables swapping (in case you want to extract the card).
It wouldn't even be needed to put the swap-modules into initrd, loading them sometime (when needed) is sufficient. It wouldn't even need to be a startscript but could be run when needed (thus reducing the power drain when swap is not needed).

Big drawback: Power drain. CF sucks power, swapping would be (in the worst case) a continuous writing/reading to that card and thus would kill your battery time for good.

Alternative 1: Repartition the iLiad-intern flash device, enabling an intern swap.
I wouldn't recommand this though:
CF/SD Cards are cheap, thus it is not a big problem if they scrumble after 1-3 years. ATM I don't know which DOC is used, thus I cannot say the number of write-cycles it supports (and I am too lazy to search). But ntl: Killing your DOC-chip (thus needing a new iLiad) is far more expensive than killing your CF/SD card (thus needing a new card). Not worth the (possible) gain IMO.

Alternative 2: Use a SD-card instead of CF (if they use less power). I don't even know wether SD-cards can be partitioned, but it should be possible to either use the complete card or use a swap-file.

Alternative 3: Use a swap-file on the DOC. Problems: see alternative1. Advantage: no need to repartition the DOC.


This thread is to be ignored or regarded at your own judgement

regards

Tirsales

Last edited by tirsales; 11-09-2007 at 11:21 AM.
tirsales is offline   Reply With Quote