Linux challenge.
BradC
Posts: 2,601
This has come from the Catalina thread.. I thought I'd start a new one rather than continue it there.
Not only do I super double dare you, but I'll personally donate $1000 USD worth of Parallax credit to the first person who gets Linux running on a Propeller based XMM board that I can buy either off the shelf or from a forum member for less than $200USD.
To keep it simple, the only requirements are
- A tty (serial port will suffice)
- MMC/SD block device containing a standard Linux filesystem of your choice (personally I'd choose minix/ext2 as they are the easiest. FAT does not qualify as it misses out on all the POSIX attributes.
- BASH must run compiled and unmodified from source (no port IO hacks or anything of that nature)
- BASH must be able to spawn sub-processes (fork/vfork)
- The code must be running on the bare propeller. No emulating another processor (MIPS for example).
This means you will have to define a new architecture in the kernel :
.. and have it build for the native Propeller.
I want to see the kernel boot over a serial port and be dropped to a BASH prompt. I must be able to run text BASH scripts from the SD card and spawn child processes.
This is what I would consider a completely minimalist Linux system.
To qualify this a little, I have absolutely no interest or use for such a system, but for 2 years now people have been banging on about self-hosting systems, *nix on the prop and so forth, so this challenge is a bit of a PUOSU, but with a small financial incentive.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
RossH said...
Careful - if you make it sound too challenging then someone is bound to do it just to prove you wrong
It wouldn't be any sillier than some of the other crazy things we do in this forum.
Not only do I super double dare you, but I'll personally donate $1000 USD worth of Parallax credit to the first person who gets Linux running on a Propeller based XMM board that I can buy either off the shelf or from a forum member for less than $200USD.
To keep it simple, the only requirements are
- A tty (serial port will suffice)
- MMC/SD block device containing a standard Linux filesystem of your choice (personally I'd choose minix/ext2 as they are the easiest. FAT does not qualify as it misses out on all the POSIX attributes.
- BASH must run compiled and unmodified from source (no port IO hacks or anything of that nature)
- BASH must be able to spawn sub-processes (fork/vfork)
- The code must be running on the bare propeller. No emulating another processor (MIPS for example).
This means you will have to define a new architecture in the kernel :
brad@bklaptop2:/tracks/linux2/arch$ ls alpha blackfin h8300 Kconfig m68knommu mn10300 s390 um arm cris i386 m32r microblaze parisc sh x86 avr32 frv ia64 m68k mips powerpc sparc xtensa
.. and have it build for the native Propeller.
I want to see the kernel boot over a serial port and be dropped to a BASH prompt. I must be able to run text BASH scripts from the SD card and spawn child processes.
This is what I would consider a completely minimalist Linux system.
To qualify this a little, I have absolutely no interest or use for such a system, but for 2 years now people have been banging on about self-hosting systems, *nix on the prop and so forth, so this challenge is a bit of a PUOSU, but with a small financial incentive.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
Comments
I admire a man who has the courage of his convictions!
For myself, I'd never bet money against the Prop (or the people in this forum) being able to do something
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
BradC, you're going to have to serve as judge here, in case anybody comes up with anything. As Jazzed pointed out, I can't even escape Windows (though I'm capable of throwing the PC through the window and running it over with a tractor).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
Pitty I know nothing about unix of any flavor - I wrote mini emulation on a 486 33MHz (written in 486 asm) and ran under unix (possibly SCO?). A friend helped me launch the program on unix. I thought the disk was FAT16 though???
BTW Chip: It's not your pc you want to throw thru' the window, it's the o/s. LOL
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
BradC, for standard Linux one needs 4MB just for the kernel and 8MB to do anything useful. Now that is possible with two Propellers, but building Linux requires a GNU compatible tool chain. ICC is nice, but it dang sure ain't GNU .... The C99 extensions are not likely to appear overnight in any LCC based tool chain, but that's the minimum of what it would take. I guess running bash as slow as molasses does not disqualify the solution [noparse]:)[/noparse]
Jazzed, I well know all the roadblocks currently preventing from this happening. I actually feel my cash is fairly safe.
I was actually about to post a qualification about speed. It's irrelevant. I don't care if it takes 5 minutes to boot the kernel and 10 seconds to display a directory listing. As long as it runs properly.
There are two issues I see as the main hurdles. Firstly your toolchain needs the GNU extensions. Secondly you need to be familiar enough with the internals of the kernel to be able to actually define a new architecture and write enough basic drivers for it to make it boogie as described in the top post.
I didn't make this challenge lightly, and as it currently has no limits, I feel I should impose some.
This challenge is valid until 6th Dec, 2011 and only on the Propeller-I (although you may use more of them if you need to).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
From the intro:
"ELKS currently runs on IBM Personal Computer compatible systems. On this architecture, the ELKS kernel image needs about 200K, and a full running system should require between 400K and 512K of RAM."
So:
RAM no problem.
Disk driver is probably straight forward to hack for SD card access.
Serial driver for the console should be easy.
Virtual memory not required. The 8086 IBM PC does not support it.
I think I read somewhere that this did actually compile with other than GNU tools. Can't find where I read that now.
The ELKS project does not seem to have been active since 2006 but it looks like it does work.
Starts to look possible...
Brad, What's with the "BASH ... from unmodified sources" requirement? That seems a bit of a heavy and unnecessary requirement for a small embedded system. There are many shells to choose from.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Post Edited (heater) : 12/6/2009 10:32:12 AM GMT
FYI here's some info to run Linux in 1 MB from Flash memory sites.google.com/site/bifferboard/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Runs on my MIPS router and my Arm iPAQ. As far as I'm concerned that is a good indicator of a reasonably complete, POSIX compliant system.
The challenge is for Linux or uCLinux. If you properly implement either of those with the right toolchain, you get BASH for free. ELKS is not Linux.
I used to do it on a single disk often, tomsrtbt still does. I only own two machines with floppy drives these days, and that's only because my day to day jukebox machine can't boot off USB or CD.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
I ran Linux startup from 1.44MB floppy ... 10 years ago. I'd bet that was compressed.
Isn't it?
If it's derived from an original Linux source tree then surely it is Linux as much as uCLinux or what ever RedHat gives you.
Or is the rule that we have to start from a source tree directly from Mr Torvalds himself?
Time to peek into the ELKS sources and check ...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
No, it's not.
It's not.
Any 2.6 series kernel would qualify, given it has been available for about the last 5 years, or whatever is current in the next 2 I guess. Source from www.kernel.org.
ELKS was a ground up project with enough parts of an early Linux kernel grafted on to enable userspace code to be roughly source compatible with real Linux. It's a hack. A clever hack, but a hack. It's not Linux.
If you get the toolchain working, uCLinux will run comfortably on small memory, MMU-less systems.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
who starts porting gcc to the prop then ?
The real problem is that the nice trick:
gets more complicated and slow because the address has to be split in two parts to always have a condition false... maybe 2 ljmp routines one for lager addresses and one for shorter could be used...
from this:
instead of
and for lcall and so on...
Edit:
Scratch part of what I said.
Relative jumps could be used till +/- 2Megainstructions. Short jumps +/-128 instructions modifying the krnl_PC directly... and a couple more tricks. All will depend on how fast the XMM is and so on... well it may be doable just for the fun of it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
Post Edited (Ale) : 12/6/2009 2:28:55 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Would that not be a lot smaller/simpler?
Is it disqualified?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Did they come as a complete distribution then? I still have the 400MB SCSI drive, but no pc old enough to run it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
I think that's kinda drawing a pretty long bow. 2.6 has been current since 2004, let's not go back any further than that 'eh ?
If I thought it was easy I'd not have put my own money on the line.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you always do what you always did, you always get what you always got.
The problem is to get gcc up and running. Porting Linux (uCLinux) is not that difficult after that. It will have to run under a XMM kernel so everything could be possible...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
I guess you've had a little quality time with GCC source by now. What are the chances?
I've looked at this before and it's a little *deep* for me [noparse]:)[/noparse] Makes one yearn for simple things.
we need: gas, ld, libbfd and gcc. It is not only gcc and it depends on binutils. I never ported gcc or binutils so I really do not know how much work it is. It may not be a bad idea to make a team to attack the problem. The code can be compiled with Bill's LAS or my own compiler till gcc produces something usable, meanwhile binutils can also be ported.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
As I've said all along. And that problem is way out of my league.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Sorry if this has been posted before, but I found a nice article on the C language "extensions" that GCC implements which are required to build Linux here.
This makes it clear (in case Brad's posts were not clear enough) that you can't really expect to build Linux (at least as Brad has defined it) with anything other than GCC. Although some progress has apparently been made with "clang" (see here), I don't think this is a real alternative yet.
As Ale, heater and others have already pointed out, this means that the first step in the process is to add a new target architecture to GCC so that it can act as a cross compiler.
However, the "bare metal" architecture of the Prop is completely unsuitable for running Linux. A the very least, Linux will require an LMM kernel architecture. But an LMM kernel on the Prop can still only address 32Kb, so it really needs to be an XMM kernel - so the zeroth step is to identify, define or develop the XMM kernel you intend to use. Without knowing your target architecture, you can't begin any sensible work on the GCC code generator (which is the main bit you will have to write by hand from scratch).
I muddled my way through this step-by-step on Catalina, which now has a multiplatform XMM kernel which is suitable (although by no means ideal) for use as the target of a C compiler. There may be other XMM kernels under development that are also suitable, but I'm not aware of any others actually being available or in use just yet. So if anyone is seriously intending to attempt this challenge, I would advise them to either use the Catalina XMM kernel, or at the very least take a have a look at it before designing your own (at least this way you'll know what you're in for before you start).
Ross.
P.S. A note on memory size: Based on experience with Catalina, when using LMM/XMM on the Prop you can pretty much expect to double or possibly even quadruple the memory size over and above what might expect on an Intel architecture. So if Linux takes 1Mb on Intel, expect it to take between 2 and 4 Mb on the Prop. If I were doing this challenge I would probably start with a platform that had at least 8Mb (to allow for what will undoubtedly be initially a sub-optimal code generator).
P.P.S. Brad, I think your money is safe for a while yet
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Because I don't trust huge programs that apparently do next to nothing several billion times a second, having at one time or another written similar, even GUI, functions in a few lines of BASIC, nor those that can't be a whole app in one executable file.
Puppy linux and KILL BILL and SLAX are some I can remember that fit on tiny business card CDs and did more than Windows WITHOUT EVEN PUTTING A HARD DRIVE IN THE MACHINE.
Those "business card" CDs can still contain about 65Mb.
The average size of a 2.6 kernel is reportedly about 1.5Mb. There are reports of 2.6 kernel sizes down to about 600k (e.g. here) provided you remove various features such as USB support, SCSI support etc - but no Linux kernel size has ever been anywhere near 64k.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Composite NTSC sprite driver: Forum
NTSC & PAL driver templates: ObEx Forum
OnePinTVText driver: ObEx Forum
Limited, yes - and also slooooow - but fully functional. I'm assuming the purpose of doing this is simply to meet the challenge, since the ultimate usefulness of it is (to say the least) a bit questionable
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
I do not believe it's just to meet the challenge, as I think it could be really useful as a mini o/s. The ethernet module that was pointed out recently has a mini *nix running on it. I don't believe it will be sooo slooow on a prop. Remember, it used to run on slow intel processors amny moons ago. It is just that now people are after graphics. Ditch that and it's fine.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Yes, I'd kind of assumed it would only be feasible at all if you can use multiple Props.
As to its eventual usability - well, I can see Linux on the Prop II being fast enough to be useful (maybe) - but considering the overheads of LMM and XMM I just don't think the Prop I has enough processing power or internal RAM.
So much so that I'm tempted to offer a subsidiary challenge to Brad's - i.e. a free copy of Catalina if you can complete a "cd /" command (i.e. list the files in the root directory, which normally doesn't have much in it) typed into a bash shell within 10 minutes of doing a cold boot of Linux
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
I am only after speeds equivalent to the old pcs, and functions of the old pcs. I am NOT after a full-blown *nix system, just a basic *nix o/s. I think that is where the confusion is setting in.
The moment we get into multiplexing the address or data pins, extra instructions slow the sram access down dramatically. It will be far more evident in a native XMM environment than currently on the ZiCog interpreter. This is my opinion and others will disagree. Unfortunately, everything is a compromise.
So my minimum hardware specifications would be
Have I said before, it is not for the $, so I am not interested in the restrictions of what constitutes a valid *nix platform.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Post Edited (Cluso99) : 12/7/2009 4:15:37 AM GMT