Memory management in embedded Linux

Hello

I am little confused about the memory managent in Embedded Linux. My understanding is that, one of the properties of embedded OS it predictability. And the demand-paging/swapping is something that brings in un-predictability.

But in practical situations how is demand-paging handled in embedded linux ? Is it disabled? Are all the pages needed by a process loaded earlier itself??

Is MMU used in such embedded devices? Can we have a system where MMU is enabled but demand-paging/swapping is disabled ?

Just how does the whole thing work in embedded Linux system like a mobile phone????

thanx Vinay

Reply to
vinaynk
Loading thread data ...

"Embedded" just means that it's in a device that isn't a general-purpose computer (one that runs all sorts of different programs depending on what the user wants to do). An embedded comptuer has a "single" function and it runs a fixed set of SW.

Yes it does.

That depends on the device. Simpler devices that don't have MMUs, don't do demand paging.

Not usually -- unless you're talking about uCLinux, which doesn't have demand-paging.

If it has one it usually is used.

Sure. I don't know if Linux supports that particular situation.

You'll have to ask somebody who's used Linux in a mobile phone.

--
Grant Edwards                   grante             Yow!  I just remembered
                                  at               something about a TOAD!
                               visi.com
Reply to
Grant Edwards

Linux isn't an embedded OS.

I love questions like this.

Reply to
Geronimo W. Christ Esq

It can be (and is in millions of devices), but that wasn't it's orignal intent.

It's almost like asking what's the answer to the ultimate question of life, the universe, and everything. :)

--
Grant Edwards                   grante             Yow!  ... Blame it on the
                                  at               BOSSA NOVA!!!
                               visi.com
Reply to
Grant Edwards

Well Geronimo , If Linux isn't an embedded OS, then why so much hype about embedded Linux ?

I am stuck at this demand-paging/swapping issue in embedded linux!!!

Reply to
vinaynk

What do you mean you're "stuck at it"?

You can use uCLinux without VM, demand paging, or swapping.

You can use "regular" Linux with or without swapping.

I'm not sure if you can have VM without demand-paging, though.

--
Grant Edwards                   grante             Yow!  .. he dominates the
                                  at               DECADENT SUBWAY SCENE.
                               visi.com
Reply to
Grant Edwards

it's ... 42

:)

Reply to
Mile Blenton

Well...

So from the replies, it seems that in an embedded device we can have swapping enabled or disabled. Lets assume its enabled. In that case where would the swap partition reside??? A small device cannot have a hard disk for that purpose. That leaves some kind of flash device, which is much slower than a hard disk. So why at all enable swapping in an embedded device???

Can any one give an example of an embedded device where the swapping in embedded linux is enabled?

V> > >> Hello

Reply to
vinaynk

Why is it that a small device cannot have a hard disk?

But more important, if it doesn't have a device suitable for swap, why would it be enabled?

Well, why *are* you enabling it?

Any embedded device with a 10g or larger hard disk... :-)

An embedded system to control machinery, navigate a boat, fly an airplane, or play music in a car might fit that ticket, or might not.

Regardless, given the price of RAM these days, it doesn't make a lot of sense to design a system to *need* swap.

--
Floyd L. Davidson           
Ukpeagvik (Barrow, Alaska)                         floyd@apaflo.com
Reply to
Floyd L. Davidson

On a hard drive. Embedded devices can have hard drives.

Is an iPod small? It has a hard drive.

Unless it has a hard-drive, it's probaby not practical.

Something like a Tivo box or other Linux-based media players? My MythTV box is for all practical purposes an "ebedded" device, and it has 200GB of disk space and swap is enabled.

--
Grant Edwards                   grante             Yow!  Yow! I'm out of
                                  at               work...I could go into
                               visi.com            shock absorbers...or SCUBA
                                                   GEAR!!
Reply to
Grant Edwards

So from the discussions above it seems like an embedded device can have swapping enabled or disabled. Lets say its enabled. In that where would the swap partition reside? For a small device it can't be hard disk. so can it be some kind of flash device ? But that is too slow.

Can any body give me a practical example where the swapping is enabled for an embedded environment?

Reply to
vinaynk

Wow! Who knew that understanding how Linux works in a mobile phone is akin to understanding the "ultimate question of life". Ya learn a lot on Usenet.

Reply to
FLY135

Small devices should never swap. Under Linux, you simply configure no swap partitions.

Reply to
Geronimo W. Christ Esq

I'm being a bit nit-picky. Linux doesn't have fine-grained control over memory allocation and CPU scheduling in the way that other embedded OSs do.

I don't think you should worry about it.

Reply to
Geronimo W. Christ Esq

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.