Author Topic: Calling all Linux Kernel developers!  (Read 399623 times)

0 Members and 3 Guests are viewing this topic.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Calling all Linux Kernel developers!
« Reply #210 on: November 12, 2012, 11:36:48 am »
Brace yourselves, visites are coming on Omnimaga :P
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline _Nicco_

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 173
  • Rating: +6/-0
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #211 on: November 12, 2012, 01:12:20 pm »
So the next big thing was Linux on a calculator not another game or emulator.
They say that your signature is supposed to go here...

Offline noobnonin

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 151
  • Rating: +3/-38
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #212 on: November 12, 2012, 04:11:25 pm »
vogtinator,

could you please tell me how you did for the snapshot to run, i have problems with it, i used linux and put the command dd if=rootfs.ext2 of=/dev/sdb1  "sdb1 is my usb device" and when i connect it to the tinspire in the lap of the 10 seconds, nothing happens....
oh, im using an "on the go" female usb cable, i only connect my usb, no hub, just the usb with the rootfs.ext2

btw great job tangrs!!! :D
Regards
« Last Edit: November 12, 2012, 04:17:18 pm by noobnonin »

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #213 on: November 12, 2012, 04:43:40 pm »
Quote
nothing happens....
Does really nothing happen?
I think there should be some usb-device-messages.
Try to plug your stick in after you can see the "waiting for root device"-message.

BTW: Don't use /dev/sdb1. The kernel waits for /dev/sdb (WITHOUT any partitions on it, only a plain filesystem).
But if you cant see any messages, we have some other problems.

I cant't get directfb to work. It says "current mode not supported".
I can see the current mode with "fbset -i" and filled /etc/fb.modes with "fbset >> /etc/fb.modes" but it still can't find any suitable modes.

Offline linuxgeek96

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +4/-0
  • ( ͡° ͜ʖ ͡°)
    • View Profile
    • Personal Site
Re: Calling all Linux Kernel developers!
« Reply #214 on: November 12, 2012, 04:59:33 pm »
does anyone here know a good way to make a new snapshot?

Offline noobnonin

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 151
  • Rating: +3/-38
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #215 on: November 12, 2012, 09:13:26 pm »
ok this is what i have until now
you can see the picture that i attached  of "what i have.png"

and there is a video of me failing o.O

vogtinator, or someone, if im doing something wrong please tell me

Regards...

Offline Rhombicuboctahedron

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 437
  • Rating: +41/-6
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #216 on: November 12, 2012, 10:56:19 pm »
Well, it didn’t look like you had the initrd file, which, unlike the zimage file, I don’t think it is necessary to get something on the screen, but it is necessary to do anything.
I believe you can find a link to it at very first post here.
This is how far I got on linux
I can use the keyboard, which is awesome, but I can’t use a flashdrive, and it freezes when I use the bootscript_usb
Sorry if you can’t see the screen very well

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #217 on: November 13, 2012, 03:55:13 am »
If you boot from USB, you don't need an initrd, as there don't exists any modules needed to mount USB.
The zImage contains the kernel, without it it'd be useless.
« Last Edit: November 13, 2012, 03:55:28 am by Vogtinator »

Offline tangrs

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 229
  • Rating: +98/-0
    • View Profile
    • tangrs blog
Re: Calling all Linux Kernel developers!
« Reply #218 on: November 13, 2012, 04:39:16 am »
Updated at 7th Feb 2013

Since this is getting a little more popular (thanks to Hackaday), I decided to write up a little FAQ.

Is this really Linux?

Yes.

Which models does this support?

All current models - Clickpads, Touchpads and CX models.

What distro does this run?

Uh, Buildroot? Does that even count? Technically though, it can run any distro that supports ARM EABI. Debian ARM port should work but needs some effort.

Wait, so I can like, run Linux programs on this?

It depends. The answer is: most likely but might require a fair bit of effort.

Basically, the calculator doesn't run on your typical AMD/Intel x86 architecture. It runs on an ARM CPU core (similar to most android phones and iPhones/iPads/iPod Touches nowadays).

The software you can get on Ubuntu, Mint, Fedora, [insert favourite distro] are mostly binary packages. They've been precompiled by others and you just need to pretty much package-manager install package.

Now installing it like that on Nspire Linux most likely isn't exactly possible because:

A. Those packages are compiled for x86, not ARM.
B. The initrd/images that I've provided are built from Buildroot and almost won't have a package manager with everything pre-provided.

If you're the average user, you can stop reading now. The answer is no, it won't run whatever Linux program you want unless someone cross-compiled the program for you.

If you're feeling a little more adventurous, you can dive into the ugly world of cross-compiling. Now, the answer becomes "yes but only if you endure hours of pain".

The beauty about OSS is that you aren't restricted to using the binaries that you're given by others. To make your own programs run on Nspire Linux, we're going to need  the source code of the program you want and to cross compile for ARM.

Obviously, you'll need a cross-compiling toolchain. When you make a Buildroot, you get a cross-compile toolchain for free. You can use that to cross compile whatever package you want.

I won't go into the details. You can use Google for that.

Finally, if you hate dealing with compiling, there is one other solution. You can load up and run your favourite distro* onto the calc and use a package manager as usual. The Nspire won't have enough memory to hold it all but it does support booting from USB with the right options.

Again, Google is your friend.

* = provided they have an ARM port. I've had success with Debian ARM port.

Can this run Android?

Theoretically, yes but it's too much work for it to be worth it.

Does this run on top of the stock operating system?

No. Once loaded, it replaces the stock OS completely in memory.

How does this get loaded?

In-place loading. Basically, loading the kernel into memory using the stock OS functions, then let Linux take over (which replaces the Nspire OS).

Does this have X running?

Yes. The full configs at http://tiplanet.org/nspire-linux-builds/ will have an Xserver that you can run.

Can this run like KDE, Gnome, Xfce, Fluxbox, [insert favourite window manager]?

Yes but it'll probably suck (not that I've tried anything apart from TWM). Try not to forget that this is a 120MHz device with 64MB of RAM.

Why doesn't this run on the emulator?

I'm not sure. I think some co-processor instructions that Linux requires but not the stock OS weren't implemented in the emulator.

OMG, how to internetz?

The video/s of my calculator going on the internet are just a little personal distraction. The program is links and I'm just using a USB wireless dongle to connect to a wireless network.

Please don't ask me how I did it because it will vary depending on your hardware. Very generally speaking though, you'll need the kernel modules for your USB dongle and possibly  some firmware files. During run time, just load the kernel drivers, use a little wpa_supplicant and udhcpd magic and bam, you've got net.

But seriously, don't email me about this (unless it is a very specific/technical question) because I probably don't have time to help you step by step.

Won't this, like, make it easier for people to cheat?

Well, I don't believe so. Considering the amount of hardware you have to connect to the Nspire (I'm talking a USB hub, a USB drive and a power adapter) to make the internet work, I doubt a exam supervisor/teacher wouldn't notice it.

Besides, I'm pretty sure the stock OS doesn't have lots of white on black text and a picture of a penguin on it ;)

I need help.

The quick links at the top of the front page can help you.

You should run the stock OS on an emulator inside Linux. That'd be cool.

It would indeed be amusing.

Can this run emulators?

See "Wait, so I can like, run Linux programs on this?"

Does this support C++?

Of course. Linux isn't Ndless and don't share the same restrctions.

Though, that being said, a C++ toolchain is possible on Ndless - there are some notes on my blog.

So, what does this thing do exactly?

Nothing really. It's just cool!

Why are my USB devices causing Linux to go crazy on the console?

Your USB device is probably trying to draw too much power. You might need an external, powered hub.

The Nspire USB hardware only gives out something like 8mA compared to the 500mA in the USB specs.

"Will this? run Crisis?"

Yes. Yes it will.
« Last Edit: February 07, 2013, 01:26:58 am by tangrs »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Calling all Linux Kernel developers!
« Reply #219 on: November 13, 2012, 11:25:35 am »
Lol, crysis :P
Nice faq. There has been something I was wondering when I noticed that you said that the linux kernel completely replaces the nspire os in memory when you start it. How do you manage the transistion? How do you manage using the nspire OSes functions to load the linux kernel and then replace themselves with linux?
/e

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #220 on: November 13, 2012, 12:01:00 pm »
Basically the same way as OSLauncher: while overwriting the OS, you have to make sure not to rely on any OS code, so your loader has to deliver all the functions it needs (in the case of OSLauncher, e.g. zlib for decompressing the OS, or GCC's builtin memory functions).
After removing all traces of the previous OS (things like clearing cache), you can pass control to the new OS.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Calling all Linux Kernel developers!
« Reply #221 on: November 13, 2012, 12:10:42 pm »
Quote
Basically the same way as OSLauncher: while overwriting the OS, you have to make sure not to rely on any OS code, so your loader has to deliver all the functions it needs     
   (in the case of OSLauncher, e.g. zlib for decompressing the OS, or GCC's builtin memory functions).                                                                           
   After removing all traces of the previous OS (things like clearing cache), you can pass control to the new OS.
Quote
How does this get loaded?
   In-place loading. Basically, loading the kernel into memory using the stock OS functions, then let Linux take over.
From what he says here he does rely on stock os functions. So if he does use the stock functions, how does he handle loading the linux kernel into ram and not overwriting these functions?
I'm kind of interested in a more technical explanation of how it is done. Not just a simple gloss over.
/e

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: Calling all Linux Kernel developers!
« Reply #222 on: November 13, 2012, 01:52:00 pm »
Oh well, my explanation was a bit wrong. I assumed he loads the kernel to 0x1000000 (that's what OSLauncher does), which would be the SDRAM starting address (and the place where the stock OS lies, so OSLauncher has to take care not to use any functions of it, furthermore interrupts are disabled during the process, so we can't use syscalls at all, not even ndless functions), but after a quick look at the source he just mallocs as much memory as possible (with stock OS functions) and loads kernel + ramdisk into it (with stock OS functions) and then passes control to the kernel.
So there's no need to provide own functions, he can use syscalls the whole time because he isn't overwriting any functions of the OS.

But yeah, maybe tangrs can explain this better (and correct me if I'm wrong) :D

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Calling all Linux Kernel developers!
« Reply #223 on: November 13, 2012, 01:57:41 pm »
Ah ok, hmm, does the linux kernel then reallocate itself to an earlier place in ram? I'll wait for tangers before I ask any more questions :P
/e

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calling all Linux Kernel developers!
« Reply #224 on: November 13, 2012, 01:59:17 pm »
Darn this is nice to see on Hackaday :D