Hi,
On Tue Mar 17, 2009 at 03:56:42 -0700, Alexander Valitov wrote:
I try to run l4con examples with grub script given in ./l4/pkg/l4con/doc/menu.lst (slightly modified/updated). The menu.lst starts con_demo1, con_demo2 and con_demo3. Boot process gives me this error:
#0d: loading "/boot/test/con_demo1" from [026ce000-0277262c] to [00800000-008250b5][00826000-0083d000] entry at 00068370 via trampoline page code symbols at [3a30e000-3a313000] (20kB), lines at [3a2fd000-3a30e000] (68kB) #0e: loading "/boot/test/con_demo2" from [02773000-02804e08] to [00800000-00815d11] Roottask: cannot load binary because address at 00800000 not free loaded module: [02773000-02804e08) /boot/test/con_demo2 overlaps with: [00800000-00826000) #0d con_demo1
I found that Makefile specifies DEFAULT_RELOC_x86 variable as: DEFAULT_RELOC_x86 = 0x00800000 As a result -Ttext=0x800000 option is added to 'ld' invocation options. I thought that is the root of problem and commented variable, but It didn't help. Build system started to use default DEFAULT_RELOC value 0x01000000 from ./l4/mk/binary.inc and roottask gives the same error with new 0x01000000 address.
Correct observation.
- I thought that DEFAULT_RELOC specifies virtual address not a physical
one. Am I right?
It's a virtual but it doesn't matter actually because programs started by roottask are started identity mapped.
- If answer to my first question is 'yes'. Why in this case roottask
relocates a code? It is strange as roottask operates with physical memory addresses.
What do you mean with relocate? roottask does not do any relocation of the binaries it loads.
- When am I supposed to specify DEFAULT_RELOC variable? In which situation?
All programs started by roottask directly need a unique area they run in. This is controlled by specifying a link-address, it's called RELOC in the Makefiles, and moreover DEFAULT_RELOC because one can overwrite with own settings using a STATIC file in pkg/.
- Why do we need the relocation performed by root task at all? Why can't we
just use appropriate mapping to addresses where GRUB loaded ELF modules? Each server starts in its own virtual address space, so I think it's possible. Why was it done that way? What is the problem with described approach (without relocation)?
This is the way roottask is doing things, it's not particular nice but keeps that paging logic rather simple (poor argument, you may state). Actually, that what you want is done by the loader, i.e. the loader can run programs linked to anywhere. So the recipe is to use the loader to start any program that does not need to be started by roottask directly.
- I've been playing around with L4Env,L4Linux and stuff for a while but
have never faced with mentioned problem. Are there anything special about the way how con_demo1,2,3 are built? I mean Root task relocates another modules to the next free 4K aligned address but con_demo1,2,3 modules to some exact address. Why does it happened?
All those programs are linked to a specific address which need to be distinct when run with other programs. If you look for a free area in what roottask dumps you can put your program in there and it should start. But as already said just use the loader to launch those and it should just work.
- There is ./l4/pkg/l4con/examples/Makeconf file with link addresses
specification. But according to "Building Infrastructure for DROPS (BID) Specification" only Makeconf.local file is included into generated Makefile from project directories. Why is it where?
Don't know it's not from me, looks like it's not used at all :)
Adam