Discussion in 'Cisco/Linksys Network Storage Devices' started by dsc68, May 15, 2008.
This thread is for collecting any interesting hacking tidbits we may discover for the NAS200
Many config files, like crontab, are built on the fly at boot time. The system configuration details are stored in /etc/CGI_ds.conf but, as /etc is a ramfs partition, the master copy is stored in flashram which can be accessed as /dev/rom2.
Just had an interesting thought.....
Couldn't you create a custom installer of a Linux Distro (of your choice) altering the installer so the Lilo would go to the Flash (well maybe something a little more complicated) without the RedBoot getting damaged and the Full Linux operating system could be installed to one of the internal hard drives and do a Network install???
Doing it this way, you wouldn't be limited to just the flash and you would have full access to the setup disc partitioning utility so you could partition the drive how you want it, OS, Swap, Personal files.
This would still leave you with one other drive for network files.
But you could expand this to five drives instead of one by using a MG-SA1456 1-to-5 SATA2 Port Multiplier simply by disconnecting the internal SATA cable and connecting it to this.
Or if you want to add more drives using RAID, you can add this one, SS-4726HUB 1-to-5 Native SATA2 Port Multiplier RAID 0/1/10 and JBOD Support
This is kinda what I'm working on...
The NAS200 has no BIOS, it has ecos and redboot. So you can't use standard bootloaders such as LILO or Grub that rely on a working BIOS. However I think ecos supports IDE (if not, we can add it) so it should be possible to have it load a kernel from harddisk.
Alternatively it should in theory be possible to use kexec. Kexec is supported by the Linksys kernel but I tried using kexec-tools (compiled on my Gentoo machine) and it locks up the NAS200 on a reboot. I haven't had time to find out exactly why that happens but I'm sure it's possible to chain-boot to a kernel loaded from harddisk.
I'm thinking of using the backup button and the lights on the front panel to switch between boot kernels: Hold the button during boot to make a choice; the boot selector lights up the lights one by one, let go of the button when the light is on for the device you want to boot from: network, disk 1, disk 2, usb 1, usb 2. All lights are controllable: they are all on GPIO outputs.
The linksys firmware only uses 3 partitions; with gPartEd it should be possible to resize partitions and add a boot partition. But repartitioning with resizing filesystems is always slow and dangerous so I think I would prefer using loopback filesystems as rootfs.
I had never heard of devices like this and I'm excited to hear they exist. I wonder if they are compatible with the SATA controller on the NAS200 motherboard (SiL3512ECTU128) and/or what kind of support they require from the OS.
PS I think a wiki would be a better place to gather knowledge about stuff like this...
True, using the one at http://www.nslu2-linux.org is probably appropriate - I was just using this to quickly note down and share things as I came across them.
Does the Backup button actually do anything, besides go beep? I quickly played with the Windows backup software and I couldn't see how it was used. Pressing it does cause the NAS200 to broadcast a UDP packet but nothing else seemed to happen.
I'm just curious now,.....
Just Tossing About A Hypothetical Question
The firmware for the NAS200 is nothing more than a Customized, cut-down Linux Operating System which serves as a Glorified system BIOS or does it have a seperate BIOS somewhere on the motherboard?
IF it is a Glorified BIOS (so to speak), Then would it be possible to find a BIOS which could be customized for the NAS200 which would allow a Network Install of an Operating System directly to the Hard drive instead of the flash?
I don't know enough about the inner workings of Systems Bios to know what is possible or is not possible. But then again, maybe my asking this might just help others to think of a way to do just this. After all, the BIOS is nothing more than the underlying workings of a computer which enables it to do what ever it does.
It sort of already has that with RedBoot bootstrap environment.
Well then, if the RedBoot is serving as the Bios, would it be possible to Modify that to serve our purpose?
The NAS200 has ecos and redboot instead of a BIOS. It's possible that OpenBIOS will work but I don't really see much benefit in that, because it's a headless system anyway so there's no keyboard or video to initialize. Any OS that I would want to run on the NAS200 can work without BIOS so I'd prefer to build extra functionality (like giving the user a choice where to boot from) into ecos, rather than using a BIOS and e.g. Grub or Lilo.
I would be more than uncomfortable replacing the boot loader on a headless system like this with something that I don't know at all. Besides, a BIOS is still not going to load Linux so you would need Grub or Lilo or whatever too. I don't know Grub and Lilo's code very well so I don't know if they can run from flash but they would probably take up at least SOME space that I'd rather use for something else besides booting. And I don't want our firmware to rely on a bootloader that's on the harddisk: that way the NAS would be bricked if something goes wrong with the harddisk. In fact, my plan is for our firmware to be the fallback mechanism that will boot other firmwares if it can, but can work by itself if it needs to.
My vote is for ecos/redboot to stay. We can add functionality to it to give users more possibilities, and with ecos/redboot we will support maximum backwards-compatibility with original Linksys firmware right from the beginning.
SATA transfer mode?
hdparm can't query whether the onboard SATA devices are using PIO or DMA. From the speed (and apparently the cpu usage) it feels like it's using PIO. Can anyone state what it is using?