Jump to content


Linux on an 8-bit microcontroller


  • Please log in to reply
8 replies to this topic

#1 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 15,486 posts

Posted 28 March 2012 - 04:17 PM

I just ran across this neat article on how to run Linux on an 8bit microcontroller:


QUOTE
Linux on an 8-bit micro?

Intro

It is common to see newbies asking in microcontroller forums if they can run Linux on their puny little 8-bit micro. The results are usually laughter. It is also common to see, in Linux forums, asked what the minimum specs for Linux are. The common answer is that it requires a 32-bit architecture and an MMU and at least a megabyte of ram to fit the kernel. This project aims to (and succeeds in) shatter(ing) these notions. The board you see on the right is based on an ATmega1284p. I've made one with an ATmega644a as well, with equal success. This board features no other processor and boots Linux 2.6.34. In fact, it can even bring up a full Ubuntu stack, including (if you have the time) X and gnome....




http://dmitry.co/index.php?p=./04.Thoughts...nux%20on%208bit

I may have to try this one day cool.gif
Posted ImagePosted Image Posted Image
CNI Radio/Archlinux G+/Configs/PGP Key π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#2 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum MVP
  • 18,598 posts

Posted 28 March 2012 - 04:55 PM

What is that actual processor that he's using. I don't see where he says anywhere. sad.gif

Posted Image


#3 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 15,486 posts

Posted 28 March 2012 - 10:33 PM

QUOTE (V.T. Eric Layton @ Mar 28 2012, 03:55 PM) <{POST_SNAPBACK}>
What is that actual processor that he's using. I don't see where he says anywhere. sad.gif

QUOTE
CPU

All that's left is that pesky 32-bit CPU & MMU requirement. Well the AVR has no MMU and is 8-bit. To conquer this obstacle, I wrote an ARM emulator. ARM is the architecture I am most familiar with, and it's simple enough that I could comfortably write an emulator for it. Why write one instead of porting one? Well, porting someone else's code is no fun, plus none of the emulators I saw out there were written in a way that would make them easy to port to an 8-bit device. One of the factors: AVR compiler insists on making ints 16-bit so something as simple as "(1 << 20)" will get you in trouble, producing zero. Instead you need to do "(1UL << 20)". Needless to say trawling someone else's unknown codebase looking for all places where ints are assumed and would fail would be a disaster. Plus I wanted a chance to write a nice modular ARM emulator. So I did.

Posted ImagePosted Image Posted Image
CNI Radio/Archlinux G+/Configs/PGP Key π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#4 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum MVP
  • 18,598 posts

Posted 28 March 2012 - 10:42 PM

What is that 40 pin chip on that board?

Posted Image


#5 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 15,486 posts

Posted 28 March 2012 - 11:02 PM

QUOTE (V.T. Eric Layton @ Mar 28 2012, 09:42 PM) <{POST_SNAPBACK}>
What is that 40 pin chip on that board?

I am not for sure but here is more info on the microcontroller: http://www.atmel.com/devices/ATMEGA644A.aspx
Posted ImagePosted Image Posted Image
CNI Radio/Archlinux G+/Configs/PGP Key π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#6 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum MVP
  • 18,598 posts

Posted 29 March 2012 - 10:55 AM

Hmm... well, they're not giving a parts list anywhere in the documentation, which tells me that they want you to buy their kits. I was just wondering because I have some of these older CPUs, CMOS, and TTL type chips out in my shop. Once I inventory the carp out there, most of it will be going on eBay shortly. happy62.gif

Posted Image


#7 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 15,486 posts

Posted 29 March 2012 - 11:04 AM

QUOTE (V.T. Eric Layton @ Mar 29 2012, 09:55 AM) <{POST_SNAPBACK}>
Hmm... well, they're not giving a parts list anywhere in the documentation, which tells me that they want you to buy their kits. I was just wondering because I have some of these older CPUs, CMOS, and TTL type chips out in my shop. Once I inventory the carp out there, most of it will be going on eBay shortly. happy62.gif

Well after skimming the article, these are the specs:

QUOTE
A 1GB SD card works fine, though 512Mb would be enough for this particular file system (Ubuntu Jaunty).

ATmega1284p board http://www.atmel.com/products/microcontrol...vr/megaAVR.aspx
serial port for mouse/keyboard
CPU is emulated
QUOTE
First let's address the RAM. As you can see, there is an antique 30-pin SIMM memory module on the board. These were in use for 80286-based PCs. It is interfaced to the ATmega, and I wrote the code to access it as well as refresh it within spec (SDRAM requires constant refreshing to avoid losing data).

Posted ImagePosted Image Posted Image
CNI Radio/Archlinux G+/Configs/PGP Key π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#8 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 15,486 posts

Posted 29 March 2012 - 11:07 AM

He also provides the source code for the project:
QUOTE
It is a bit of a mess, but it does work. Get it while it's hot: LINK. The license is simple: For non-commercial use, as long as you keep the licence file with the source and publish all your changes, we're cool. For commercial use, talk to me, and we'll agree on something. To build the emulator to try it on the PC type "make". To run use "./uARM DISK_IMAGE". To build optimized PC version use "make BUILD=opt". to build for AVR use "make BUILD=avr". It currently targets ATmega1284p. To target ATmega644, besides the makefile change, reduce the numbers in icache.h so that the icache is small enough to fit in the internal RAM in the 644. Included in the archive is the final hex file for the 1284p as well.

Posted ImagePosted Image Posted Image
CNI Radio/Archlinux G+/Configs/PGP Key π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#9 OFFLINE   V.T. Eric Layton

V.T. Eric Layton

    Nocturnal Slacker

  • Forum MVP
  • 18,598 posts

Posted 29 March 2012 - 11:20 AM

No chip numbers, though. That's what I'm curious about.

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users