Shop OBEX P1 Docs P2 Docs Learn Events
8-bit linux — Parallax Forums

8-bit linux

steddymansteddyman Posts: 91
edited 2014-12-26 13:11 in Propeller 1
I know there has been talk on here previously about if it was possible to port Linux to the Prop.

Well, the answer now is yes!

http://dmitry.gr/index.php?r=05.Projects&proj=07.+Linux+on+8bit

Comments

  • Heater.Heater. Posts: 21,230
    edited 2014-12-24 02:20
    Old news I'm afraid.

    That was not a port/build of Linux for the 8 bit micro. Rather it was a normal 32 bit build of Linux, for MIPS if I recall, being run on an emulator running on the 8 bitter.

    All we need now is an emulation of the AVR that runs on the Prop that in turn runs that Linux :)
  • steddymansteddyman Posts: 91
    edited 2014-12-24 02:52
    Haha... now that would probably take 24 hours to boot (but probably wouldn't stop some from building it).
  • Heater.Heater. Posts: 21,230
    edited 2014-12-24 04:23
    Interestingly the creator of Linux on AVR seems to have optimized the thing a lot recently. The emulator is up from 6 KIPS to 10 KIPS or something like that. His boot time must be down to 2 hours or so.

    I did actually play his 3.5 hour long video on YouTube of the thing booting. I was asleep for most of it...
  • pik33pik33 Posts: 2,366
    edited 2014-12-26 01:01
    The Propeller is much faster than AVR so the MIPS or maybe ARM emulator can run faster too and the boot process may take less than one hour :)
  • jazzedjazzed Posts: 11,803
    edited 2014-12-26 09:55
    pik33 wrote: »
    The Propeller is much faster than AVR so the MIPS or maybe ARM emulator can run faster too and the boot process may take less than one hour :)

    Hmm.

    Could you speculate on such a comparison with more detail?
  • Heater.Heater. Posts: 21,230
    edited 2014-12-26 10:07
    Hmm...

    Well let's see. The Prop is a 32 bit machine. So that is a factor of 4 gain over an 8 bitter when emulating 32 bit MIPS architecture instructions at least.

    I'm not sure how the Prop and AVR compare clock speed wise though. Even if they had the same MIPS the Prop is hindered by probably having to use LMM to do this which slugs it's speed down by at least a factor of 4.

    The big bottleneck in both cases is bit banging the interface to the external RAM which probably dwarfs all other limits.

    Seems like a bit of a close call to me.

    The only way we will tell is if some brave soul steps up to the plate and does it.
  • pik33pik33 Posts: 2,366
    edited 2014-12-26 10:11
    This is only guess. We have 8 32bit cores instead of 1 8bit core of AVR. We have 32k fast RAM. I have no time now to start such a hobby project because I have at least one hobby project in active development (the p1v retromachine) and PhD dissertation in progress, too.

    The Propeller is about 8x as powerful as AVR in raw MIPS and these MIPS are 32bit. But then only one core can work as CPU... and there is no MUL and no interrupts... but then it hasn't to emulate the mmu (there are another cogs for this) and then there can be a cache implemented using hub ram and another cog(s) .... then the raw guess is something about 8x AVR speed and this will give less than hour to boot.
  • Heater.Heater. Posts: 21,230
    edited 2014-12-26 10:33
    I'm not convinced.

    As you say. 8 cores does not help with emulating MIPS instructions. Given that the emulator is likely to be too big to fit into COG it will have to use LMM or overlays in order to fetch it's own code from HUB. At that point we are down to about 5 MIPS of Propeller execution speed. Pretty poor even compared to the AVR.

    As far as a COG is concerned we do not have fast RAM. Hence the 5 MIPS execution rate alluded to,

    The only plus side is that we can run the external bit banging for the external RAM in parallel in another COG and we can probably do some caching of that external RAM in HUB. Again perhaps the cache manager is another COG. As we do for the ZiCog and other Z80 emulators on the Prop.

    All in all I would not expect the Prop to be much faster at this.
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-12-26 11:29
    A Prop-based VM that could run Linux would probably need to execute from external RAM and emulate an MMU. This VM could probably be implemented by modifying the existing PropGCC XMM kernel to add MMU capability. However, XMM on the Prop is extremely slow. The XMM kernel would also need to emulate interrupt capabiltiy. This could be done, but the result would be impractical.
  • pik33pik33 Posts: 2,366
    edited 2014-12-26 11:44
    The AVR result is complete impractical, too.
    The emulated ARM speed is 10 KHz. :) It also can access SDRAM @ up to 300 kB/s.

    I am sure the Propeller can emulate ARM at much more than 10 kHz. If we can access ARM code using XMM model @ 80 kHz, (as in my 8x guessing) we have 250 P1 instruction to interpret 1 ARM instruction. Should be enough. Then all interfacing, caching, MMU and external RAM accessing can be done in another cogs.
  • jazzedjazzed Posts: 11,803
    edited 2014-12-26 13:11
    All propeller COGs run at 20 MHz (assuming 5MHz crystal) or 20 MIPS. Any propeller COG that executes instructions outside of a COG can at best fetch/execute at 5MIPS (without an overlay cache). For executing propeller instructions from a HUB cache managed by a second COG, the most throughput is about 1MIPS for XMMC (data in HUB ram) and far less for XMM (data in external memory) ... maybe 0.2 MIPS. Then there's overhead of decoding the machine instruction.

    There are an infinite number of better wonderful uses of one's time .... I'm learning "Linus and Lucy" on the piano.
Sign In or Register to comment.