Hello, I'm new to genode but not new to develoment. I'd like to port genode to my dev board (Odroid-XU). To begin, I built the foc_arndale target successfully following the instructions. What I couldn't find anywhere is instructions on how to build a boot image for u-boot, which files are needed in the image, entry point, etc. Where can I find that information? An explanation or a link would be helpful.
As a constructive critic to the Genode project: Documentation is fantastic, but there's nothing on how to create a partition, put all the files and boot on x86, or for other platforms as well (at least something generic, saying that we need to load the kernel image (where to find it in the path), the 'core' executable, drivers, build an image, etc. The description on the website begins with how to configure the 'init' process, which says it is loaded by 'core', which is the first task started by the kernel. So how do we put it all together in an image? I think we'd need an image with the kernel, core, init, the uart driver, and perhaps an sd/mmc driver, so that init reads the rest of the services from the sd card. I noticed the build directory has a large file, fiasco.image (15 MB?), what does it contain?
I have too many questions, please bear with me. Once I learn all this, I can write some tutorials for other people like me. Thanks, Claudio
Hi Claudio,
welcome to the Genode mailing list.
On 11/02/2013 11:17 PM, Claudio L. wrote:
Hello, I'm new to genode but not new to develoment. I'd like to port genode to my dev board (Odroid-XU). To begin, I built the foc_arndale target successfully following the instructions.
That sounds cool.
What I couldn't find anywhere is instructions on how to build a boot image for u-boot, which files are needed in the image, entry point, etc. Where can I find that information? An explanation or a link would be helpful.
As a constructive critic to the Genode project: Documentation is fantastic, but there's nothing on how to create a partition, put all the files and boot on x86, or for other platforms as well (at least something generic, saying that we need to load the kernel image (where to find it in the path), the 'core' executable, drivers, build an image, etc. The description on the website begins with how to configure the 'init' process, which says it is loaded by 'core', which is the first task started by the kernel. So how do we put it all together in an image? I think we'd need an image with the kernel, core, init, the uart driver, and perhaps an sd/mmc driver, so that init reads the rest of the services from the sd card.
Indeed, appropriated documentation for such a task is sometimes hard to find on Genode's website, or source code's inline documents. Mostly, you'll have luck when searching in the extraordinary detailed release notes that can be found on the website, or in the 'doc' directory of the sources.
With respect to your question, on how to build a corresponding image to boot it via u-boot, I recommend to have a deeper look at the run tool integrated in Genode's build system. As we use a bunch of kernels on different hardware all the time at Genode Labs, there was the impulse at an early stage to automate the task of building, and testing of different platforms. Therefore, Genode's run tool was initiated years ago. In the meantime, it became a powerful tool that enables to build, start, and test complex scenarios with a simple run of 'make'. For more details, please refer to the corresponding section of the notes of release 13.05:
http://genode.org/documentation/release-notes/13.05#Automated_quality-assura...
For general information of the run tool, please consider the general build system documentation:
http://genode.org/documentation/developer-resources/build_system
In your case, it will be sufficient to add an argument to the "RUN_OPT" environment variable, which is interpreted by the run tool. Just add:
RUN_OPT = --target uboot
into the 'etc/build.conf' file of your build directory, or invoke 'make' like the following:
RUN_OPT="--target uboot" make run/[run_script_you_want_to_build]
The run tool will produce a ready to use u-boot image containing all necessary files, including the kernel, core etc., at 'var/run/[run_script_name]/uImage' in your build directory. You can either copy that uImage to a SD-card, or load it via TFTP to the target board. Just mind to load the uImage to a different memory area than its defined load address. After you've loaded the uImage to memory, you can invoke u-boot's 'bootm' command together with the memory address you put the uImage at. U-boot will look at the header of the uImage in memory, copy the contents to the load address that is specified in there, and jump to the entry point defined. If you want to read the uImage details, like the load address, you can use the u-boot tool 'mkimage' in combination with the '-l' argument. Also be aware to not load the uImage to the memory area u-boot resides in, and leave the first physical page free. Typically u-boot doesn't warn, if it fails to load an image to memory, because of a memory region clash.
In your position, I would start with a very simple test scenario, like the 'base/run/printf.run' script. It includes: the kernel, core, init, and a simple test-printf program. Debug output is printed using a in-kernel debug printing feature. An additional UART driver isn't needed here, mostly the kernel builtin UART driver is sufficient. As you can see in the mentioned run script, the 'build_boot_image' command is given a list of all binaries that should be incorporated into the the target image (in your case uImage). The corresponding kernel is integrated automatically. All binaries, inside such a boot image, are accessible via core's ROM service. If you don't want to integrate all binaries, you want to execute in a scenario, into the boot image, e.g. to minimize u-boot's load time, you might load binaries on demand, e.g. from a SD card. Of course, that implies to first enable the regarding drivers for your target platform.
I noticed the build directory has a large file, fiasco.image (15 MB?), what does it contain?
I assume its the unstripped version of the Fiasco.OC kernel containing all kinds of debug symbols. The stripped version should have a size of something like 500KB .
I have too many questions, please bear with me. Once I learn all this, I can write some tutorials for other people like me.
Don't hesitate to ask these questions. They are more than welcome. We would be glad, if you help us to improve the documentation fo new users, and developers.
Best regards Stefan
Thanks, Claudio
Android is increasing in popularity, but the open development platform that developers love is also attractive to malware creators. Download this white paper to learn more about secure code signing practices that can help keep Android apps secure. http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clk... _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
On 11/4/2013 6:46 AM, Stefan Kalkowski wrote:
With respect to your question, on how to build a corresponding image to boot it via u-boot, I recommend to have a deeper look at the run tool
Thanks for the pointer, that's a good starting point.
...
In your case, it will be sufficient to add an argument to the "RUN_OPT" environment variable, which is interpreted by the run tool. Just add:
RUN_OPT = --target uboot
into the 'etc/build.conf' file of your build directory, or invoke 'make' like the following:
RUN_OPT="--target uboot" make run/[run_script_you_want_to_build]
The run tool will produce a ready to use u-boot image containing all necessary files, including the kernel, core etc., at 'var/run/[run_script_name]/uImage' in your build directory. You can either copy that uImage to a SD-card, or load it via TFTP to the target board. Just mind to load the uImage to a different memory area than its defined load address.
This is the information I was looking for! I'm familiar with uboot, I just needed to know how to get the image built. It seems I underestimated your build system, it's more powerful than I thought.
After you've loaded the uImage to memory, you can invoke u-boot's 'bootm' command together with the memory address you put the uImage at. U-boot will look at the header of the uImage in memory, copy the contents to the load address that is specified in there, and jump to the entry point defined. If you want to read the uImage details, like the load address, you can use the u-boot tool 'mkimage' in combination with the '-l' argument. Also be aware to not load the uImage to the memory area u-boot resides in, and leave the first physical page free. Typically u-boot doesn't warn, if it fails to load an image to memory, because of a memory region clash.
That's no problem, I know the memory layout of the board.
In your position, I would start with a very simple test scenario, like the 'base/run/printf.run' script. It includes: the kernel, core, init, and a simple test-printf program.
I agree, I just want to see the kernel running, then patch it to start all 8 cores, or at least the 4 A15's in the board, then I'll work on drivers (although most of the arndale drivers should work).
Debug output is printed using a in-kernel debug printing feature. An additional UART driver isn't needed here, mostly the kernel builtin UART driver is sufficient. As you can see in the mentioned run script, the 'build_boot_image' command is given a list of all binaries that should be incorporated into the the target image (in your case uImage). The corresponding kernel is integrated automatically. All binaries, inside such a boot image, are accessible via core's ROM service. If you don't want to integrate all binaries, you want to execute in a scenario, into the boot image, e.g. to minimize u-boot's load time, you might load binaries on demand, e.g. from a SD card. Of course, that implies to first enable the regarding drivers for your target platform.
That's the idea. Load a kernel with a UART driver, SD driver and a file system from a minimal image. Then the rest can be loaded from the SD card. But that's for later, once the kernel and drivers are working.
... Don't hesitate to ask these questions. They are more than welcome. We would be glad, if you help us to improve the documentation fo new users, and developers.
I certainly will, I already received feedback from users interested in my port, so I'll be posting my progress here for others.
Thanks a lot for your help, that initial "push" was very much appreciated.
Claudio
Hello, I'm creating this thread where I'll report the status of my port of genode to the Odroid-XU board.
Initial bootstrap went well. Board executed the bootstrap and hung right after showing "Hello from startup::stage2", which is where most of the hardware initialization takes place. Here's where the real porting job begins.
For others with the XU board, here's what I did to test it:
* After having checked out genode repository, and installed the additional packages per the genode instructions to build Fiasco.OC, install one more package:
apt-get install u-boot-tools
This will give us the mkimage command we need.
then, from the main genode directory:
cd base_foc make prepare cd .. ./tool/create_builddir foc_arndale BUILD_DIR=build.exynos cd build.exynos make
This make is just to see if you have anything missing. You should be able to get to the end without any errors. If not, something went wrong.
Now we need a small change to generate the uboot image:
cd build.exynos/etc
edit the file build.conf and add the line
RUN_OPT = --target uboot
then build the printf demo with:
make clean [[make sure you are in the build.exynos directory] make run/printf
If everything goes well, compile will end with an error saying it can't run automatically on this target. This is normal, since we never removed the lines in the run script that try to use qemu to run the test. The important thing is that in build.exynos/var/run/printf, there's a 'uImage' file.
Put the file on a microSD card, insert the card into the Odroid-XU. Connect to the serial console (I use the excellent Putty), configured as 115200, 8N1. The name of the serial port might vary, depending on which USB port the board was plugged in. To access the serial port, Putty might need to be run as root.
Boot the board and press space quickly to stop the boot process at u-boot (green light on the board should be on). Now issue the following commands:
mmc dev 1 fatload mmc 1 0x60000000 uImage
It should say it's OK and that it read about 600k from the sd card.
finally, boot the image:
bootm 0x60000000
If everything goes well, you should see a lot of text in the console, ending with "Hello from startup::stage2".
That's as far as I got today. More to come... Claudio
Hello Claudio,
thanks for the excellent writeup! I am curious how the story continues... :-)
Cheers Norman
On 11/06/2013 01:54 PM, Claudio L. wrote:
Hello, I'm creating this thread where I'll report the status of my port of genode to the Odroid-XU board.
Initial bootstrap went well. Board executed the bootstrap and hung right after showing "Hello from startup::stage2", which is where most of the hardware initialization takes place. Here's where the real porting job begins.
For others with the XU board, here's what I did to test it:
- After having checked out genode repository, and installed the
additional packages per the genode instructions to build Fiasco.OC, install one more package:
apt-get install u-boot-tools
This will give us the mkimage command we need.
then, from the main genode directory:
cd base_foc make prepare cd .. ./tool/create_builddir foc_arndale BUILD_DIR=build.exynos cd build.exynos make
This make is just to see if you have anything missing. You should be able to get to the end without any errors. If not, something went wrong.
Now we need a small change to generate the uboot image:
cd build.exynos/etc
edit the file build.conf and add the line
RUN_OPT = --target uboot
then build the printf demo with:
make clean [[make sure you are in the build.exynos directory] make run/printf
If everything goes well, compile will end with an error saying it can't run automatically on this target. This is normal, since we never removed the lines in the run script that try to use qemu to run the test. The important thing is that in build.exynos/var/run/printf, there's a 'uImage' file.
Put the file on a microSD card, insert the card into the Odroid-XU. Connect to the serial console (I use the excellent Putty), configured as 115200, 8N1. The name of the serial port might vary, depending on which USB port the board was plugged in. To access the serial port, Putty might need to be run as root.
Boot the board and press space quickly to stop the boot process at u-boot (green light on the board should be on). Now issue the following commands:
mmc dev 1 fatload mmc 1 0x60000000 uImage
It should say it's OK and that it read about 600k from the sd card.
finally, boot the image:
bootm 0x60000000
If everything goes well, you should see a lot of text in the console, ending with "Hello from startup::stage2".
That's as far as I got today. More to come... Claudio
Update: The crash happens while mapping memory, during the early stages of the bootstrap process, most likely due to differences in the chipset. I've already created all the makefiles and directories needed for a separate "odroidxu" target, for now just a copy of the arndale ones, and I'm ready to start coding. I created one spec called "exynos5octa", which will complement the existing "exynos5", on the few items where there are architectural differences in the SOC.
Claudio
On 11/06/2013 07:54, Claudio L. wrote:
Hello, I'm creating this thread where I'll report the status of my port of genode to the Odroid-XU board.
Initial bootstrap went well. Board executed the bootstrap and hung right after showing "Hello from startup::stage2", which is where most of the hardware initialization takes place. Here's where the real porting job begins.
For others with the XU board, here's what I did to test it:
- After having checked out genode repository, and installed the
additional packages per the genode instructions to build Fiasco.OC, install one more package:
apt-get install u-boot-tools
This will give us the mkimage command we need.
then, from the main genode directory:
cd base_foc make prepare cd .. ./tool/create_builddir foc_arndale BUILD_DIR=build.exynos cd build.exynos make
This make is just to see if you have anything missing. You should be able to get to the end without any errors. If not, something went wrong.
Now we need a small change to generate the uboot image:
cd build.exynos/etc
edit the file build.conf and add the line
RUN_OPT = --target uboot
then build the printf demo with:
make clean [[make sure you are in the build.exynos directory] make run/printf
If everything goes well, compile will end with an error saying it can't run automatically on this target. This is normal, since we never removed the lines in the run script that try to use qemu to run the test. The important thing is that in build.exynos/var/run/printf, there's a 'uImage' file.
Put the file on a microSD card, insert the card into the Odroid-XU. Connect to the serial console (I use the excellent Putty), configured as 115200, 8N1. The name of the serial port might vary, depending on which USB port the board was plugged in. To access the serial port, Putty might need to be run as root.
Boot the board and press space quickly to stop the boot process at u-boot (green light on the board should be on). Now issue the following commands:
mmc dev 1 fatload mmc 1 0x60000000 uImage
It should say it's OK and that it read about 600k from the sd card.
finally, boot the image:
bootm 0x60000000
If everything goes well, you should see a lot of text in the console, ending with "Hello from startup::stage2".
That's as far as I got today. More to come... Claudio
November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clk... _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Hi Claudio,
coincidentally, an ODROID XU board ended up on by desktop. I've enabled rudimentary support for it using Genode's hw kernel (not Fiasco.OC). Maybe, you'll profit from it when doing further research on top of Fiasco.OC. You can find an intermediate state in this topic branch:
https://github.com/skalk/genode/tree/odroid
Sadly, I couldn't find any resources about Exynos-5410's memory map, irqs, or clock tree beside the Linux kernel tree from "hardkernel" itself :-(.
Best regards Stefan
On 11/13/2013 02:31 AM, Claudio L. wrote:
Update: The crash happens while mapping memory, during the early stages of the bootstrap process, most likely due to differences in the chipset. I've already created all the makefiles and directories needed for a separate "odroidxu" target, for now just a copy of the arndale ones, and I'm ready to start coding. I created one spec called "exynos5octa", which will complement the existing "exynos5", on the few items where there are architectural differences in the SOC.
Claudio
On 11/06/2013 07:54, Claudio L. wrote:
Hello, I'm creating this thread where I'll report the status of my port of genode to the Odroid-XU board.
Initial bootstrap went well. Board executed the bootstrap and hung right after showing "Hello from startup::stage2", which is where most of the hardware initialization takes place. Here's where the real porting job begins.
For others with the XU board, here's what I did to test it:
- After having checked out genode repository, and installed the
additional packages per the genode instructions to build Fiasco.OC, install one more package:
apt-get install u-boot-tools
This will give us the mkimage command we need.
then, from the main genode directory:
cd base_foc make prepare cd .. ./tool/create_builddir foc_arndale BUILD_DIR=build.exynos cd build.exynos make
This make is just to see if you have anything missing. You should be able to get to the end without any errors. If not, something went wrong.
Now we need a small change to generate the uboot image:
cd build.exynos/etc
edit the file build.conf and add the line
RUN_OPT = --target uboot
then build the printf demo with:
make clean [[make sure you are in the build.exynos directory] make run/printf
If everything goes well, compile will end with an error saying it can't run automatically on this target. This is normal, since we never removed the lines in the run script that try to use qemu to run the test. The important thing is that in build.exynos/var/run/printf, there's a 'uImage' file.
Put the file on a microSD card, insert the card into the Odroid-XU. Connect to the serial console (I use the excellent Putty), configured as 115200, 8N1. The name of the serial port might vary, depending on which USB port the board was plugged in. To access the serial port, Putty might need to be run as root.
Boot the board and press space quickly to stop the boot process at u-boot (green light on the board should be on). Now issue the following commands:
mmc dev 1 fatload mmc 1 0x60000000 uImage
It should say it's OK and that it read about 600k from the sd card.
finally, boot the image:
bootm 0x60000000
If everything goes well, you should see a lot of text in the console, ending with "Hello from startup::stage2".
That's as far as I got today. More to come... Claudio
November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clk... _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clk... _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Thank you, Stefan Yes, there's absolutely no documentation about the 5410, so I'm relying on the Linux sources, which are not exactly friendly to extract information. Right now I've become quite busy but I'll make slow progress. I'll check out your sources, it's probably a much cleaner approach. I followed the topic where it seems that base-hw is the future of genode, so perhaps it's better to drop Fiasco and just write drivers and improve base-hw rather than trying to port Fiasco.OC. Thanks again for the help.
Claudio
On 11/26/2013 09:14, Stefan Kalkowski wrote:
Hi Claudio,
coincidentally, an ODROID XU board ended up on by desktop. I've enabled rudimentary support for it using Genode's hw kernel (not Fiasco.OC). Maybe, you'll profit from it when doing further research on top of Fiasco.OC. You can find an intermediate state in this topic branch:
https://github.com/skalk/genode/tree/odroid
Sadly, I couldn't find any resources about Exynos-5410's memory map, irqs, or clock tree beside the Linux kernel tree from "hardkernel" itself :-(.
Best regards Stefan
On 11/13/2013 02:31 AM, Claudio L. wrote:
Update: The crash happens while mapping memory, during the early stages of the bootstrap process, most likely due to differences in the chipset. I've already created all the makefiles and directories needed for a separate "odroidxu" target, for now just a copy of the arndale ones, and I'm ready to start coding. I created one spec called "exynos5octa", which will complement the existing "exynos5", on the few items where there are architectural differences in the SOC.
Claudio
On 11/06/2013 07:54, Claudio L. wrote:
Hello, I'm creating this thread where I'll report the status of my port of genode to the Odroid-XU board.
Initial bootstrap went well. Board executed the bootstrap and hung right after showing "Hello from startup::stage2", which is where most of the hardware initialization takes place. Here's where the real porting job begins.
For others with the XU board, here's what I did to test it:
- After having checked out genode repository, and installed the
additional packages per the genode instructions to build Fiasco.OC, install one more package:
apt-get install u-boot-tools
This will give us the mkimage command we need.
then, from the main genode directory:
cd base_foc make prepare cd .. ./tool/create_builddir foc_arndale BUILD_DIR=build.exynos cd build.exynos make
This make is just to see if you have anything missing. You should be able to get to the end without any errors. If not, something went wrong.
Now we need a small change to generate the uboot image:
cd build.exynos/etc
edit the file build.conf and add the line
RUN_OPT = --target uboot
then build the printf demo with:
make clean [[make sure you are in the build.exynos directory] make run/printf
If everything goes well, compile will end with an error saying it can't run automatically on this target. This is normal, since we never removed the lines in the run script that try to use qemu to run the test. The important thing is that in build.exynos/var/run/printf, there's a 'uImage' file.
Put the file on a microSD card, insert the card into the Odroid-XU. Connect to the serial console (I use the excellent Putty), configured as 115200, 8N1. The name of the serial port might vary, depending on which USB port the board was plugged in. To access the serial port, Putty might need to be run as root.
Boot the board and press space quickly to stop the boot process at u-boot (green light on the board should be on). Now issue the following commands:
mmc dev 1 fatload mmc 1 0x60000000 uImage
It should say it's OK and that it read about 600k from the sd card.
finally, boot the image:
bootm 0x60000000
If everything goes well, you should see a lot of text in the console, ending with "Hello from startup::stage2".
That's as far as I got today. More to come... Claudio
November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clk... _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clk... _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main