2009/3/27 Mike Frysinger <[email protected]>:
> On Friday 27 March 2009 12:15:57 Lennart Sorensen wrote:
>> You also get fork(). That's a big deal to a lot of code. Fork requires
>> being able to copy an address space (preferably efficiently), which an
>> MMU can help you do. It might be possible to do without an MMU, but I
>> am not sure, since I have never seen anyone do so.
>
> you cannot do fork() without virtual memory since both processes will have
> pointers to the same addresses and there's no way to relocate them.
In theory, you should be able to handle that without an MMU.
You do have to modify the compiler.
- Make sure all (data) memory accesses are done relative to a base register.
Each process has a different value in its base register.
- All jumps must be PC-relative.
- A single stack for return addresses and variables doesn't work, as you need
to distinguish between absolute return addresses and variables (pointers are
relative to the base register).
So you need to use the standard stack for subroutine return adresses only,
and sacrifice a second register for a data stack pointer.
This should allow you to swap processes in and out, too.
I thought about it since I first heard about uClinux (hmm, Palmpilot), but never
found time to implement it...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev