RE: Adding a custom library to l4/pkg/bootstrap
Hey Martin, No I did not have the require_libs declared. I will try that. Thanks, ramya From: l4-hackers [l4-hackers-boun...@os.inf.tu-dresden.de] on behalf of Martin Küttler [martin.kuett...@gmail.com] Sent: 04 September 2014 09:27 To: l4-hackers@os.inf.tu-dresden.de Subject: Re: Adding a custom library to l4/pkg/bootstrap On 09/03/2014 09:51 AM, Masti Ramya Jayaram wrote: Hey Jan, Sorry for underspecifying it. Here are the details. I have a library called scc-sec under the l4/pkg directory. It has one file: a. init.c that contains void hello(){ printf(hello); } I compile this as a library and I can see the scc-sec.so and scc-sec.a in the l4/build/pkg/scc-sec directory Now in l4/pkg/bootstrap: a. Control file requires: (added) scc-sec b. Make.rules: -lscc-sec Is -lscc-sec the literal content of this file? That doesn't do anything. c. startup.cc I declare the function as: extern C { void hello(); } and somewhere in startup() function, I call it hello(); On trying to compile this, I get (exact error as it is compiled) in path_to-startup.cc: undefined reference to function hello() I do not think it is the printf because it explicitly gives me an undefined reference to hello :) To me this looks like you don't actually link to your scc-sec library. Does your Makefile for bootstrap include something like REQUIRES_LIBS = scc_sec ? Martin ___ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers ___ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
RE: Checking executables before running them in L4re/fiasco
Hey Adam, Thanks for the information. I have two issues/questions: a. I looked at the move_modules (which does not do much in my case) and I tried to replace the linux.cfg from Compiled in version: -- --vim:set ft=lua: L4.default_loader:start({ caps = { log = L4.Env.log:m(rws), }, l4re_dbg = L4.Dbg.Warn, log = { l4linux, yellow }, }, rom/vmlinuz mem=128M console=ttyLv0,115200 l4x_rd=rom/ramdisk-x86.rd root=1:0 ramdisk_size=4000 l4ser.vkey_enable=1); Replaced version: (just the memory changes but this results in a difference in the length!) --- --vim:set ft=lua: L4.default_loader:start({ caps = { log = L4.Env.log:m(rws), }, l4re_dbg = L4.Dbg.Warn, log = { l4linux, yellow }, }, rom/vmlinuz mem=64M console=ttyLv0,115200 l4x_rd=rom/ramdisk-x86.rd root=1:0 ramdisk_size=4000 l4ser.vkey_enable=1); I achieve this with the following code that runs immediately after construct_mbi: a. Copy the placed version into the start address of the linux_cfg module (this happens correctly as I can see the memory dump). b. Change the compressed and uncompressed lengths in mod_info to reflect the smaller size. The process runs until ned which fails to parse the config file (unexpected symbol error) and the problem seems to be the difference in length of the two configs. For example, if the 2nd config is mem=064M instead of mem=64M, then it works. I change the length appropriately in mod_info of the mbi. What am I missing? a. The MODE = sigma0 suggestion: I tried this by changing bootstrap/server/src/Make.rules but I get an error saying: ld: cannot find -ll4util. The relevant part in the linker line that differs from the default working build (with MODE = lib) is: == Linking bootstrap.elf .. -Tbootstrap.ld --start-group -ll4util -ll4sys -luc_c -static -nostdlib -ldrivers_uart -lcxx_base -lcxx_io -luc_c /usr/lib/gcc/x86_64-linux-gnu/4.4.3/32/libgcc.a --end-group --warn-common -Ttext=0x2d /usr/lib/gcc/x86_64-linux-gnu/4.4.3/32//crtend.o /home/rmasti/fiasco/r33-new/src/l4/build/lib/x86_pentium/crtn.o The linker line with MODE = lib (the difference seems to be that l4util, l4sys, etc are not really there in the commandline) == Linking bootstrap.elf .. -Tbootstrap.ld --start-group-static -nostdlib -ldrivers_uart -lcxx_base -lcxx_io -luc_c /usr/lib/gcc/x86_64-linux-gnu/4.4.3/32/libgcc.a --end-group --warn-common -Ttext=0x2d /usr/lib/gcc/x86_64-linux-gnu/4.4.3/32//crtend.o /home/rmasti/fiasco/r33-new/src/l4/build/lib/x86_pentium/crtn.o Why does this happen? What is the relevant modules.list entry for this mode? Thanks, ramya From: l4-hackers [l4-hackers-boun...@os.inf.tu-dresden.de] on behalf of Adam Lackorzynski [a...@os.inf.tu-dresden.de] Sent: 05 September 2014 00:39 To: l4-hackers@os.inf.tu-dresden.de Subject: Re: Checking executables before running them in L4re/fiasco ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ │ │ ││ On Wed Sep 03, 2014 at 14:43:59 +, Masti Ramya Jayaram wrote: You mean binaries that are started? Yes but some modules have dependencies (like the Io server and examples of target dependencies include libsigma). Is there a way to find all of them? Ok, you mean all the libraries that are linked to a program. One way to find that out is to build the program with make V=1, see the linker step and look for all the -lxxx options. The lib directory in the build tree has all the libraries and those are links to the actual package directory so you see the package there. Finally, on a related note, could you explain to me how all the modules get merged to create the elfimage? I ask because I have to access the modules (vmlinux, l4linux.cfg and ramdisk) from bootstrap in order to modify/check them. For example, I would like to load the modules encrypted and decrypt them in bootstrap before continuing. I can do decryption in place but again, I am not sure about module sizes, etc. I see that some of this information is included during the image creation process in l4/pkg/bootstrap/server/src/build.pl but I cannot quite get the entire picture. Could you point me to any documentation about it? In bootstrap, there's a move_modules() function that iterates over all the modules and should show you how how to do that. Adam -- Adam a...@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/
Re: l4/sys/syscalls.h: No such file or directory
Hi, On 09/05/2014 12:28 AM, Adam Lackorzynski wrote: Does it work with the default scheduler? No, it does not work with the default Fixed_prio scheduler. Tasks are created properly and my threads are assigned to them. But after that, nothing happens. Instead, one of the created threads (thread0 - thread3) waits for the pager 1b. I've attached the code of that example for your convenience. I've removed all code that concerns the EDF scheduler, so it works with the default Fixed_prio scheduler. It's a ordinary package, so just place it under './l4/pkg' and run the binary produced by './libedft/examples/libedft-example'. Besides, I've tried to modify your utcb-ipc example and created a new task for thread2 just as you suggested in your previous posts. It doesn't work either, thread1 outputs a 'Thread1 up' and then nothing happens (thread2 is active then). I've attached the JDB thread list output for this example. Thanks for your effort! Best regards, Valentin id cpuname pr sp waitto state 25 0 thread2 1 241b ready,rcv_wait 1e 0 thread1 2 1a25 send 1b 0 #ex_utcb_ipc ff 1a a ready,rcv_wait a 0 moe ff 9 ready 8 0 sigma01 7 - rcv_wait 6 0 - 0 1 ready libedft_fp_050914.tar.gz Description: GNU Zip compressed data ___ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Aborted L4linux due to CLI/STI
Dear all, I get an error during L4linux boot when I enter the debugger (using ESC) and resume: Aborted L4linux due to CLI/STI at 0x534911. When I disassemble this using gdb: (gdb) disassemble 0x534911 Dump of assembler code for function cmpxchg8b_emu: 0x00534910 +0: pushf 0x00534911 +1: cli 0x00534912 +2: cmp(%esi),%eax 0x00534914 +4: jne0x534922 cmpxchg8b_emu+18 0x00534916 +6: cmp0x4(%esi),%edx 0x00534919 +9: jne0x534924 half_same 0x0053491b +11:mov%ebx,(%esi) 0x0053491d +13:mov%ecx,0x4(%esi) 0x00534920 +16:popf 0x00534921 +17:ret 0x00534922 +18:mov(%esi),%eax 0x00534924 +0: mov0x4(%esi),%edx 0x00534927 +3: popf 0x00534928 +4: ret When I built l4linux, I had to disable CONFIG_X86_CMPXCHG, CONFIG_CMPXCHG_LOCAL and CONFIG_X86_CMPXCHG64 despite building for the Pentium because my processor does not support PAE (which is the option that enables this). I am guessing This is the reason it tries to emulate the CMPXCHG instructions. What is the correct l4linux configuration to use for a machine that does not support any of the atomic instructions like CMPXCHG8, ATOMIC, etc.? Thanks, ramya ___ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Re: Aborted L4linux due to CLI/STI
I forgot to mention that it also does not support the traditional cmpxchg instructions using the lock line. That is why I disabled it. Sorry about the multiple emails, Ramya Sent from my phone On 05 Sep 2014, at 18:16, Masti Ramya Jayaram rma...@inf.ethz.ch wrote: Dear all, I get an error during L4linux boot when I enter the debugger (using ESC) and resume: Aborted L4linux due to CLI/STI at 0x534911. When I disassemble this using gdb: (gdb) disassemble 0x534911 Dump of assembler code for function cmpxchg8b_emu: 0x00534910 +0:pushf 0x00534911 +1:cli 0x00534912 +2:cmp(%esi),%eax 0x00534914 +4:jne0x534922 cmpxchg8b_emu+18 0x00534916 +6:cmp0x4(%esi),%edx 0x00534919 +9:jne0x534924 half_same 0x0053491b +11:mov%ebx,(%esi) 0x0053491d +13:mov%ecx,0x4(%esi) 0x00534920 +16:popf 0x00534921 +17:ret 0x00534922 +18:mov(%esi),%eax 0x00534924 +0:mov0x4(%esi),%edx 0x00534927 +3:popf 0x00534928 +4:ret When I built l4linux, I had to disable CONFIG_X86_CMPXCHG, CONFIG_CMPXCHG_LOCAL and CONFIG_X86_CMPXCHG64 despite building for the Pentium because my processor does not support PAE (which is the option that enables this). I am guessing This is the reason it tries to emulate the CMPXCHG instructions. What is the correct l4linux configuration to use for a machine that does not support any of the atomic instructions like CMPXCHG8, ATOMIC, etc.? Thanks, ramya ___ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers ___ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers