uclinux
m00tykins
Posts: 73
Hello again everyone,
I recently found out about uclinux, which is based on the Linux kernel but doesn't require an mmu. I think this would be a much better os port to the prop2 but will of course be much more difficult than contiki. I was wondering if anyone here would be interested in helping port uclinux. It requires several megabytes of ram so lmm will of course be necessary. Once the prop2 comes out I will set up a github for the port. Let me know if you'd like to help. Thank you!
-moot
I recently found out about uclinux, which is based on the Linux kernel but doesn't require an mmu. I think this would be a much better os port to the prop2 but will of course be much more difficult than contiki. I was wondering if anyone here would be interested in helping port uclinux. It requires several megabytes of ram so lmm will of course be necessary. Once the prop2 comes out I will set up a github for the port. Let me know if you'd like to help. Thank you!
-moot
Comments
The thing here is you started out wanting Linux.. which is a lot more and generally requires a SOC (system on a chip) architecture.
In many, many situations --- Linux actually gets in the way. Writing code directly for the Propeller without the added burden of an OS can actually do many things better. But if you want GCC for the PIC or the Propeller, you will have to cross-compile in an OS (and that can be done in Linux, Windows, or iOS).
Interesting idea. An idea that has been tossed around here a few times over the years.
RAM is not a problem. I have a GadgetGangster board here with a Propeller and 32MB of RAM. That is enough to run a Linux system. Of course making use of it will be slow as hell but logically it is doable.
What else do we need for Linux?
1) A memory management unit (MMU). Needed for virtual memory. No problem, we already have an interpreter fetching and executing code from external memory so adding checking for page faults and doing MMU stuff can be added there.
2) Interrupts. At least one. The timer tick. That's how tasks get scheduled. The Propeller does not have interrupts. Again no problem. That interpreter, whilst fetching and executing instructions from external memory, can also check if it has timer tick or other interrupt.
Of course all that will make execution speed uselessly slow. But it can be done. We know it can be done because Linux has been run on an 8 bit AVR processor. You can watch the three and a half hour video of Linux on AVR booting to the command prompt here:
http://dmitry.gr/index.php?r=05.Projects&proj=07.+Linux+on+8bit
Perhaps with the 32 bit P2 we can get that down to half an hour or so.
I can't help but think that you're trying to re-invent the (round) wheel using a square processor. The P1 and P2 aren't designed for CPU duties; they're designed as real-time microcontrollers and lack just about everything needed to run a full, or even cut-down, operating system.
If you really want to build something different then why not investigate areas where the Prop ought to do well?
Why not look at implementing a multicore operating system? One where each thread/task is launched into its own COG. One where you expand throughput by adding on additional processors. One where message passing is done as part of the hardware design.
+1
Sorry, I confused uclinux with uclibc. So when I said we need an MMU that was not exactly true.
But the end conclusion is the same. With some huge amount of effort I'm sure one could get some kind of Linux to run on the P2. As a curiosity that might occupy your mind for a long while and keep you off the streets that's great but at the end of the day it will have no practical use.
Linux on the 8 bit AVR is a serious curiosity because it was not about getting Linux to run on an AVR but rather writing an Intel 386 emulation for the AVR that was accurate enough to then boot Linux.
I have no idea why anyone would want to do that, but hey, I'm crazy and it seems others are more crazy.
Of course there was a time when I said that a C compiler for the Propeller was pointless and "impossible". Since then we have seen three C compilers for the Prop.
Of course it is crazy, but the sort of crazy that just has to impress
I think getting contiki running on the P2 could be a lot of fun.It's even likely to attract users and perhaps contributors which would make it even more fun.
I have not looked into contiki much but when the C compilers started to appear for the Propeller there was one idea that attracted me. contiki has a slip interface driver. That is the "Serial Line Internet Protocol". Slip is what we used to run IP over serial before PPP was invented.
Slip is still part of Linux so one could have a direct serial connection from Linux to Propeller that looks like a network socket connection!
Or run slip over that wireless UART adapter and server up web pages from the Prop!
Probably not practical proposition but the idea fascinated me for a while.