Linux on an AVR microcontroller

Qubix

Feb 7, 2015
8
Joined
Feb 7, 2015
Messages
8
Ok ok, I know, people will start laughing and saying that a microcontroller does not have nearly enough memory to store even the linux bootloader, that it does not have a MMU, the architecture of the usual ATMega168 and 328 is only 8 bits, etc...

But, take a look at this:

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

and this

http://www.uclinux.org/index.html

So, even though it IS slow, and even though it obviously requires some peripherals (SD card, RAM memory), it is possible. Now I want to start a project to make one such barebones linux computer, just for fun and also to learn stuff. I've read the first link rather carefully and it seems he needed to write quite a bit of code (ARM emulator, among others).

1) If I were to use a 32 bit microcontroller, could I get away with just connecting it to some RAM and storage?
2) If I just use an ATMega328, does anyone know how I could write that emulator, or can I somehow make linux behave nicely on 8 bits?
3) Is there an 8 bit linux distro that could work directly with the ATMega168/328 ? (The uclinux seems not to support these).

Sorry if my enthusiasm seems foolish, I am rather new to this stuff and quite excited about such a project. :)
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
That is an incredibly impressive hack.
 

EK61

Jan 5, 2014
49
Joined
Jan 5, 2014
Messages
49
Once you get it actually functioning, it would be awesome to see an actual computer built like this. You could print the circuit and maybe even get some actual RAM slots for it.

If you could get a distro for it that would be awesome. Or could you get the right chip for uCl?

You must write a tutorial if you get this going! I would love to do this!
 

Qubix

Feb 7, 2015
8
Joined
Feb 7, 2015
Messages
8
Well, thanks a lot for the confidence vote :). However I am also quite new at this and it will probably take a lot of time to get it done (if I manage to get it done, that is.) I am currently reading as much as I can about microcontrollers and computer architecture, to get an idea of what I actually need to do.
If I manage to get this project done, then I will certainly make a tutorial for it and also provide all the code (if any).
In the mean time, suggestions, help in any way, resources (books, websites, youtube videos...) are more then welcome.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
It would be much easier to emulate a PDP-11 and bring up the original unix. I wonder if the source is available.

Given the simplicity (sorry elegance) of the PDP-11 architecture, and it being 16-bit and only a 64K memory limit, I think this could actually run at reasonable speed (possibly even at full speed) on a higher end 16-bit micro like PIC33.

In fact, I might have to build one of these. Complete with the data entry switches and data bus LEDs on the panel. This would be way cool.

Bob
 

EK61

Jan 5, 2014
49
Joined
Jan 5, 2014
Messages
49
It would be much easier to emulate a PDP-11 and bring up the original unix. I wonder if the source is available.

Given the simplicity (sorry elegance) of the PDP-11 architecture, and it being 16-bit and only a 64K memory limit, I think this could actually run at reasonable speed (possibly even at full speed) on a higher end 16-bit micro like PIC33.

In fact, I might have to build one of these. Complete with the data entry switches and data bus LEDs on the panel. This would be way cool.

Bob
Personally I see that as a bit of a separate project. Modernish OSes have been on 16-bit (Windows, Mac maybe?). But to get something like Linux on an 8-bit processor, well that would be special. The Unix PC from scratch idea sounds cool all the same though. No idea about Unix, but I know some/all MS-DOS versions are open source now apparently. But that probably doesn't help.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Yes, it is a separate project for sure. But, having been a Digital employee and used the PDP-11 for my work back in 1978, I have fond memories of it. It is a beautiful architecture. The instruction set is so simple, and the format so consistent, that one could actually interpret code when printed out in Octal format. One octal digit was the op code, one the source addressing mode, one the source register, another was the destination addressing mode and finally the destination register. And the high bit was 0 for word and 1 for byte.

Bob
 

EK61

Jan 5, 2014
49
Joined
Jan 5, 2014
Messages
49
Yes, it is a separate project for sure. But, having been a Digital employee and used the PDP-11 for my work back in 1978, I have fond memories of it. It is a beautiful architecture. The instruction set is so simple, and the format so consistent, that one could actually interpret code when printed out in Octal format. One octal digit was the op code, one the source addressing mode, one the source register, another was the destination addressing mode and finally the destination register. And the high bit was 0 for word and 1 for byte.

Bob
Wow, I never thought an instruction set could be that simple! Sounds ripe for projects.
 
Top