Author Topic: Let's Make It A Read-only Rom  (Read 5268 times)

ToneBlind

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Let's Make It A Read-only Rom
« on: December 11, 2007, 02:39:28 pm »
Hi,

First of all, thanks to everyone in the forum. I just got an SL-C1000 in eBay, and I have used this forum for a long time to read on different aspects of these wonderful machines.

My question is: Why hasn't anyone focused on creating a fully read-only ROM? When I say read-only I am referring to a rom that doesn't write to flash memory, similar to how a Live CD works with respect to your hard drive by default.

I am convinced that this would be a very worthy addition to the stable of ROM/OSes for the Zaurus. The problem as I see it right now is that the limited amount of Flash RAM, combined with frequent write operations, as well as the limited amount of read-write cycles on this type of memory, put a limit on the longevity of your Zaurus.

I think this could be implemented in 2 different ways:
1. Actually implement read-only on flash memory by disabling writing of log files, preferences files, flash-stored application preference and configuration files, etc. That is, disable write operations targeted to flash RAM. I don't know if this is feasible or desirable.
2. Reroute write operations to SD media (preferably over CF media.) This would mean using a SD card as if it were built-in, with the advantage of being able to perform copies/backups to other SD card, and being able to replace it when the flash memory wears out.

I know there has been a lot of debate about whether such concerns are legitimate or not, but I believe that achieving a completely read-only ROM (at least from the point of view of the built-in NAND area) would put a lot of minds to rest, and likely improve the longevity of our Zaurii.

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Let's Make It A Read-only Rom
« Reply #1 on: December 11, 2007, 03:15:20 pm »
I think you should be able to do a couple of things:

1. Do a

Code: [Select]
mount -o remount ro /
Or whatever the command is (doing it off the top of my head).

2. Use pdaXii13, which, IIRC, can run 100% off of the SD card

I don't think wearing out flash is a huge concern. My point of view is that if and when you do it's probably time to get a new device (or use a ROM that can run from SD).

Hope this helps.
« Last Edit: December 11, 2007, 03:15:33 pm by Capn_Fish »
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Let's Make It A Read-only Rom
« Reply #2 on: December 11, 2007, 04:30:30 pm »
I thought  the root file sys on sharp (and cacko) was read only - you have to remount it readwrite if you want to change things.

to save flash wear, if you do have a writable space, be sure to mount "noatime" and "async" and do not use ext3.

you probably mainly want to put your home directory and commonly changed file onto an SD card too.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

ToneBlind

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Let's Make It A Read-only Rom
« Reply #3 on: December 11, 2007, 08:43:51 pm »
Quote from: Capn_Fish
I think you should be able to do a couple of things:

1. Do a

Code: [Select]
mount -o remount ro /
Or whatever the command is (doing it off the top of my head).

2. Use pdaXii13, which, IIRC, can run 100% off of the SD card

I don't think wearing out flash is a huge concern. My point of view is that if and when you do it's probably time to get a new device (or use a ROM that can run from SD).

Hope this helps.
Thank you for the ideas, Capn!

So, in the first case, we are remounting the flash memory area as read-only. Is this a one time operation? And by that I mean, if I shut down or reboot the Zaurus, do I need to invoke that command again? Also, does simply mounting the NAND read-only cause any troubles when running applications that try to write to NAND (example: preference or config files), or when the kernel itself tries to write to log files?

I am particularly intrigued by option 2., as installing pdaXii13 was something I have seriously been considering even before I got my Zaurus. Does this involve installing UBoot in the NAND area and then installing the OS itself in removable media? Does performance suffer a lot by installing to SD?

Thanks again. I'm really excited about this machine, and I hope to make the best out of it.

ToneBlind

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Let's Make It A Read-only Rom
« Reply #4 on: December 11, 2007, 08:51:38 pm »
Quote from: speculatrix
I thought  the root file sys on sharp (and cacko) was read only - you have to remount it readwrite if you want to change things.

to save flash wear, if you do have a writable space, be sure to mount "noatime" and "async" and do not use ext3.

you probably mainly want to put your home directory and commonly changed file onto an SD card too.
Speculatrix,

Thanks for responding! Yes, I seem to remember that the root file system on the Sharp roms was read-only. But there are other areas by default in NAND that are writable, aren't there? I should check into this.

Also, I understand the use of noatime to minimize write operations on writeable areas. How does async help?

What is the default filesystem architecture for the Sharp Roms? Isn't it Jsff2 or something like that? I assume your comment about not using ext3 refers to external ram (SD.) Is FAT (FAT16) the most desirable filesystem type to use?

I honestly would like to prevent all writes to NAND, or at least try to get away with it and see how it works with regards to implementation ease and performance.

Do you have any experience running pdaXii13, like Capn Fish mentioned from SD alone, without using NAND?

Thanks!

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Let's Make It A Read-only Rom
« Reply #5 on: December 11, 2007, 08:59:35 pm »
Quote from: ToneBlind
Thank you for the ideas, Capn!

So, in the first case, we are remounting the flash memory area as read-only. Is this a one time operation? And by that I mean, if I shut down or reboot the Zaurus, do I need to invoke that command again? Also, does simply mounting the NAND read-only cause any troubles when running applications that try to write to NAND (example: preference or config files), or when the kernel itself tries to write to log files?

I am particularly intrigued by option 2., as installing pdaXii13 was something I have seriously been considering even before I got my Zaurus. Does this involve installing UBoot in the NAND area and then installing the OS itself in removable media? Does performance suffer a lot by installing to SD?

Thanks again. I'm really excited about this machine, and I hope to make the best out of it.
I don't know how many errors it would cause, but it would likely be some. No, you need to do it every time you reboot (and hence the rootfs being remounted).

pdaXii13 does not need uBoot AFAIK. You can just install it to SD and it boots (or so I gather). You may want to check out the threads on this topic, as I have never used it myself. I just know a lot of people are happy with it.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

ToneBlind

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Let's Make It A Read-only Rom
« Reply #6 on: December 12, 2007, 07:13:38 am »
Quote from: Capn_Fish
I don't know how many errors it would cause, but it would likely be some. No, you need to do it every time you reboot (and hence the rootfs being remounted).

pdaXii13 does not need uBoot AFAIK. You can just install it to SD and it boots (or so I gather). You may want to check out the threads on this topic, as I have never used it myself. I just know a lot of people are happy with it.
Thanks. For some reason I thought that you needed Uboot to run pdaXii13 from SD. Could Uboot be used to run a different ROM, for example Cacko exclusively from SD though?

ToneBlind

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Let's Make It A Read-only Rom
« Reply #7 on: December 15, 2007, 06:07:28 pm »
So there is no known way to store and run Cacko fully from SD or CF? That's too bad. I ideally would have liked to have pdaXii13 on a SD and Cacko on another, and be able to run each one at will by changing the SD and selecting some option at boot time.

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Let's Make It A Read-only Rom
« Reply #8 on: December 20, 2007, 09:26:13 am »
Quote from: ToneBlind
Also, I understand the use of noatime to minimize write operations on writeable areas. How does async help?

sync means that linux writes to disk and flushes buffers in stages in order to ensure the file system is always kept consistent, so that pulling the card out anytime won't cause corruption.  It makes it slower because of the extra writes, and also slower because it will wait for data to be written before beginning the next updates.

async will reduce the number of writes, since linux will "assume" it doesn't need to keep the file system clean all the time, it also doesn't wait for the data to be committed.

Windows has this option - get properties of a removable disk and choose to optimise for performance or for (?) integrity.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.