![]() |
#1 |
MIA ... but returning som
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 |
reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,977
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
|
I have seen FBReader freeze on large files (e.g. 7 MB CHM) and large dictionaries are apparently a problem for MobiPocket Reader (24 MB: unable to open mobipocket dictionary). I assume this is due to a lack of memory, but I don't know this for sure.
On the Nokia 770, you can add 64 MB of swap space on a MMC card. See, for example, Setting Up Swap on MMC. There were initial questions about write cycles, but I am not aware of anyone actually wearing out a MMC card by using it as swap space. I would be concerned about adding swap on a CF card, because these don't always mount at boot time. In any case, the addition of card-based swap would need to allow for the possibility that the card was missing at boot time. |
![]() |
![]() |
![]() |
#3 | ||
MIA ... but returning som
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,600
Karma: 511342
Join Date: Nov 2007
Location: Germany
Device: PRS-505 and *Really* not owning a PRS-700
|
Quote:
Quote:
For MMC this could be changed to : * Test if MMC-Card present * Mount MMC-Card (alternativ: test if already mounted) * Test if SWAP-File present (fairly easy) * activate SWAP. run at boot-time or after inserting the card - Linux is fairly easy on adding or removing swap. --edit: Creating the swap-file: 'dd if=/dev/zero of=[path to mmc-card]/swpfile bs=1M count=[größe des swapfiles in MB]' 'mkswap [path to mmc-card]/swpfile' Example: dd if=/dev/zero of=/media/mmc/swpfile bs=1M count=256 mkswap /media/mmc/swpfile (erzeugt ein 256MB Swapfile) Shellskript (assuming that MMC-cards are mounted at boot-time and that the command 'swapon' is available.) #! /bin/bash mmcFolder = [Pfad zu MMC auf iLiad] swapActivated = 0 if ( -e $mmcFolder/swpfile ) ; then swapon $mmcFolder/swpfile && swapActivated = 1 fi if ( $swapActivated -gt 0 ) ; then echo "Jipii! We have swap!" free else echo "Baah, no swapping for you!" fi --- The last 'if' could be used for a more sofisticated error-handling, but it should do as an example. If someone would be willing to test it, I could try to compile the swap-utils and the appropriate kernel - with absolutely NO WARRANTY that it won't brick your system as it would be completely untested. On the other hand it should be fairly easy to implement yourself. -- edit 2: https://www.mobileread.com/forums/sho...ghlight=swapon mentions, that Adam B. has ported a busybox-variant with swapon / swapoff. Thus only the kernel is missing. Or am I just being stupid and writing stuff everybody knows? -- edit 3: Seems I really am stupid - and much to used to kernel 2.6 .. IIRC the option to "disallow" swapping has been added to the kernel-config in kernelfamily 2.6, 2.4 doesn't have this option ... So: Swapping should already be possible. If not it is more difficult. Anybody willing to try if swap is working? Or perhaps has already done so? Last edited by tirsales; 11-09-2007 at 11:40 AM. Reason: Adding stuff, spelling |
||
![]() |
![]() |
![]() |
#4 |
Addicted to Porting
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,697
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
|
I've updated the busybox post to include an ipkg installer for busybox.
Then I did the following. Code:
root@ereader:/media/cf# ipkg install busybox_1.7.2_ereader.ipk Upgrading busybox on root from 1.01-r2 to 1.7.2... Configuring busybox Code:
/bin/busybox --install -s Code:
busybox --help BusyBox v1.7.2 (2007-10-30 12:45:14 EDT) multi-call binary Copyright (C) 1998-2006 Erik Andersen, Rob Landley, and others. Licensed under GPLv2. See source distribution for full notice. Usage: busybox [function] [arguments]... or: [function] [arguments]... BusyBox is a multi-call binary that combines many common Unix utilities into a single executable. Most people will create a link to busybox for each function they wish to use and BusyBox will act like whatever it was invoked as! Currently defined functions: [, [[, addgroup, adduser, adjtimex, ar, arp, arping, ash, awk, basename, bunzip2, bzcat, cal, cat, catv, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, cp, crond, crontab, cryptpw, cut, date, dc, dd, deallocvt, delgroup, deluser, df, dhcprelay, diff, dirname, dmesg, dnsd, dos2unix, dpkg, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake, expand, expr, fakeidentd, false, fbset, fdflush, fdformat, fdisk, fgrep, find, fold, free, freeramdisk, fsck, fsck.minix, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname, httpd, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod, install, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kill, killall, killall5, klogd, last, length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, ls, lsattr, lsmod, lzmacat, makedevs, md5sum, mdev, mesg, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, mountpoint, mt, mv, nameif, nc, netstat, nice, nmeter, nohup, nslookup, od, openvt, passwd, patch, pidof, ping, ping6, pipe_progress, pivot_root, poweroff, printenv, printf, ps, pscan, pwd, raidautorun, rdate, readlink, readprofile, realpath, reboot, renice, reset, resize, rm, rmdir, rmmod, route, run-parts, runlevel, runsv, runsvdir, rx, sed, seq, setarch, setconsole, setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, slattach, sleep, softlimit, sort, split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd, swapoff, swapon, switch_root, sync, sysctl, syslogd, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, time, top, touch, tr, traceroute, true, tty, ttysize, udhcpc, udhcpd, udpsvd, umount, uname, uncompress, unexpand, uniq, unix2dos, unlzma, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, watch, watchdog, wc, wget, which, who, whoami, xargs, yes, zcat, zcip Code:
dd if=/dev/zero of=/media/cf/swpfile bs=1M count=64 Code:
root@ereader:/media/cf# ls -lah swpfile -rwxr-xr-x 1 root root 64.0M Nov 9 12:53 swpfile Code:
root@ereader:/media/cf# mkswap /media/cf/swpfile Setting up swapspace version 1, size = 67104769 bytes Code:
root@ereader:/media/cf# swapon /media/cf/swpfile Code:
root@ereader:/proc# cat meminfo total: used: free: shared: buffers: cached: Mem: 64901120 63266816 1634304 0 1155072 37359616 Swap: 67100672 0 67100672 MemTotal: 63380 kB MemFree: 1596 kB MemShared: 0 kB Buffers: 1128 kB Cached: 36484 kB SwapCached: 0 kB Active: 10052 kB Inactive: 39232 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 63380 kB LowFree: 1596 kB SwapTotal: 65528 kB SwapFree: 65528 kB |
![]() |
![]() |
![]() |
#5 |
MIA ... but returning som
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,600
Karma: 511342
Join Date: Nov 2007
Location: Germany
Device: PRS-505 and *Really* not owning a PRS-700
|
Well, this means theorie 2: Writing stuff everybody knows already
![]() Should have read that busybox-list more thoroughfully ... ![]() |
![]() |
![]() |
![]() |
#6 |
Addicted to Porting
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,697
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
|
Nah, not stuff everybody knows. There probably aren't more than a few people who know you can add swap to the iLiad. Now, they have scripts, instructions, and binaries.
![]() I think this can be a useful thread for researchers. ![]() |
![]() |
![]() |
![]() |
#7 |
Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 345
Karma: 3473
Join Date: Apr 2007
Location: Brooklyn, NY, USA
Device: iRex iLiad v1, Blackberry Tour, Kindle DX, iPad.
|
Sweet, Adam, thanks a lot!
|
![]() |
![]() |
![]() |
#8 |
MIA ... but returning som
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,600
Karma: 511342
Join Date: Nov 2007
Location: Germany
Device: PRS-505 and *Really* not owning a PRS-700
|
Added a wiki-entry https://wiki.mobileread.com/wiki/Swap_on_iLiad .
1st rewrite done. Last edited by tirsales; 11-09-2007 at 07:26 PM. |
![]() |
![]() |
![]() |
#9 |
Trainee bricked one Iliad
![]() Posts: 18
Karma: 25
Join Date: Oct 2007
Location: Germany, near Mönchengladbach
Device: iRex iliad ER0100 soft 2.12
|
Jep, i can confirm swapfile works nice (with new busybox)
|
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
Under what condition will swap memory does affect, improve or facilitate iLiad's function? Please share your experience.
|
![]() |
![]() |
![]() |
#11 |
Member
![]() ![]() ![]() Posts: 17
Karma: 280
Join Date: Dec 2007
Device: iLiad
|
Swap on CF and wireless
Am pretty sure if you put swap onto your CF card you'll cause your wireless conncetion to drop every time the swapping accesses the CF card, due to a bug IRex say they're looking into (not related to swap in particular, but to any sort of access of the CF card while the wireless connection is up).
I haven't actually tested this but I have tested manual access of the CF card with the wireless up and it does cause it to drop the connection - I'm assuming access for swap purposes would cause the same problem. So that's a big impairment of function for me at the moment. |
![]() |
![]() |
![]() |
#12 |
Zealot
![]() Posts: 128
Karma: 41
Join Date: Nov 2007
Device: Hanlin V3
|
So.. I just found this thread about being able to set (and use) a swapfile on the iLiad. Since this is just using your CF/SD card as a form of extended memory, does this also mean developers could start using this feature to implement a suspend mode????
Propably will get comments about the CPU not being able to power down completely etc.. However, when using iDS scheduled download it is able to turn on and off by itself, meaning that a software close down should be possible. Now only if the other keys like the flipbar could resume the device we should have enough to go forward right?? |
![]() |
![]() |
![]() |
#13 |
Addicted to Porting
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,697
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
|
Swap and suspend are 2 completely different animals... Getting swap working does absolutely nothing for suspend/sleep.
|
![]() |
![]() |
![]() |
#14 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 584
Karma: 914
Join Date: Mar 2008
Device: iliad
|
|
![]() |
![]() |
![]() |
#15 |
Connoisseur
![]() Posts: 50
Karma: 32
Join Date: Aug 2008
Device: Irex iLiad
|
I have enabled swap on MMC
![]() Why: I have a few HUGE pdf's consisting of images of scanned bookpages. Opening these files made the iLiad's LED blink forever (well many hours at least) and sometimes caused even a lockup (reset required). Because the same file showed different symptoms on different attempts, I wondered if the kernel ran out of memory and perhaps an application that doesn't check returns from malloc()-calls properly ![]() Adding (swap-) memory seemed a valid attempt to me to try to fix this. I have a permanently mounted 1 GByte MMC for non-iRex software and things, so I decided to put the swapfile there. I chose a size of 128MByte (2 * RAM). Result:
Remarks:
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Swap howdies? | durkinrobinson | Introduce Yourself | 12 | 09-06-2010 10:14 PM |
Screen Swap | Hrant | Amazon Kindle | 7 | 08-31-2010 08:42 AM |
DR800 swap out 3G | nprnncbl | iRex | 3 | 06-07-2010 04:45 PM |
Girls class to swap books for iLiad | ebookreaders | iRex | 2 | 09-05-2008 11:02 AM |
Ended Iliad for sale or swap | markiehill | Flea Market | 10 | 02-15-2007 12:08 PM |