Page 1 of 1
Embedded OS (maybe)?
Posted: Sat Oct 25, 2008 11:38 pm
by TheDragon
Hello there. I was kicking some potentially revolutionary ideas around (
) when I got thinking about embedded programming. Is it possible to put an operating system on a microcontroller? Or is that cheating to design your own computer to go with your OS?
Re: Embedded OS (maybe)?
Posted: Sun Oct 26, 2008 5:17 am
by JackScott
Nope, that's basically what Nokia (and most other phone manufacturers) do. They write an OS (in Nokia's case, Symbian) made especially for their particular phone's architecture. Because they know exactly what features the computer (phone) will have, they can customise the OS in a way that desktop computer OS makers can't. Even Apple, with their 'closed' hardware, still have to write drivers for USB, PCI etc. and all the things that can attach to those busses.
The biggest problem with embedded development as opposed to desktop development is the lack of space. On your average microcontroller, you only have a few hundreds of kilobytes of primary storage to play with (unless you get a very large one). You can hook additional storage onto the I/O pins, but in a few hundred kB you won't even have space for GRUB,
Other than that, it is basically the same process. Research microcontrollers, buy one that looks good to program for (Atmel AVRs and Microchip PICs are fairly dominant in the hobbyist market at the moment). You can buy programmers, or simply use a parallel port and a few bits of wire to upload programs to the device. It'll also mean getting into circuit design as well.
Re: Embedded OS (maybe)?
Posted: Sun Oct 26, 2008 9:32 am
by Walling
If you want a cheap Atmel ATmega development board, here's one:
Arduino. It have its own IDE, but I think it just use GCC behind-the-scenes, so you can go with assembly or C directly. One of my friends used it for motor control in some artistic sculpture of an alive human brain.
I don't know if ARM is considered a microprocessor, but I played a lot with LEGO Mindstorms NXT. I like robots
It has a 32-bit ARM7 processor running at 400 MHz IIRC and a AVR co-processor for motor control. LEGO ships its own OS, but if you really want to do some exciting stuff with it you need to download a 3rdparty OS or create your own. There's a toolkit to help you with the most basic initialization. Most 3rdparty OS focus on enabling some programming language, e.g. Lejos enables you to run Java-programs on it.
The good thing about Arduino and NXT is that they are open source. You can download all hardware specs and software for them.
Re: Embedded OS (maybe)?
Posted: Sun Oct 26, 2008 5:49 pm
by Owen
A few things to be aware of
1) Most 8-bit (AVR, PIC, MC68HC08, MCS08, H8, R8, 8051, etc.. you get the picture) microcontrollers are havaard architecture. In other words, your code is stored in flash and often not writable (Not that this is practical as there generally only a small ammount of flash, and flash has limited write cycles), and you can't execute from RAM
2) Theyre 8-bit, and have tiny RAM and no expansion
3) 32-bitters such as the ARMs are fun to play with. The ones with external busses (The useful ones for OS dev
) generally come in 128-pin plus packages. Routing address and data busses on a PCB is a pain, particularly when therye 32-bit address, 32-bit data, and about 8 control lines.
4) Many microcontrollers have very funky architectures. ARM, MIPS, and ColdFire are quite clean. In 8-bit land, the AVR is quite clean. The 8-bit PICs have just one register. The 8051s have three address spaces. The MC68HC08/MCS08s are basically cut down 6800s.
5) The PIC32s could be interesting, if they replaced the "Parallell Master Port" with a propper external bus
6) Programming hardware can be expensive. PIC programmers start at $35 for a good one (And the bad ones are very ugly hacks that can't program the better devices). AVR programmers start at slightly more than that. ARM and MIPS are generally both programmed via JTAG, which starts at about $10 for a parallel port dongle and can go up to very high prices. Cheap JTAG tends not to be an ugly hack, but does tend to be slow.
7) Most microcontrollers have no MMU. None of the 8-bits do, and you only start seeing them about ARM9 range
Re: Embedded OS (maybe)?
Posted: Mon Oct 27, 2008 2:59 am
by AJ
Hi,
I agree with the above except:
Owen wrote:PIC programmers start at $35...AVR programmers start at slightly more than that.
AVR's have ISP ports and the hardware to program via ISP is extremely simple. I would certainly agree that the facility to execute code purely from the internal flash is very limiting. Some of the AVR devices do have a boot loader facility but this merely consists of a "safe" part of flash that can be used to program the rest of the flash.
Cheers,
Adam
Re: Embedded OS (maybe)?
Posted: Mon Oct 27, 2008 4:18 am
by Owen
I do quite a bit of embedded (OS-less
) work on the small PICs, using one of Microchip's $35 PICKit2s. It only does In Circuit Serial Programming (ICSP), but the nice feature is that you can use it to debug from MPLAB for many of the smaller PICs (And the range of debuggable PICs is increasing).
Also, theres a program for Linux which can control it
(I must say it's weird to see it listed as a "Human Interface Device" in the Windows device manager though
)
The PICs have the same bootloader setup.
Re: Embedded OS (maybe)?
Posted: Mon Oct 27, 2008 4:34 am
by Velko
Re: Embedded OS (maybe)?
Posted: Fri Nov 07, 2008 2:33 pm
by rdos
You can also make embedded OSes on the PC-platform. Often, the OSes used here are scaled-down versions of Windows (CE or XP) or special Linux-distributions. Neither of these solutions are optimal. Windows CE, for instance, is a really buggy thing that takes hours to build and in the end it cannot even run standard Win32 applications. Linux seems to take almost forever (in this context) to boot, and requires lots of storage. RDOS, OTOH, usually boots in a second, can be customized with a simple cfg-file, doesn't need any compiling or linking to build and only takes 1-2 MB for the kernel, command shell and FTP-server. It can run on 4MB RAM, diskless, keyboard-less, mouse-less and monitor-less systems. Deploying is really simple. All you need is one binary file that contains everything. Using a compact-flash is probably the best, since it will not rely on mechanical components like harddiscs do.
I've even run RDOS on a diskless system with a 386-based processor with 4 MB RAM, and with the OS and application in two 1MB Flash chips (AM29F040). Usually, only tiny-DOS based systems can be used on this platform, and not 32-bit protected mode OSes with multitasking capabilities.
Re: Embedded OS (maybe)?
Posted: Wed Nov 19, 2008 6:42 am
by osnewbie
you can also take a look to uclinux, which is a linux based embedded OS for microcontrollers. It has been ported to lots of common microcontroller platforms. Most favorite one is ARM7TDMI based one I think, cause ARM is most common embedded microcontroller.
Good thing about this OS is it is coming with gnu toolchain, so once you install this OS to your embedded system you are ready to develop any kind of applications on it. Also it is opensource, you can modify the OS as you wish.
Re: Embedded OS (maybe)?
Posted: Sun Feb 15, 2009 9:47 am
by demirtos
Yes it may be.
The main task of such OS is to do multithreading enviroment and give a good support of thread priorities.
I am writing such OS now.