Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: alberthrocks on March 01, 2011, 11:30:35 pm

Title: Linux on Nspire?
Post by: alberthrocks on March 01, 2011, 11:30:35 pm
Initially started on IRC, Jonimus has suggested that you can get Linux on the Nspire, since it's ARM (Linux supported), and that doing such a thing doesn't require modifying boot1/boot2/OS. ;) Of course, it will modify memory, reset parts of the HW, etc. to get it working, but other than that, it's definitely possible. Run a ndless program, and you're off! ;)

Some other notes:
= Look at Harlet/Lab Boot/uBoot and base the bootloader off them
= Use Angstrom Linux for the distro
= We need to know exact HW specs for Nspire (including memory mappings, LCD controller, etc.), and potentially find a dev board that has similar HW and use software provided with that dev board

So, can we do it? :D

Quote from: Jonimus
Edit: Also lets keep this thread about the kernel and bootloader, we can figure out where to put the rootfs later.

EDIT by DJ_O: Appended Jonimus quote so people can see. Members cannot enforce rules about what is discussed in a thread, but I'M adding this so it won't drift away from the main topic too much.
Title: Re: Linux on Nspire?
Post by: willrandship on March 01, 2011, 11:32:49 pm
I think the easiest way, storage wise, would be to boot off an sd card hooked to the base. That way, size constraints are much less of an issue, since you don't have to pack it into ~10MB so it fits, leaving ~10MB for all your stuff.
Title: Re: Linux on Nspire?
Post by: JonimusPrime on March 01, 2011, 11:36:01 pm
Step 1 and 3 are the big things, we can choose a distro or roll our own once we have something booting.

If we can find a similar board with at least close memory mapping and hardware we will save huge amounts of time and work. Currently afaik non of us know enough to start from scratch so this is where I think we should start.

Edit: Also lets keep this thread about the kernel and bootloader, we can figure out where to put the rootfs later.

Also space concerns on a non issue, busybox easily fits on routers with 2MB's of flash we so we have plenty of space.
Title: Re: Linux on Nspire?
Post by: willrandship on March 01, 2011, 11:37:30 pm
Fine :P Hackspire has a lot of serial #s from teardowns, as does Datamath.

It also has a TON of mem maps, that's like half the site :P
Title: Re: Linux on Nspire?
Post by: DJ Omnimaga on March 01, 2011, 11:38:18 pm
Would Linux need to be reinstalled every reboot, since it would not be an entire new OS installed like the real OS 2.1, for example? Or would it do like the 1337sp33k mod by Compu? It would be nice if we could have OS patches that basically overwritten the OS and installed Linux.
Title: Re: Linux on Nspire?
Post by: JonimusPrime on March 01, 2011, 11:42:56 pm
I know nothing about the hardware itself other than it is arm9 so while I am willing to poke at the kernel a bit we'll need someone who is more of an expert on the hardware to at least point us in the right direction.

hackenspire has a lot of good information but finding at least what arm "platform" it is based off of will give me a starting point for linux. If it is entirely custom then we might as well stop here as I personally don't have enough knowledge nor the time to start from the ground up and nor does anyone else here afaik.
Title: Re: Linux on Nspire?
Post by: willrandship on March 01, 2011, 11:45:05 pm
It's prob not, considering it's got an existing OS on it :P
Title: Re: Linux on Nspire?
Post by: ruler501 on March 01, 2011, 11:46:23 pm
We need the OS signing key so we can create a Linux OS and get the calc to accept and install it. who here can quickly factor 1024 bit RSA encryption?
Title: Re: Linux on Nspire?
Post by: JonimusPrime on March 01, 2011, 11:46:52 pm
DJ_O that is out of scope of this thread. Once we have a working kernel we can decide those logistics but without the kernel any other speculation of how things will work is pointless.

But in response to your question:
For booting Linux on a Windows Mobile device you can either install linux to replace Windows Mobile or you can use what is called a chain loader to boot Linux from Windows Mobile so that you can still use both, we'd most likely go with this second option.
Title: Re: Linux on Nspire?
Post by: willrandship on March 01, 2011, 11:46:54 pm
@ruler no, that's only for boot. This is from ndless
Title: Re: Linux on Nspire?
Post by: ruler501 on March 01, 2011, 11:50:09 pm
OK I thought you were making it save space and make an awesome calculator that ran Linux.

-reads more- Now I understand what this is about never mind my above post. this is like the TI-89 loading a PC right?
Title: Re: Linux on Nspire?
Post by: willrandship on March 01, 2011, 11:54:39 pm
What? It'd be like having KOS as an App, if that helps...not sure about the PC thing.
Title: Re: Linux on Nspire?
Post by: JonimusPrime on March 02, 2011, 12:02:46 am
To clarify this thread should be about getting the Linux kernel booting on the Nspire if you don't know what that means or you are not familiar with the Nspire hardware, ARM devices in general, the linux kernel, or arm bootloaders than this thread is not of interest to you. If you cannot contribute in one of those areas please keep this thread clear of unneeded cruft. Encouragement and questions are good except when they drown out the conversation and content the thread is intended to contain.
Title: Re: Linux on Nspire?
Post by: DJ Omnimaga on March 02, 2011, 12:09:14 am
DJ_O that is out of scope of this thread. Once we have a working kernel we can decide those logistics but without the kernel any other speculation of how things will work is pointless.

But in response to your question:
For booting Linux on a Windows Mobile device you can either install linux to replace Windows Mobile or you can use what is called a chain loader to boot Linux from Windows Mobile so that you can still use both, we'd most likely go with this second option.
Ok fine, then. I don't think we should single out anyone from the thread, though, as no Omnimaga rules allows some users to be excluded from a thread. Let's not badmouth people everytime they post something that isn't spam/trolling on next pages, otherwise it might be best to just move the discussion on Cemetech, UTI or something, or simply move the thread out of the ideas section (Other calculator discussion and news?). After all, this is the projects/ideas section, where people are allowed to post ideas. I think people should be allowed to ask questions, as this would increase the project audience. A sub-forum might eventually solve this, though.
Title: Re: Linux on Nspire?
Post by: willrandship on March 02, 2011, 12:19:23 am
Yeah, I'm semi familiar. Maybe a good start would be getting ahold of a good kernel base to start with. The terminal can run off the serial for all I care, really the proof of concept must come first, then we can build from there.

Also, I don't see X11 on the nspire, myself. Maybe a severely cut down version, but not in its current state by any means. Besides, what's the point, when really, all we need is a decent shell to get us from prog to prog, and who knows, if it's slow enough we could get long enough batt. life to run it continuously! :)
Title: Re: Linux on Nspire?
Post by: JonimusPrime on March 02, 2011, 12:52:03 am
DJ my point was I wanted to see if we had the combined knowledge and manpower to do this before we had a 20 page thread about it. If and when things get going a 20 page thread+ML+wiki etc would be in order but I want to try and keep things organized since the first thing we need is a kernel and a bootloader then that is all the should focus on. Anything else is unneeded.

As I said our first step is to see if we can find a platform similar to the Nspire that already has Linux support, if none such device exists much more research will need to be done. I personally don't have the time to do this but I will assist if there is someone willing and knowledgeable enough to take the reigns.

For me PoC would be getting the kernel to spit something out on either the LCD or the rs-232 lines if we can get that then the rest will follow. The hard part is getting the ball rolling/the kernel booting, its mostly down hill from there thanks to the likes of angstrom and similar embedded Linux distros.
Title: Re: Linux on Nspire?
Post by: DJ Omnimaga on March 02, 2011, 12:55:17 am
Ok, I understand. Just make sure to stay within board rules about keeping the site "hostility-free". We don't want guests to look at this thread and refuse to sign up just because they get a bad impression of Omni based on it.

I appended one of your quote about the topic content in the first post. Would it be best later to include some important points to the first post, so people who are new and want to join don't have to read through 20 pages of posts?
Title: Re: Linux on Nspire?
Post by: SirCmpwn on March 02, 2011, 01:14:38 am
What? It'd be like having KOS as an App, if that helps...not sure about the PC thing.
;)

I've put a little thought into Linux on Nspire myself, but never actually tried anything.  Sounds interesting, I'd love to help.
Title: Re: Linux on Nspire?
Post by: AngelFish on March 02, 2011, 01:33:31 am
To clarify this thread should be about getting the Linux kernel booting on the Nspire if you don't know what that means or you are not familiar with the Nspire hardware, ARM devices in general, the linux kernel, or arm bootloaders than this thread is not of interest to you. If you cannot contribute in one of those areas please keep this thread clear of unneeded cruft. Encouragement and questions are good except when they drown out the conversation and content the thread is intended to contain.

I think that sounds a bit harsh. Perhaps it might be better to say "Please attempt to make constructive and informative posts only."

Anyway, I may as well take my own medicine. Here's a dev board with the same processor running Linux:

http://www.teamfdi.com/development-tools-kits/products/3/LPC3180-DEV-KIT (http://www.teamfdi.com/development-tools-kits/products/3/LPC3180-DEV-KIT)

Here's a much cheaper dev board using the same processor and running an apparently proprietary Linux based RTOS:

http://microcontrollershop.com/product_info.php?products_id=2185 (http://microcontrollershop.com/product_info.php?products_id=2185)

It would appear that Google Android 1.7 supports the ARM926EJ-S, as this Android tablet (http://www.dhgate.com/2pcs-lot-mid706-7-inch-tablet-pc-google-android/p-ff80808129b0c7be0129c673e46263fa.html) uses that processor.
Title: Re: Linux on Nspire?
Post by: JonimusPrime on March 02, 2011, 01:36:06 am
Some quick googling came up with this as a good place to look at getting a bootloader setup. Someone familiar with ndless programming could look into implementing something based on this via an ndless program, assuming we have enough access to the hardware to do so.

http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html (http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html)

Ok thanks I will look into that, the patch that adds support for that board to the kernel is here http://www.phytec.com/products/linux/bsp-LPC3180.html I have started to look through it to get an idea of where we will want to start. Sadly it seems the patch contains a large amount of useless content and is for a rather old kernel version but its better than nothing, thanks.

Also again sorry for any harshness, but I felt I needed to define what was constructive was in relation to this thread.
Title: Re: Linux on Nspire?
Post by: willrandship on March 02, 2011, 01:52:13 am
Looks like quite an informative article! I sure like the sound of those already existing bootloaders...:P U-Boot looks to be the most promising, IMO.
Title: Re: Linux on Nspire?
Post by: JonimusPrime on March 02, 2011, 02:01:01 am
Just to get an idea of how many different Arm based Linux machine types there are and why getting Linux on an Arm device is harder than just installing via Live CD on a desktop here is a nice list of all the registered "machine types" most of which are not or may never have been supported by the mainline Linux kernel. http://www.arm.linux.org.uk/developer/machines/

But hopefully one of those is close to what we need, if not we'll have to start from scratch which may not be the end of the world, just means harder work, but it maybe less in the end depending on the situation.
Title: Re: Linux on Nspire?
Post by: willrandship on March 02, 2011, 02:02:42 am
Don't worry, our particular processor is a fairy popular setup, actually one of TI's mainline ARM9s so it's quite common. I don't think there'll be too much of an issue finding a similar setup we could start with.
Title: Re: Linux on Nspire?
Post by: JonimusPrime on March 02, 2011, 02:04:34 am
Well sadly its not just the processor, its the memory layout, peripheral chips, LCD, USB controller that we have to worry about, but the more I look into it the more sense starting from scratch seems to make, but that may just be me being tired. Once we have a way to boot things we'll know more.
Title: Re: Linux on Nspire?
Post by: willrandship on March 02, 2011, 02:07:37 am
Ah. That is difficult. Hooray for hackspire I guess :/
Title: Re: Linux on Nspire?
Post by: Jim Bauwens on March 02, 2011, 05:33:22 am
I think the best way to boot Linux would be to copy the Linux kernel to ram and then execute it.
Linux will then take over the system (I think). As for a rootfs, it will be hard to make the kernel read the the flash, so the best thing would be to copy a little rootfs that contains a base system to ram.

Haret works in a similar way, and I think this is the best way instead of starting a bootloader like uboot.

Title: Re: Linux on Nspire?
Post by: Netham45 on March 02, 2011, 05:56:24 am
I looked into a kernel build on a proc similar to the nspires a few weeks ago, and turned up nothing very relevant. There are builds for that family of ARM cpus, but nothing that'd really directly run on the calc.

Also, just until we find a working kernel, I'd suggest loading it by using it as the flash1 image in nspire_emu(It's been renamed, but I can't remember what to). That *should*(to my knowledge) run it at a base of 0x0. You can use flash2 also, since there's never a point where the calc cuts off access to that. You'd have to look on hackspire or ask one of the resident gurus for what address that code is loaded at.



(Ignore any nonsense, I'm very tired.)
Title: Re: Linux on Nspire?
Post by: JonimusPrime on March 02, 2011, 07:26:19 am
I've started reading http://www.glomationinc.com/PortingLinuxKernel.pdf which seems to be a good starting place and so far has confirmed what I thought was the case when it comes to kernel side things. We'll want to see if the Nspire is similar enough to any existing machine types to base our work off we'll have to work from scratch but that doesn't seem to be as big of deal as I originally thought. Give this a read if your interested in helping as it seems to have very relevant info.