RE: Adding a custom library to l4/pkg/bootstrap
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 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 :) Thanks in advance for helping with this, Ramya From: l4-hackers [l4-hackers-boun...@os.inf.tu-dresden.de] on behalf of Jan Bierbaum [jan.bierb...@os.inf.tu-dresden.de] Sent: 02 September 2014 21:56 To: l4-hackers@os.inf.tu-dresden.de Subject: Re: Adding a custom library to l4/pkg/bootstrap On 02.09.2014 13:32, Masti Ramya Jayaram wrote: However, now I am trying to call a function in the library through an included header file (which is part of the library) and it fails (undefined reference). Could you give the *exact* error message? BTW, this is something you should always do if you want people to be able to help you ;-) My guess at this point would be that the undefined reference is not your 'hello' function but 'printf'... I made sure that I am indeed using the extern C directive. I also tried putting the function declaration in here instead of the header file itself but it does not help. The function declaration is not the problem here. If it was, the compiler would give you an error along the lines of 'hello' was not declared in this scope. Regards, Jan ___ 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: Passing data to a thread
Hi, On 09/03/2014 12:45 AM, Adam Lackorzynski wrote: For that we need to know the calling convention of functions. For x86-32, the arguments are passed via the stack. So you'd do it like this: l4_umword_t stack[2000]; stack[1999] = (l4_umword_t)my_data; stack[1998] = 0; And use stack[1998] as an initial stack pointer for the thread. On ARM the setup can be the same, however, arguments are passed in registers, so you'll have a small asm stub for getting the argument from the stack to the register before calling the thread function. The same for x86-64. Thanks, it works great. Usage is very simple with: void thread_func(l4_umword_t data); Best regards, Valentin ___ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Re: l4/sys/syscalls.h: No such file or directory
Hi, On 09/03/2014 12:32 AM, Adam Lackorzynski wrote: And indeed, you need to map the cap to the new task. l4_task_map(task_cap, L4RE_THIS_TASK_CAP, l4_obj_fpage(l4re_env()-rm, 0, L4_FPAGE_RO), l4_map_obj_control(l4re_env()-rm, L4_MAP_ITEM_MAP)); Thanks, that works, there's no more kernel warning for an invalid pager now. But the actual thread function is not executed any more. Instead, Fiasco calls the deblock_refill method of my ready queue implementation for that thread (respectively Sched_context) _steadily_. I've attached the output of JDB's thread list. It's interesting to see that thread0 seems to wait for the first thread of task 1a. The function of thread0 accesses its Edf_thread object created in task 1a (named 't'), so I've tried to map that object to the new task. Additionally, I've tried to map the thread capability for thread0 ('t-cap') to the new task. But both approaches do not solve the problem. l4_task_map(task_cap, L4RE_THIS_TASK_CAP, l4_fpage((l4_umword_t)t, sizeof(t), L4_FPAGE_RW), l4_map_obj_control((l4_umword_t)t, L4_MAP_ITEM_MAP)); l4_task_map(task_cap, L4RE_THIS_TASK_CAP, l4_obj_fpage(t-cap, 0, L4_FPAGE_RW), l4_map_obj_control(t-cap, L4_MAP_ITEM_MAP)); Best regards, Valentin id cpuname pr sp waitto state 2c 0 thread2 0 2b ready 2a 0 thread3 0 29 ready 28 0 thread1 0 27 ready 26 0 thread0 0 241b ready,rcv_wait 1e 0 main_thread 2 1a a rcv_wait 1b 0 #libedft-examp ff 1a transfer a 0 moe ff 9 ready 8 0 sigma01 7 - rcv_wait 6 0 - 0 1 ready ___ 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
For a start, you can set MODE = sigma0 in the Makefile to get a much Ok, I will try the MODE=sigma0. 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? 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? 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: 03 September 2014 00:02 To: l4-hackers@os.inf.tu-dresden.de Subject: Re: Checking executables before running them in L4re/fiasco On Tue Sep 02, 2014 at 14:08:03 +, Masti Ramya Jayaram wrote: Also, could you elaborate a bit on how one could have smaller components? I decided to do it at bootstrap at the moment because I realized that using the IO server also means including the entire C library (and much more). For a start, you can set MODE = sigma0 in the Makefile to get a much simpler setup (don't be confused by the name). Of course, not all features are there then but should be ok for checking a binary. More libraries can be removed further but also requires to do more by hand then. On a related note, is there a way to find all the packages in use (there is more than what is compiled by module.list I can see)? You mean binaries that are started? modules.list has defaults for kernel, sigma0 and roottask but otherwise everything else needs to be put there. From: l4-hackers [l4-hackers-boun...@os.inf.tu-dresden.de] on behalf of Masti Ramya Jayaram [rma...@inf.ethz.ch] Sent: 02 September 2014 09:57 To: Adam Lackorzynski; l4-hackers@os.inf.tu-dresden.de Subject: RE: Checking executables before running them in L4re/fiasco Thanks for the suggestions. From what you say, I guess it is best to do something between ned and say vmlinuz. It also makes better sense semantically (the kernel has booted and checks if the application is ok). Is there a way to accomplish the following: a. Ned starts up a new process which does some checks and returns OK/STOP. b. depending on the value returned by the new process, ned decides to launch/stop vmlinuz. When I try roottask moe rom/hello rom/vmlinuz in the modules.list file, they execute in parallel. Is there a way to make it sequential? You start ned via moe (as usual) and have a script like this: local l = L4.default_loader; local e = l:start({}, rom/checker rom/hello); if e:wait() == 0 then l:start({}, rom/hello); else print(Something is wrong with hello.); end So the checker program does exit(0) or exit(1) depending on its result. Adam -- Adam a...@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/ ___ 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
Compiling the Fiasco.OC +L4Re for Raspberry PI
hello hanzel, I have seen in l4hacker list that you have compiled fiasco.oc + l4re for Raspberry PI whithout problems. Iḿ trying to compile it for rpi. I follow the next steps 1- Compile Fiasco.OC for Broadcom2835 2- Compile L4Re for RaspberryPI model B with MODULE_SEARCH_PATH pointing to FOC builddir 3- Generate the hello example ELF image I have transformed it into a binary using: /usr/local/genode-gcc/bin/genode-arm-objcopy -Obinary bootstrap.elf l4.img I have used the three elf image and have used to the linaro and genode toolchain (both). When I have put the binary on the PI only can see the colored screen. I am using the Fiasco.OC +L4Re from 2014022815 snapshot. I am doing something wrong? Can you help me? ___ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
Re: Compiling the Fiasco.OC +L4Re for Raspberry PI
Hello. I have compiled it, but tried only in QEMU. If think there is still need for driver for RPi framebuffer. And that's probably the reason why nothing is changed on screen. On Wed, Sep 3, 2014 at 7:15 PM, Waldo Paz Rodriguez waldo...@uclv.cu wrote: hello hanzel, I have seen in l4hacker list that you have compiled fiasco.oc + l4re for Raspberry PI whithout problems. Iḿ trying to compile it for rpi. I follow the next steps 1- Compile Fiasco.OC for Broadcom2835 2- Compile L4Re for RaspberryPI model B with MODULE_SEARCH_PATH pointing to FOC builddir 3- Generate the hello example ELF image I have transformed it into a binary using: /usr/local/genode-gcc/bin/genode-arm-objcopy -Obinary bootstrap.elf l4.img I have used the three elf image and have used to the linaro and genode toolchain (both). When I have put the binary on the PI only can see the colored screen. I am using the Fiasco.OC +L4Re from 2014022815 snapshot. I am doing something wrong? Can you help me? ___ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers