Omnimaga

Calculator Community => Casio Calculators => Topic started by: bb010g on December 18, 2012, 10:19:15 am

Title: Mass Storage for Prizm
Post by: bb010g on December 18, 2012, 10:19:15 am
I was wondering if it would be possible to make the Prizm interface with a USB thumb drive or other mass storage device. It would be useful because the Prizm only has 16 MiB of storage available, and a project I'm working on would need more (at least the ability to mount it and use it mid-program).
Title: Re: Mass Storage for Prizm
Post by: flyingfisch on December 18, 2012, 10:21:48 am
I was wondering if it would be possible to make the Prizm interface with a USB thumb drive or other mass storage device. It would be useful because the Prizm only has 16 MiB of storage available, and a project I'm working on would need more (at least the ability to mount it and use it mid-program).

I've been wondering about this as well. I know that in test mode, you can unmount flash memory, which means that it can mount/unmount. I don't know how to get it to interface with an external drive though...
Title: Re: Mass Storage for Prizm
Post by: DJ Omnimaga on December 18, 2012, 01:38:59 pm
Heya and welcome here. I think it might be possible if the USB protocol is similar to the TI-84+ and TI-Nspire CX, as it has been done on those calcs, but on the TI-Nspire series it took over 2 years after ASM/C arrives before someone manages to figure out how the USB protocol works.

It would definitively be nice, though. What project do you work on?
Title: Re: Mass Storage for Prizm
Post by: bb010g on December 18, 2012, 05:35:06 pm
I'm working on compiling and run Linux with a terminal emulator. (Linux itself is extremely small, the Linux From Scratch team got a basic Apache web server running with 8 MB of disk space.) Everything except for what is essential to boot and mount would be on external storage (including swap).
Title: Re: Mass Storage for Prizm
Post by: Darl181 on December 18, 2012, 05:53:26 pm
One of the difficulties I'm seeing is it wouldn't be able to work by the standard since the Prizm's usb port can't take mini-A plugs (which are normally needed for one device to host another), only B.  Unless it can emulate OTG with just a mini-B port or something? I'm not too familiar with these things :P
I'm guessing it wouldn't be too hard to work around the standard or something but you never know :/
Title: Re: Mass Storage for Prizm
Post by: Juju on December 19, 2012, 10:46:30 am
The Prizm would indeed run Linux. Actually, you could do like what they did with the Nspire, as in write a g3a that could boot the kernel with would mount an image as its root directory. You can use buildroot (http://buildroot.uclibc.org/) for that which can generate an extremely small image that can easily fit on the 16 MB storage.

I've looked once on how to port Linux and I hit several walls and questions:
1. First of all, how to write the bootloader?
2. Then you might want to have input/output: you probably have to write a driver for the screen and for the keyboard, unless it sends the output to the bootloader's PrizmIO, but still you might still want to write the drivers if you want more than basic I/O. (Like if you want to run SDL or something.)
3. Compile for the right SH CPU model? Like for ARM processors, you might have to compile not only for SH4, but for the particular model of SH4 the Prizm uses.
Title: Re: Mass Storage for Prizm
Post by: calc84maniac on December 19, 2012, 01:08:37 pm
I think I heard that the PRIZM's USB port only supports peripheral mode, and it's not OTG. That's why you can't use it for calc-to-calc linking and such, and I don't think it's able to run in host mode at all.
Title: Re: Mass Storage for Prizm
Post by: Juju on December 29, 2012, 05:43:21 pm
http://www.kernel.org/doc/Documentation/sh/new-machine.txt

Just leaving this here.
Title: Re: Mass Storage for Prizm
Post by: Vogtinator on December 29, 2012, 05:55:38 pm
The size of the flash would not be a problem, my fritzbox has only 4 MB flash and has two webservers, wlan etc..
According to http://prizmwiki.omnimaga.org/wiki/Casio_Prizm (http://prizmwiki.omnimaga.org/wiki/Casio_Prizm) the prizm does only have 2 MiB RAM.
I don't think that would be enough space to run applications.
Does the prizm allow executing programs directly from flash?
Then the bootloader would only need to load sections with r/w access into RAM.
Title: Re: Mass Storage for Prizm
Post by: Juju on December 29, 2012, 06:16:47 pm
The flash is 16 MiB and apps are directly ran from there, so I guess it won't be a problem. Everything (bootloader, kernel, rootfs) would be loaded from flash. But I dunno if you can do much with 2 MiB of RAM, I guess you could solve this with swap.
Title: Re: Mass Storage for Prizm
Post by: MPoupe on January 02, 2013, 05:46:40 am
...I guess you could solve this with swap.
The flash is very slow, as SimonLothar wrote in his fx_calculators_SuperH_based_xx manual:
"...The system needs about 3 minutes to create a file of 1 MB size...", which less than 6KB/s.
Title: Re: Mass Storage for Prizm
Post by: Juju on January 02, 2013, 03:17:18 pm
6KB/s swap, that indeed won't really be useful.