Hi everyone, this is my report of week 3 into the coding period for my Google Summer of Code project. So here is a quick overview on my progress since my last post on the mailing-list: - I was able to manually compile the hello example, which is opening a serial port via syscall and then printing to it (1) - With the help of Stefan I successfully integrated the hello example and kernel into the genode build-system so it can be automatically build as a run test (2) - I created dummy versions of the cxx and env library of Genode, so I could create a test printing to the serial port via Genodes Genode::printf() (3) - I wrote a test creating a new thread via syscall (4)
Following up I will describe the taken steps in more detail: (1) Printing to the serial port opened via syscall: After figuring out that the best way for executing syscall is to use the __syscall function provided by the architecture specific syscall.S and its convenience wrappers and creating a private include directory for some simple definitions, I was able to successfully build the binary I was aiming for by using some simple Makefile magic. After discovering that this binary would not be loaded by the kernel and some discussion on this mailing-list, thankfully Martin supplied the right solution to this problem by pointing out that some minor adjustments would have to be made to the used linker script (I was already using the Genode linker script for detecting such problems). For this step I was still using the infrastructure for creating an image supplied by the HelenOS code. (2) basic build-system support: After having created a working roottask replacement printing to the serial port, I wanted to integrate the build procedure of the previous achieved step into the Genode build-system to straighten the way towards an easy and convenient way to build the kernel plus whatever test or setup the user wants create. Therefore Stefan created all needed mechanisms to create an external build directory, a very nice way to extract needed header files from the HelenOS repository and a patch for enabling the spartan kernel to be build outside the HelenOS repository. I meanwhile have been working my way into creating all necessary configuration- and support-files for the build process. As a result of this step a dedicated build directory can be created outside of the source tree, where the kernel and the hello test could be built and run in a very nice and and convenient way. (3) using Genode::printf() to print to the serial port: So next up has been using basic functionality from Genode to print something to the serial port. Therefore I needed to include the Genode-specific C++ library (called cxx), the ipc library and the lock library, which needed some dummy header files to be created in include/base/*. Furthermore the console library had to be included, which supplies access to the Genode::printf() functionality. The console library relies on a kernel specific implementation of the Core_console class granting direct access to the serial port. This class had to be implemented. By reusing all previously written code this class is requesting access to the serial port via syscall and is then offering the functionality of writing one character to the serial port which is then used for realizing the Genode::printf() function. Additionally all syscall-specific declarations ans functions has been moved into an own syscall library (which still needs a rework concerning a good and solid naming policy) and a separate namespace. Last but not least a minimal Genode environment had to be added. To keep it simple I took the mini_env.h from the base-okl4/src/test tree which works perfectly fine. (4) creating a new thread via syscall: After accomplishing the last step this was a rather easy tasks to do because of the existence of a convenient build environment. Just a few declarations and the syscall-function had to be added for the test to be a quite straight forward implementation. So in conclusion now there exist three complete and working tests, which are included into the Genode build system and can be executed in a very nice and convenient way. For executing those tests you have to perform the following steps: - check out the repository from [1] - execute 'make prepare' in the base-spartan directory in order to obtain the HelenOS source code and apply all needed patches - create a build directory wherever you like and use '[genode-dir]/tools/create_builddir spartan_x86 BUILD_DIR=[you build directory]' to fill in all needed files - use 'make run/hello' to see the outcome form step (2) - use 'make run/printf' to see the outcome form step (3) - use 'make run/thread' to see the outcome form step (4) As mentioned in another thread, Stefan and I met yesterday. Primarily we have been finishing step (3) and created step (4) together by pair programming. Additionally we have then been discussing approaches in preparation to port the ipc framework. While doing so some questions opened up which I want to ask you: 1) When creating a new thread via syscall a stack has to be passed with it. Assuming from the code in ... the spartan kernel is expecting a stacksize of 8k Bytes. By passing the lowest address of the stack via syscall to the kernel and then adding those 8k Bytes the stacksize seems to be hard coded to be 8k Bytes big. But what's about other stacksizes? The problem with this is, that Genode is using variable stack sizes from 4k up to 16k Bytes. So the question is why you decided to only allow a static stack size? Or did we understand the code wrong? Or is there another way to use other stack sizes? 2) The ipc mechanisms of HelenOS seem to be seems to be focusing on the communication between different tasks. Therefore every _task_ has exactly one answerbox which can be addressed. But what about the communication between different threads (kernel primitives) existing in one single task? The written documentation [2] is rather old and maybe even outdated. In my opinion it is not separating clearly enough what can be done with kernel primitives and what is only available in in the userspace. So could you please point out how single threads inside a task can be communicate with each other? (The idea behind this is to create the next test where arguments for a printf is being passed from one thread to another in one single task as initial ipc test) The plan for the upcoming week is to do conceptional work on and actually begin to port the ipc framework. Meanwhile new tests will assure everything is working properly and as expected. So this was my report of week 3 into the coding period. I hope you are satisfied with the progress and we can settle all questions. Thanks again to Stefan who sacrificed nearly a complete day of work yesterday helping me making huge progress this week. :-) Regards Tobias [1] https://github.com/kurbel/genode [2] http://www.helenos.org/doc/design.pdf
_______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/cgi-bin/listinfo/helenos-devel
