Hi, I want to replace the standard Linux kernel on my Ubuntu Distro (12.04LTS) with the L4Linux kernel. Is this possible? If yes can someone give me an outline as to how to proceed?
Hi,
On Sun, Mar 30, 2014 at 04:06:18PM +0530, Sai Prajeeth wrote:
Hi, I want to replace the standard Linux kernel on my Ubuntu Distro (12.04LTS) with the L4Linux kernel. Is this possible? If yes can someone give me an outline as to how to proceed?
This is possible, but probably not exactly the way you imagine. L4Linux is a userspace port of the Linux kernel to the microkernel API of Fiasco.OC. So you will also need the microkernel and L4Re as the basic runtime environment. You can learn more about L4Linux and its concepts at [1].
Matthias.
[1] http://l4linux.org/overview.shtml
hello l4 hackers, I'm trying to do the same procedure than alexis, run the hello example for arm plataform, I compile the fiasco.oc and l4re for arm realview. when I type make qemu E=hello, the result is this:
/l4re-snapshot-2014022815/obj/l4/arm-arm9$ make qemu E=hello make[1]: se ingresa al directorio «/home/waldo/l4re-snapshot-2014022815/src/l4» ... Building .general.d ... Building Makefile.inc Building entry "hello". Merging image /home/waldo/l4re-snapshot-2014022815/obj/fiasco/arm-up-rv-9/fiasco to mod00 [342kB] Merging image /home/waldo/l4re-snapshot-2014022815/obj/l4/arm-arm9/bin/arm_armv5te/l4f/sigma0 to mod01 [343kB] Merging image /home/waldo/l4re-snapshot-2014022815/obj/l4/arm-arm9/bin/arm_armv5te/l4f/moe to mod02 [2433kB] Merging image /home/waldo/l4re-snapshot-2014022815/obj/l4/arm-arm9/bin/arm_armv5te/l4f/l4re to mod03 [1262kB] Merging image /home/waldo/l4re-snapshot-2014022815/obj/l4/arm-arm9/bin/arm_armv5te/l4f/hello to mod04 [925kB] ... Generating bootstrap.ld ... Compiling exec.o ... Compiling module.o ... Compiling ARCH-arm/crt0.o ... Compiling region.o ... Compiling startup.o ... Compiling init_kip_v2.o ... Compiling init_kip_v4.o ... Compiling libc_support+.o ... Compiling patch.o ... Compiling koptions.o ... Compiling platform/rv.o ... Compiling loader_mbi.o ... Compiling ARCH-arm/reboot.o ==> Linking bootstrap.elf ==> Post-processing bootstrap.elf ==> "bootstrap.elf" built ==> Installing bootstrap.elf in image directory ==> Installing bootstrap_hello in image directory ==> Installing bootstrap_hello.elf in image directory Image size(s) in bytes: bootstrap_hello.elf: 971416 Start address: 0x1000000 --> Build-Nr: 8 ==> Installing bootstrap.elf to local build-tree ==> Installing bootstrap_hello to local build-tree ==> Installing bootstrap_hello.elf to local build-tree QEmu-cmd: qemu-system-arm -kernel /home/waldo/l4re-snapshot-2014022815/obj/l4/arm-arm9/images/bootstrap.elf -M realview-eb -m 256 -serial stdio oss: Could not initialize DAC oss: Failed to open `/dev/dsp' oss: Reason: No such file or directory oss: Could not initialize DAC oss: Failed to open `/dev/dsp' oss: Reason: No such file or directory audio: Failed to create voice `lm4549.out'
L4 Bootstrapper Build: #8 lun mar 31 22:18:09 CDT 2014, 4.6.3 Scanning up to 256 MB RAM Memory size is 256MB (00000000 - 0fffffff) RAM: 0000000000000000 - 000000000fffffff: 262144kB Total RAM: 256MB mod04: 010cb000-010e457c: hello mod03: 010b1000-010ca45c: l4re mod02: 01077000-010b0628: moe mod01: 0106d000-01076374: sigma0 mod00: 01017000-0106c4d4: fiasco Moving up to 5 modules behind 1100000 moving module 00 { 1017000-106c4d3 } -> { 11ce000-12234d3 } [349396] moving module 03 { 10b1000-10ca45b } -> { 1100000-111945b } [103516] moving module 04 { 10cb000-10e457b } -> { 1100000-111957b } [103804] make[1]: se sale del directorio «/home/waldo/l4re-snapshot-2014022815/src/l4»
I'm using the l4re-snapshot-2014022815 version, code sourcery 2012-03 cross-compiler , and qemu 1.6.1.
Hi, The problem remains. Waldo execute the procedure and the result is the same: El 31/03/14 22:30, Waldo escribió:
L4 Bootstrapper Build: #8 lun mar 31 22:18:09 CDT 2014, 4.6.3 Scanning up to 256 MB RAM Memory size is 256MB (00000000 - 0fffffff) RAM: 0000000000000000 - 000000000fffffff: 262144kB Total RAM: 256MB mod04: 010cb000-010e457c: hello mod03: 010b1000-010ca45c: l4re mod02: 01077000-010b0628: moe mod01: 0106d000-01076374: sigma0 mod00: 01017000-0106c4d4: fiasco Moving up to 5 modules behind 1100000 moving module 00 { 1017000-106c4d3 } -> { 11ce000-12234d3 } [349396] moving module 03 { 10b1000-10ca45b } -> { 1100000-111945b } [103516] moving module 04 { 10cb000-10e457b } -> { 1100000-111957b } [103804] make[1]: se sale del directorio «/home/waldo/l4re-snapshot-2014022815/src/l4»
Bootstrap is not moving modules 1 and 2.
Regards.
Alexis.
On Mon Mar 31, 2014 at 22:30:42 -0400, Waldo wrote:
hello l4 hackers, I'm trying to do the same procedure than alexis, run the hello example for arm plataform, I compile the fiasco.oc and l4re for arm realview. when I type make qemu E=hello, the result is this:
QEmu-cmd: qemu-system-arm -kernel /home/waldo/l4re-snapshot-2014022815/obj/l4/arm-arm9/images/bootstrap.elf -M realview-eb -m 256 -serial stdio L4 Bootstrapper Build: #8 lun mar 31 22:18:09 CDT 2014, 4.6.3 Scanning up to 256 MB RAM Memory size is 256MB (00000000 - 0fffffff) RAM: 0000000000000000 - 000000000fffffff: 262144kB Total RAM: 256MB mod04: 010cb000-010e457c: hello mod03: 010b1000-010ca45c: l4re mod02: 01077000-010b0628: moe mod01: 0106d000-01076374: sigma0 mod00: 01017000-0106c4d4: fiasco Moving up to 5 modules behind 1100000 moving module 00 { 1017000-106c4d3 } -> { 11ce000-12234d3 } [349396] moving module 03 { 10b1000-10ca45b } -> { 1100000-111945b } [103516] moving module 04 { 10cb000-10e457b } -> { 1100000-111957b } [103804] make[1]: se sale del directorio
So this should look like this:
mod04: 010e2000-010fb610: hello mod03: 010c0000-010e14f8: l4re mod02: 0107e000-010bf6c8: moe mod01: 01074000-0107d3d8: sigma0 mod00: 01015000-01073124: fiasco Moving up to 5 modules behind 1100000 moving module 00 { 1015000-1073123 } -> { 11e7000-1245123 } [385316] moving module 01 { 1074000-107d3d7 } -> { 1246000-124f3d7 } [37848] moving module 02 { 107e000-10bf6c7 } -> { 1250000-12916c7 } [267976] moving module 03 { 10c0000-10e14f7 } -> { 1100000-11214f7 } [136440] moving module 04 { 10e2000-10fb60f } -> { 1122000-113b60f } [103952] Scanning fiasco -serial_esc Scanning sigma0 Scanning moe --init=rom/hello Relocated mbi to [0x100e000-0x100e0fa] Loading fiasco Loading sigma0 ....
So in your case module 1 and 2 are not there, and more interestingly, 4 is copied over 3, which does not seem to be a good idea to me. This needs some debugging. Could you please turn on the Verbose_load setting in pkg/bootstrap/server/src/startup.cc and rerun?
Adam
Hello, El 31/03/14 18:19, Adam Lackorzynski escribió:
So in your case module 1 and 2 are not there, and more interestingly, 4 is copied over 3, which does not seem to be a good idea to me. This needs some debugging. Could you please turn on the Verbose_load setting in pkg/bootstrap/server/src/startup.cc and rerun?
Adam
afmoya@uclv-far-15:~/l4re-snapshot-2014022815/obj/l4/arm-ca$ make qemu E=hello
make[1]: se ingresa al directorio «/home/afmoya/l4re-snapshot-2014022815/src/l4»
Image size(s) in bytes:
bootstrap_hello.elf: 1041052
Start address: 0x61000000
--> Build-Nr: 5
QEmu-cmd: qemu-system-arm -kernel /home/afmoya/l4re-snapshot-2014022815/obj/l4/arm-ca/images/bootstrap.elf -M vexpress-a9 -cpu cortex-a9 -m 256 -smp 2 -serial stdio
oss: Could not initialize DAC
oss: Failed to open `/dev/dsp'
oss: Reason: No such file or directory
oss: Could not initialize DAC
oss: Failed to open `/dev/dsp'
oss: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
L4 Bootstrapper
Build: #5 mar abr 1 09:33:36 CDT 2014, 4.6.3
Scanning up to 256 MB RAM
Memory size is 256MB (60000000 - 6fffffff)
RAM: 0000000060000000 - 000000006fffffff: 262144kB
Total RAM: 256MB
mod04: 610dc000-610f5580: hello
mod03: 610c2000-610db460: l4re
mod02: 61088000-610c162c: moe
mod01: 6107e000-61087378: sigma0
mod00: 61017000-6107d43c: fiasco
Moving up to 5 modules behind 61100000
moving module 00 { 61017000, 6107d43b } (ELF) -> { 611df000 - 6124543b } [418876]
464c457f 00010101 00000000 00000000 00280002 00000001 60001314 00000034
0006620c 05000002 00200034 00280006 000d000e 70000001 00063c20 f0063c20
60063c20 00000028 00000028 00000004 00000004 00000001 000000f4 60001000
60001000 00000480 00000c80 00000007 00000004 00000001 00002000 f0002000
60002000 00061c48 0006e000 00000007 00004000 00000001 00063c50 ffff0000
60070000 00000500 00000500 00000005 00000010 00000001 00064150 f0071000
60071000 00002000 00002000 00000007 00000004 6474e551 00000000 00000000
00000000 00000000 00000000 00000007 00000004 e303cc09 e92d4ff0 e347c000
moving module 03 { 610c2000, 610db45f } (ELF) -> { 61100000 - 6111945f } [103520]
464c457f 00010101 00000000 00000000 00280002 00000001 b00001a4 00000034
000191e0 05000002 00200034 00280006 000f0010 70000001 00014874 b0014874
b0014874 00000808 00000808 00000004 00000004 00000006 00000034 b0000034
b0000034 000000c0 000000c0 00000004 00000004 00000001 00000000 b0000000
b0000000 00015080 00015080 00000005 00008000 00000001 00018000 b0018000
b0018000 000010c4 0000236c 00000006 00008000 00000007 00000000 00000000
00000000 00000000 00000000 00000000 00000004 60000014 00012a40 b0012a40
b0012a40 00000018 00000018 00000004 00000004 00000000 00000000 00000000
moving module 04 { 610dc000, 610f557f } (ELF) -> { 61100000 - 6111957f } [103808]
464c457f 00010101 00000000 00000000 00280002 00000001 010001a4 00000034
000192d8 05000002 00200034 00280006 00100011 70000001 00015504 01015504
01015504 00000ae0 00000ae0 00000004 00000004 00000006 00000034 01000034
01000034 000000c0 000000c0 00000004 00000004 00000001 00000000 01000000
01000000 00015fe8 00015fe8 00000005 00008000 00000001 00018000 01018000
01018000 000011b4 0000734c 00000006 00008000 00000007 00018000 01018000
01018000 00000000 00000014 00000006 00000004 60000014 00013640 01013640
01013640 0000000c 0000000c 00000004 00000004 00000000 00000000 00000000
Compactifying
That was the result. Thank you for your time. Regards, Alexis.
Hi Adam, I execute all the steps, configuring and building foc an l4 individually for realview-pbx-a9.
// create foc builddir, configure and build
cd ~/l4re-snapshot-2014022815/src/kernel/fiasco/
make BUILDDIR=~/build/foc.realview
cd ~/build/foc.realview
make config
* Target configuration
? ? Architecture (ARM processor family) --->
? ? Platform (ARM RealView Platform) --->
? ? Realview Platform (PBX) --->
? ? Start of RAM (physical address) (0x00000000) --->
? ? CPU (ARM Cortex-A9 CPU) --->
? ? [ ] Enable alignment check
? ? Execution Model (Standard mode) --->
* The other options by default.
make -j2 all SYSTEM_TARGET=/usr/local/arm-2012.03/bin/arm-none-linux-gnueabi-
* Build successfull
// create l4 builddir, configure and build
cd ~/l4re-snapshot-2014022815/src/l4
make B=~/build/l4.realview
cd ~/build/l4.realview
make config SYSTEM_TARGET=/usr/local/arm-2012.03/bin/arm-none-linux-gnueabi-
? ? Target Architecture (ARM architecture) --->
? ? CPU variant (ARMv7A type CPU) --->
? ? Platform Selection (ARM Realview PBX) --->
? ? Building --->
make -j2 all SYSTEM_TARGET=/usr/local/arm-2012.03/bin/arm-none-linux-gnueabi-
* Build successfull
// build and execute hello program in qemu for the realview-pbx-a9 platform
make qemu E=hello QEMU_OPTIONS="-M realview-pbx-a9 -m 256 -serial stdio -nographic" MODULE_SEARCH_PATH=~/build/foc.realview SYSTEM_TARGET=/usr/local/arm-2012.03/bin/arm-none-linux-gnueabi-
make[1]: se ingresa al directorio «/home/afmoya/l4re-snapshot-2014022815/src/l4»
Image size(s) in bytes:
bootstrap_hello.elf: 975516
Start address: 0x71000000
--> Build-Nr: 2
QEmu-cmd: qemu-system-arm -kernel /home/afmoya/build/l4.realview/images/bootstrap.elf -M realview-pbx-a9 -m 256 -serial stdio -nographic
QEMU 1.6.1 monitor - type 'help' for more information
(qemu) oss: Could not initialize DAC
oss: Failed to open `/dev/dsp'
oss: Reason: No such file or directory
oss: Could not initialize DAC
oss: Failed to open `/dev/dsp'
oss: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
L4 Bootstrapper
Build: #2 mar abr 1 10:07:26 CDT 2014, 4.6.3
Scanning up to 256 MB RAM
Memory size is 256MB (70000000 - 7fffffff)
RAM: 0000000070000000 - 000000007fffffff: 262144kB
Total RAM: 256MB
mod04: 710cc000-710e5580: hello
mod03: 710b2000-710cb460: l4re
mod02: 71078000-710b162c: moe
mod01: 7106e000-71077378: sigma0
mod00: 71017000-7106d6dc: fiasco
Moving up to 5 modules behind 71100000
moving module 00 { 71017000, 7106d6db } (?ELF) -> { 711cf000 - 712256db } [354012]
464c457f 00010101 00000000 00000000 00280002 00000001 00001244 00000034
000564d4 05000002 00200034 00280006 000c000d 70000001 00052ef0 f0052ef0
00052ef0 00000028 00000028 00000004 00000004 00000001 000000f4 00001000
00001000 000003c0 00000bc0 00000007 00000004 00000001 00002000 f0002000
00002000 00050f18 0005e000 00000007 00004000 00000001 00052f20 ffff0000
00060000 00000500 00000500 00000005 00000010 00000001 00053420 f0061000
00061000 00003000 00003000 00000007 00000004 6474e551 00000000 00000000
00000000 00000000 00000000 00000007 00000004 e3030c09 e92d4ff0 e3410000
moving module 03 { 710b2000, 710cb45f } (?ELF) -> { 71100000 - 7111945f } [103520]
464c457f 00010101 00000000 00000000 00280002 00000001 b00001a4 00000034
000191e0 05000002 00200034 00280006 000f0010 70000001 00014874 b0014874
b0014874 00000808 00000808 00000004 00000004 00000006 00000034 b0000034
b0000034 000000c0 000000c0 00000004 00000004 00000001 00000000 b0000000
b0000000 00015080 00015080 00000005 00008000 00000001 00018000 b0018000
b0018000 000010c4 0000236c 00000006 00008000 00000007 00000000 00000000
00000000 00000000 00000000 00000000 00000004 60000014 00012a40 b0012a40
b0012a40 00000018 00000018 00000004 00000004 00000000 00000000 00000000
moving module 04 { 710cc000, 710e557f } (?ELF) -> { 71100000 - 7111957f } [103808]
464c457f 00010101 00000000 00000000 00280002 00000001 010001a4 00000034
000192d8 05000002 00200034 00280006 00100011 70000001 00015504 01015504
01015504 00000ae0 00000ae0 00000004 00000004 00000006 00000034 01000034
01000034 000000c0 000000c0 00000004 00000004 00000001 00000000 01000000
01000000 00015fe8 00015fe8 00000005 00008000 00000001 00018000 01018000
01018000 000011b4 0000734c 00000006 00008000 00000007 00018000 01018000
01018000 00000000 00000014 00000006 00000004 60000014 00013640 01013640
01013640 0000000c 0000000c 00000004 00000004 00000000 00000000 00000000
Compactifying
How you can see, the result is equal to the other mail I send.
Best regards, Alexis.
Hi,
On Tue Apr 01, 2014 at 10:37:02 -0400, Alexis Fajardo Moya wrote:
I execute all the steps, configuring and building foc an l4
individually for realview-pbx-a9.
I tried a bit to reproduce this but could not manage it, it always worked for me. In the same file, startup.cc, there's a function move_modules() which is doing the two outputs we're seeing. Inbetween, there's a 'for' loop. There's an 'if' inside (i < 3), could you add some printfs in there and around, especially printing the used addresses, to see why those modules are skipped? Overall the numbers are quite identical to my numbers here, so the different behavior is interesting.
Adam
El 01/04/14 18:07, Adam Lackorzynski escribió:
I tried a bit to reproduce this but could not manage it, it always worked for me. In the same file, startup.cc, there's a function move_modules() which is doing the two outputs we're seeing. Inbetween, there's a 'for' loop. There's an 'if' inside (i < 3), could you add some printfs in there and around, especially printing the used addresses, to see why those modules are skipped? Overall the numbers are quite identical to my numbers here, so the different behavior is interesting.
Hello Adam,
this is the result of your recommendations. In red the results of my printfs.
L4 Bootstrapper
Build: #2 mié abr 2 11:03:29 CDT 2014, 4.6.3
Scanning up to 256 MB RAM
Memory size is 256MB (70000000 - 7fffffff)
RAM: 0000000070000000 - 000000007fffffff: 262144kB
Total RAM: 256MB
mod04: 710cc000-710e5580: hello
mod03: 710b2000-710cb460: l4re
mod02: 71078000-710b162c: moe
mod01: 7106e000-71077378: sigma0
mod00: 71017000-7106d6dc: fiasco
Moving up to 5 modules behind 71100000
AFMOYA DEBUGING, printf BEFORE "if (i < 3)" statement, for (unsigned i = 0; i < mbi->mods_count; ++i) statement iteration 0
=> firstmodulestart 71017000 lastmoduleend 711cf000
=> mbi_mod_ start 71017000 end 7106d6dc size 566dc
=> Region from start 71017000 end 7106d6db size 566dc
=> Region *this_module start 71017000 end 7106d6db size 566dc
AFMOYA DEBUGING, printf INSIDE "if (i < 3)" statement
=> printf INSIDE "if (start < lastmoduleend)" statement
=>=> Region to start 711cf000 end 712256db
=>=> printf INSIDE "if (module_area.contains(to))" statement
moving module 00 { 71017000, 7106d6db } (?ELF) -> { 711cf000 - 712256db } [354012]
464c457f 00010101 00000000 00000000 00280002 00000001 00001244 00000034
000564d4 05000002 00200034 00280006 000c000d 70000001 00052ef0 f0052ef0
00052ef0 00000028 00000028 00000004 00000004 00000001 000000f4 00001000
00001000 000003c0 00000bc0 00000007 00000004 00000001 00002000 f0002000
00002000 00050f18 0005e000 00000007 00004000 00000001 00052f20 ffff0000
00060000 00000500 00000500 00000005 00000010 00000001 00053420 f0061000
00061000 00003000 00003000 00000007 00000004 6474e551 00000000 00000000
00000000 00000000 00000000 00000007 00000004 e3030c09 e92d4ff0 e3410000
=>=>=> lastmoduleend 0 received from rounded this_module->end() 0
AFMOYA DEBUGING, continue statement INSIDE if (i < 3) statement in the iteration 0
AFMOYA DEBUGING, printf BEFORE "if (i < 3)" statement, for (unsigned i = 0; i < mbi->mods_count; ++i) statement iteration 1
=> firstmodulestart 71017000 lastmoduleend 0
=> mbi_mod_ start 7106e000 end 71077378 size 9378
=> Region from start 7106e000 end 71077377 size 9378
=> Region *this_module start 7106e000 end 71077377 size 9378
AFMOYA DEBUGING, printf INSIDE "if (i < 3)" statement
AFMOYA DEBUGING, continue statement INSIDE if (i < 3) statement in the iteration 1
AFMOYA DEBUGING, printf BEFORE "if (i < 3)" statement, for (unsigned i = 0; i < mbi->mods_count; ++i) statement iteration 2
=> firstmodulestart 71017000 lastmoduleend 0
=> mbi_mod_ start 71078000 end 710b162c size 3962c
=> Region from start 71078000 end 710b162b size 3962c
=> Region *this_module start 71078000 end 710b162b size 3962c
AFMOYA DEBUGING, printf INSIDE "if (i < 3)" statement
AFMOYA DEBUGING, continue statement INSIDE if (i < 3) statement in the iteration 2
AFMOYA DEBUGING, printf BEFORE "if (i < 3)" statement, for (unsigned i = 0; i < mbi->mods_count; ++i) statement iteration 3
=> firstmodulestart 71017000 lastmoduleend 0
=> mbi_mod_ start 710b2000 end 710cb460 size 19460
=> Region from start 710b2000 end 710cb45f size 19460
=> Region *this_module start 710b2000 end 710cb45f size 19460
AFMOYA DEBUGING, execution continues after "if (i < 3)" statement
AFMOYA DEBUGING, execution continues after "if (start >= modaddr)" statement
AFMOYA DEBUGING, long long to = regions.find_free(module_area, size, L4_PAGESHIFT) 71100000
AFMOYA DEBUGING, Region m_to start 71100000 end 7111945f size 19460
moving module 03 { 710b2000, 710cb45f } (?ELF) -> { 71100000 - 7111945f } [103520]
464c457f 00010101 00000000 00000000 00280002 00000001 b00001a4 00000034
000191e0 05000002 00200034 00280006 000f0010 70000001 00014874 b0014874
b0014874 00000808 00000808 00000004 00000004 00000006 00000034 b0000034
b0000034 000000c0 000000c0 00000004 00000004 00000001 00000000 b0000000
b0000000 00015080 00015080 00000005 00008000 00000001 00018000 b0018000
b0018000 000010c4 0000236c 00000006 00008000 00000007 00000000 00000000
00000000 00000000 00000000 00000000 00000004 60000014 00012a40 b0012a40
b0012a40 00000018 00000018 00000004 00000004 00000000 00000000 00000000
AFMOYA DEBUGING, end of the iteration 3
AFMOYA DEBUGING, printf BEFORE "if (i < 3)" statement, for (unsigned i = 0; i < mbi->mods_count; ++i) statement iteration 4
=> firstmodulestart 71017000 lastmoduleend 0
=> mbi_mod_ start 710cc000 end 710e5580 size 19580
=> Region from start 710cc000 end 710e557f size 19580
=> Region *this_module start 710cc000 end 710e557f size 19580
AFMOYA DEBUGING, execution continues after "if (i < 3)" statement
AFMOYA DEBUGING, execution continues after "if (start >= modaddr)" statement
AFMOYA DEBUGING, long long to = regions.find_free(module_area, size, L4_PAGESHIFT) 71100000
AFMOYA DEBUGING, Region m_to start 71100000 end 7111957f size 19580
moving module 04 { 710cc000, 710e557f } (?ELF) -> { 71100000 - 7111957f } [103808]
464c457f 00010101 00000000 00000000 00280002 00000001 010001a4 00000034
000192d8 05000002 00200034 00280006 00100011 70000001 00015504 01015504
01015504 00000ae0 00000ae0 00000004 00000004 00000006 00000034 01000034
01000034 000000c0 000000c0 00000004 00000004 00000001 00000000 01000000
01000000 00015fe8 00015fe8 00000005 00008000 00000001 00018000 01018000
01018000 000011b4 0000734c 00000006 00008000 00000007 00018000 01018000
01018000 00000000 00000014 00000006 00000004 60000014 00013640 01013640
01013640 0000000c 0000000c 00000004 00000004 00000000 00000000 00000000
AFMOYA DEBUGING, end of the iteration 4
Compactifying
Here my adds to the*move_modules* function
move_modules(l4util_mb_info_t *mbi, unsigned long modaddr)
{
printf(" Moving up to %d modules behind %lx\n", mbi->mods_count, modaddr);
Region *ramr = ram.find(Region(modaddr, modaddr));
Region module_area(modaddr, ramr->end(), "ram for modules");
unsigned long firstmodulestart = ~0UL, lastmoduleend = 0;
for (unsigned i = 0; i < mbi->mods_count; ++i)
{
if (lastmoduleend < mbi_mod_end(mbi, i))
lastmoduleend = mbi_mod_end(mbi, i);
if (firstmodulestart > mbi_mod_start(mbi, i))
firstmodulestart = mbi_mod_start(mbi, i);
}
lastmoduleend = l4_round_page(lastmoduleend);
if (firstmodulestart < modaddr)
{
Region s(lastmoduleend, ramr->end());
unsigned long sz = modaddr - firstmodulestart;
lastmoduleend = regions.find_free(s, sz, L4_PAGESHIFT) + sz;
}
for (unsigned i = 0; i < mbi->mods_count; ++i)
{
unsigned long start = mbi_mod_start(mbi, i);
unsigned long end = mbi_mod_end(mbi, i);
unsigned long size = mbi_mod_size(mbi, i);
if (start == end)
continue;
Region from(start, end - 1);
Region *this_module = regions.find(from);
assert(this_module->begin() == from.begin()
&& this_module->end() == from.end());
printf("AFMOYA DEBUGING, printf BEFORE "if (i < 3)" statement, for (unsigned i = 0; i < mbi->mods_count; ++i) statement iteration %d \n", i);
printf("=> firstmodulestart %lx lastmoduleend %lx \n", firstmodulestart, lastmoduleend);
printf("=> mbi_mod_ start %lx end %lx size %lx \n", start, end, size);
printf("=> Region from start %llx end %llx size %llx \n", from.begin(), from.end(), from.size());
printf("=> Region *this_module start %llx end %llx size %llx \n", this_module->begin(), this_module->end(), this_module->size());
if (i < 3)
{
printf("AFMOYA DEBUGING, printf INSIDE "if (i < 3)" statement \n");
if (start < lastmoduleend)
{
printf("=> printf INSIDE "if (start < lastmoduleend)" statement \n");
Region to(lastmoduleend, lastmoduleend + (end - start) - 1);
printf("=>=> Region to start %llx end %llx \n", to.begin(), to.end());
if (module_area.contains(to))
{
printf("=>=> printf INSIDE "if (module_area.contains(to))" statement \n");
move_module(mbi, i, this_module, &to, true);
lastmoduleend = l4_round_page(this_module->end());
printf("=>=>=> lastmoduleend %lx received from rounded this_module->end() %llx \n", lastmoduleend, this_module->end());
}
}
printf("AFMOYA DEBUGING, continue statement INSIDE if (i < 3) statement in the iteration %d \n\n", i);
continue;
}
printf("AFMOYA DEBUGING, execution continues after "if (i < 3)" statement \n");
if (start >= modaddr) {
printf("AFMOYA DEBUGING, continue statement INSIDE if (start >= modaddr) statement in the iteration %d \n\n", i);
continue;
}
printf("AFMOYA DEBUGING, execution continues after "if (start >= modaddr)" statement \n");
unsigned long long to = regions.find_free(module_area, size, L4_PAGESHIFT);
assert(to);
printf("AFMOYA DEBUGING, long long to = regions.find_free(module_area, size, L4_PAGESHIFT) %llx \n", to);
Region m_to = Region(to, to + size - 1);
printf("AFMOYA DEBUGING, Region m_to start %llx end %llx size %llx \n", m_to.begin(), m_to.end(), m_to.size());
move_module(mbi, i, this_module, &m_to, true);
printf("AFMOYA DEBUGING, end of the iteration %d \n\n", i);
}
I hope those results help us. Best regards, Alexis.
Hello, El 02/04/14 12:24, Alexis Fajardo Moya escribió:
=>=>=> lastmoduleend 0 received from rounded this_module->end() 0
Note this output. After move the first module (00, corresponding to fiasco), the "end" value of the variable
this_module
is 0.
After many printfs, I (aka. my team) discover the problem in the function
move_module (l4util_mb_info_t *mbi, int i, Region *from, Region *to, bool overlap_check)
after execute the sentence
memmove((void *)to->begin(), (void *)start, size);
the *begin* and *end* values of the region *to*, originally with values 711cf000 and 712256db, turns in 10101464c457f and 0. The *begin* and *end* values of the region *from* are set to the corresponding values of the region *to*, causing the problem in the assigment to *lastmoduleend* variable in the *move_modules* function, making false the comparision
for (unsigned i = 0; i < mbi->mods_count; ++i) { ...
if (i < 3) { ...
if (start < lastmoduleend) // false, (7106e000 < 0)?
in the second iteration of the for sentence.
Best regards, Alexis.
On Wed Apr 02, 2014 at 15:52:19 -0400, Alexis Fajardo Moya wrote:
Hello, El 02/04/14 12:24, Alexis Fajardo Moya escribió:
=>=>=> lastmoduleend 0 received from rounded this_module->end() 0
Note this output. After move the first module (00, corresponding to fiasco), the "end" value of the variable
this_module
is 0.
After many printfs, I (aka. my team) discover the problem in the function
move_module (l4util_mb_info_t *mbi, int i, Region *from, Region *to, bool overlap_check)
after execute the sentence
memmove((void *)to->begin(), (void *)start, size);
the *begin* and *end* values of the region *to*, originally with values 711cf000 and 712256db, turns in 10101464c457f and 0. The *begin* and *end* values of the region *from* are set to the corresponding values of the region *to*, causing the problem in the assigment to *lastmoduleend* variable in the *move_modules* function, making false the comparision
Thanks for the analysis. This is strange because, for example, one of the parameters is a stack variable and it gets overwritten. However, I think the copying should be quite safe as there are couple of checks in there for that reason. As I see you're using gcc-4.6. Would you mind changing to a different one, such as Linaro's 4.8 version? The 4.6 series seem to contain some surprises sometimes.
http://releases.linaro.org/14.03/components/toolchain/binaries/gcc-linaro-ar... (from http://www.linaro.org/downloads/)
Adam
On Jueves 03 Abril 2014 15:03:41 Adam Lackorzynski escribió:
Thanks for the analysis. This is strange because, for example, one of the parameters is a stack variable and it gets overwritten. However, I think the copying should be quite safe as there are couple of checks in there for that reason. As I see you're using gcc-4.6. Would you mind changing to a different one, such as Linaro's 4.8 version? The 4.6 series seem to contain some surprises sometimes.
http://releases.linaro.org/14.03/components/toolchain/binaries/gcc-linaro-a rm-linux-gnueabihf-4.8-2014.03_linux.tar.xz (from http://www.linaro.org/downloads/)
It works!!!
Thank you for the tips!!
Best regards, Alexis.
l4-hackers@os.inf.tu-dresden.de