"Or alternatively, how about taking the lack of nano as a wonderful opportunity to learn (and learn loving) vim, hehe... :-)"
I (nano nano) agree.
----- Original Message ----- From: Norman Feske Sent: 01/28/13 09:06 AM To: genode-main@lists.sourceforge.net Subject: Re: build directory outside of Genode dir xor vim error
Hi Paul,
First change: staging rather than master.
this is not recommended. We often change the commits that are on staging but not yet merged into master. Hence, using staging will be pretty messy on your side. If you like to use a particular commit that is only available on staging, better create a new branch of master and cherry-pick the single commit:
git checkout -b <name-of-your-branch> genodelabs/master git cherry-pick <commit-id>
Second change: try make run/noux_bash
Third change: ./tool/create_builddir linux_x86 BUILD_DIR="./build.lx" rather than the usual: ./tool/create_builddir linux_x86 BUILD_DIR="build.lx"
Both variants should work. I just tried them - they produce exactly the same build directory.
About third change, result in make run/noux_bash to: Program core/core make[1]: Leaving directory `/home/paul/build.lx' genode build completed
I think you missed some steps that are needed prior running the run/noux_bash.run script.
First, can you check that you enabled the 'libports', 'ports', and 'gems' repositories in your '<build-dir>/etc/build.conf' file?
You will also need to download several 3rd-party source codes in 'libports' and 'ports' respectively. I guess that the build system has printed a couple of messages like the following, has it?
Skip target noux-pkg/bash because it requires prepare_bash Skip target noux-pkg/coreutils because it requires prepare_coreutils Skip target noux-pkg/vim because it requires prepare_vim
These messages indicate that the said 3rd-party codes are not available. To rectify the problem, please issue the following commands:
cd <genode-dir>/ports make prepare PKG='bash coreutils vim'
You will also need to download some code in libports, i.e., the libc and ncurses:
cd <genode-dir>/libports make prepare PKG='libc ncurses'
find: `bin/coreutils/': No such file or directory
That is because of the missing 'make prepare' steps mentioned above.
couldn't open "bin/vim/share/vim/vimrc": no such file or directory
When built successfully, the so-called noux packages (such as coreutils, bash, and vim) will end up being installed at '<build-dir>/bin/<noux-package-name>'. Because the build system skipped those packages in your case, these directories do not exist. However, the run script expects them to be present after having completed the build step. When it tries to generate a vimrc file at the '<build-dir>/bin/vim/share/vim/vimrc', it fails because the surrounding directory does not exist.
Maybe it would be a good idea to let the run script detect this condition and print a more meaningful error message?
I need my own vim configuration file?
The run script generates a vim configuration file for you.
I am not too used to vim... I prefer nano.
The 'noux_bash.run' script generates a system that consists only of coreutils, bash, and vim. It is just an example and is meant as a starting point for creating customized systems. For example, the noux_tool_chain* scripts describe much more sophisticated system scenarios including gcc and binutils.
There is currently no noux package for nano. So you would need to port nano first before being able to integrate it. If you like to give it a try, look for the way how a simple noux package such as GNU make is integrated in the 'ports' repository. Depending on the package, the porting work may involve slight refinements of the libc or noux, or will even require you to port additional libraries first. Of course, you will also need to modify the run script accordingly. You are welcome to give it a shot.
Or alternatively, how about taking the lack of nano as a wonderful opportunity to learn (and learn loving) vim, hehe... :-)
Cheers Norman
-- Dr.-Ing. Norman Feske Genode Labs
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Ok, made make clean then make run/bash_noux still on staging.
I now have the bash window: base-4.1# ls
Maybe it was not a correct command to ask for, because the system seems to be hang there: [init -> terminal] int main(int, char**): --- terminal service started --- [init -> noux] --- noux started --- [init -> noux] tar archive 'coreutils.tar' local at 2b212ec97000, size is 9676800 [init -> noux] tar archive 'vim.tar' local at 2b212f5e2000, size is 22056960 [init] child "timer" announces service "Timer" [init -> noux] tar archive 'bash.tar' local at 2b2130b4b000, size is 3604480 [init] child "ram_fs" announces service "File_system" Quota exceeded! amount=4096, size=4096, consumed=4096 [init -> ram_fs] upgrading quota donation for SIGNAL session Quota exceeded! amount=4096, size=4096, consumed=4096 [init -> noux] upgrading quota donation for SIGNAL session Quota exceeded! amount=8192, size=4096, consumed=8192 [init -> ram_fs] upgrading quota donation for SIGNAL session Quota exceeded! amount=8192, size=4096, consumed=8192 [init -> noux] upgrading quota donation for SIGNAL session Quota exceeded! amount=12288, size=4096, consumed=12288 [init -> ram_fs] upgrading quota donation for SIGNAL session Quota exceeded! amount=12288, size=4096, consumed=12288 [init -> noux] upgrading quota donation for SIGNAL session [init -> noux] created main thread [init -> noux] arg(0): "/bin/bash" [init -> fb_sdl] creating virtual framebuffer for mode 1024x768@...64... [init] child "fb_sdl" announces service "Framebuffer" [init] child "fb_sdl" announces service "Input" [init -> terminal] cell size is 6x14 [init] child "terminal" announces service "Terminal" [init -> terminal] create terminal session [init -> terminal] new terminal session: [init -> terminal] framebuffer has 1024x768 pixels [init -> terminal] character size is 6x14 pixels [init -> terminal] terminal size is 170x54 characters [init -> noux] invalid opcode 14 [init -> noux -> /bin/bash] Starting ldso ... [init -> noux -> /bin/bash] Starting application ... environ: 7fff966b7628 [init -> noux -> /bin/bash] unsupported ioctl (request=0x80106678) [init -> noux -> /bin/bash] DUMMY sbrk(): sbrk called, not implemented [init -> noux -> /bin/bash] DUMMY endpwent(): endpwent called, not implemented [init -> noux -> /bin/bash] DUMMY getppid(): getppid called, not implemented ^C^C ^C^C^C^C^C
Hi Paul,
On 01/28/2013 06:34 PM, Paul Dufresne wrote:
Ok, made make clean then make run/bash_noux still on staging.
I now have the bash window: base-4.1# ls
Maybe it was not a correct command to ask for, because the system seems to be hang there:
sorry, I forgot to mention that noux_bash does not work on base-linux. On this platform, fork is not implemented. So the bash shell cannot spawn the 'ls' child process. I just expected that you are still on NOVA.
Could you give it a try on one of the microkernel-based platforms (e.g., foc, nova, pistachio, or okl4)?
Cheers Norman
I have so much problems right now. Still on staging... not sure for how long.
On foc? The make prepare was so long, that I decided I did not want to try to build that. The make prepare seems to prepare vim, download uclibc (with a libc that seems to prepare to run on Linux and others). At first, seeing some good documentation was fun. But seeing it download all the stuff in base-foc/contrib/l4/pkg make me afraid. I really don't understand why all that is needed for Genode.
On nova: paul@...162...:~$ cd build.nova32 paul@...162...:~/build.nova32$ make run/noux_bash using run script --include couldn't read file "--include": no such file or directory while executing "source $include_name" ("foreach" body line 3) invoked from within "foreach include_name [get_cmd_arg --include ""] { puts "using run script $include_name" source $include_name }" (file "/home/paul/mygenode/tool/run" line 508) make: *** [run/noux_bash] Error 1 paul@...162...:~/build.nova32$
It looks a bit like my run tool is corrupted. Maybe I would need to make cleanall and retry.
On Pistachio. I liked the make prepare that got 5.6 MiB, was ok. Program core/x86/core make[1]: Leaving directory `/home/paul/build.pistachio' genode build completed cp: cannot stat `/home/paul/build.pistachio/l4/util/kickstart/kickstart': No such file or directory while executing "exec cp [pistachio_user_dir]/util/kickstart/kickstart [run_dir]/pistachio" (procedure "build_boot_image" line 12) invoked from within "build_boot_image $boot_modules" (file "/home/paul/mygenode/ports/run/noux_bash.run" line 201) invoked from within "source $include_name" ("foreach" body line 3) invoked from within "foreach include_name [get_cmd_arg --include ""] { puts "using run script $include_name" source $include_name }" (file "/home/paul/mygenode/tool/run" line 508) make: *** [run/noux_bash] Error 1 paul@...162...:~/build.pistachio$
Yes, I could try okl4 now.
And make run/noux_bash on okl4: COMPILE main.o In file included from /home/paul/mygenode/base/src/core/main.cc:24:0: /home/paul/mygenode/base/src/core/include/core_env.h:121:33: error: cannot declare field ‘Genode::Core_env::_rm_session’ to be of abstract type ‘Genode::Core_rm_session’ In file included from /home/paul/mygenode/base-okl4/src/core/include/platform.h:24:0, from /home/paul/mygenode/base/src/core/main.cc:23: /home/paul/mygenode/base-okl4/src/core/include/core_rm_session.h:30:8: note: because the following virtual functions are pure within ‘Genode::Core_rm_session’: In file included from /home/paul/mygenode/base/include/base/env.h:22:0, from /home/paul/mygenode/base/include/base/service.h:21, from /home/paul/mygenode/base/src/core/main.cc:17: /home/paul/mygenode/base/include/rm_session/rm_session.h:172:16: note: virtual void Genode::Rm_session::remove_client(Genode::Pager_capability) make[3]: *** [main.o] Error 1 make[2]: *** [core.prg] Error 2 make[1]: *** [gen_deps_and_build_targets] Error 2 make[1]: Leaving directory `/home/paul/build.okl4' Error: Genode build failed make: *** [run/noux_bash] Error 252 paul@...162...:~/build.okl4$
While trying the different 'platforms' (kernels), the build system seems a bit unoptimized. To me, rebuilding libports, ports, gems in each different kernels don't make much sense. I don't expect them to apply patch platform-specifics, only Genode-specifics. So it would make sense to specify two directory on create_builddir: one common for all platforms, and one for the platform.
Hi Paul,
On foc? The make prepare was so long, that I decided I did not want to try to build that. The make prepare seems to prepare vim, download uclibc (with a libc that seems to prepare to run on Linux and others). At first, seeing some good documentation was fun. But seeing it download all the stuff in base-foc/contrib/l4/pkg make me afraid. I really don't understand why all that is needed for Genode.
frankly, it isn't. Genode only uses three tiny bits of that code, namely Fiasco.OC (the kernel), bootstrap (a small program only used at boot time), and sigma0 (a simple manager for physical memory). Unfortunately, the latter two components depend on a few header files and library functions of the other l4/pkg packages. For example, bootstrap uses string functions provided by uclibc. Hence, uclibc must be downloaded (and built) prior compiling bootstrap. But since there is no option to only build the parts of uclibc that are actually needed by bootstrap, the whole package is built. I agree that it feels a bit awkward to download and build all the stuff just for using a microkernel. However, the Fiasco.OC developers see no value in decoupling the Fiasco.OC kernel (and bootstrap and sigma0 respectively) from their L4re userland. So they leave it as is. Of course, we could fork it and cut off those dependencies. But then, we needed to maintain the fork. So we can decide whether to live with the inconvenience of downloading and building too much stuff, or to maintain a fork. Up to now, we decided against the fork.
On nova: paul@...162...:~$ cd build.nova32 paul@...162...:~/build.nova32$ make run/noux_bash using run script --include
This looks like your build directory is somehow broken. Haven't you built the run/demo for NOVA before? I wonder what happened to your build directory. Please try again, taking one step after the other.
1. use tool/create_build_dir nova_x86_32 to create a fresh build directory 2. try out run/demo 3. enable the libports, ports, and gems repositories in your <build-dir>/etc/build.conf 4. try out run/noux_bash
If one of those steps fails, check back with me.
On Pistachio. I liked the make prepare that got 5.6 MiB, was ok. Program core/x86/core make[1]: Leaving directory `/home/paul/build.pistachio' genode build completed cp: cannot stat `/home/paul/build.pistachio/l4/util/kickstart/kickstart': No such file or directory
It seems that your build directory is in an inconsistent state. I guess you have tried to do run/noux_bash, then noticed that your forgot to prepare the base-pistachio repository, and then after preparing, tried run/noux_bash again. To be on the safe side, please do a 'make cleanall' in your build directory after preparing a kernel.
I will try to explain what is going on. The run tool does not build the kernel on each run. Checking those dependencies would take a really long time on some platforms such as Fiasco.OC. This time delays the workflow but since the kernel rarely changes, it is largely wasted. Therefore, the run tool issues the build of the kernel only once. If it detects that there is already a 'kernel' directory, it skips building the kernel. In your case, the first attempt to build pistachio failed but it nevertheless left an incomplete 'kernel' sub directory in your build directory. So the next time, you called run/noux_bash, the kernel wasn't rebuilt.
I don't know a good solution of how to improve the situation. We could refine the heuristics but they will still not capture all possible cases.
And make run/noux_bash on okl4: COMPILE main.o In file included from /home/paul/mygenode/base/src/core/main.cc:24:0: /home/paul/mygenode/base/src/core/include/core_env.h:121:33: error: cannot declare field ‘Genode::Core_env::_rm_session’ to be of abstract type ‘Genode::Core_rm_session’
You are using staging, aren't you? This error is a good reason not to do that.
Let me explain the role of the staging branch. The only user of this branch is the automated building and testing infrastructure at Genode Labs. Before we incorporate changes into the master branch, we put them into the staging branch. Each night, this branch gets automatically built for all base platforms and a series of automated tests is executed (those run scripts listed at 'tool/autopilot.list') on almost all of the kernels. Only if those build and runtime tests succeed, we merge those chances into the master branch. Consequently, the staging branch is almost expected to fail when doing complex changes that affect different base platforms. If this happens, we fix up the corresponding commits in the staging branch until all tests succeed.
In short, you hit a typical issue that will be fixed shortly at the staging branch.
While trying the different 'platforms' (kernels), the build system seems a bit unoptimized. To me, rebuilding libports, ports, gems in each different kernels don't make much sense. I don't expect them to apply patch platform-specifics, only Genode-specifics. So it would make sense to specify two directory on create_builddir: one common for all platforms, and one for the platform.
That would be cool but it is not possible.
Even though those libraries look like being the same for each base platform, they are different. At compile time, those libraries ultimately depend on platform-specific header files (e.g., the kernel's syscall bindings). So a library built for one kernel will typically not work on another kernel because it would try to call kernel functions in wrong ways. In theory, all those kernel-specific things could be encapsulated in a single kernel-specific library with an interface that hides all kernel details. But in practice, this would be extremely difficult and the extra indirection needed for that would certainly imply runtime overheads. In my opinion, the little added value of such a feature does not justify opening a big can of problems.
I hope, my explanations are helpful to shed some light on how the build system works. Thanks for your patience.
Cheers Norman
Norman Feske said: --- This looks like your build directory is somehow broken. Haven't you built the run/demo for NOVA before? I wonder what happened to your build directory. Please try again, taking one step after the other.
1. use tool/create_build_dir nova_x86_32 to create a fresh build directory 2. try out run/demo 3. enable the libports, ports, and gems repositories in your <build-dir>/etc/build.conf 4. try out run/noux_bash
If one of those steps fails, check back with me. --- run/demo did work fine.
but run/noux_bash now hang in Qemu, after showing the second line about processor: [ 0] Core 0:0:0 ...
Terminal that launced Qemu have: int main(): --- start init --- int main(): transferred 327 MB to init int main(): --- init created, waiting for exit condition --- [init] parent provides [init] service "ROM" [init] service "LOG" [init] service "CAP" [init] service "RAM" [init] service "RM" [init] service "CPU" [init] service "PD" [init] service "IRQ" [init] service "IO_PORT" [init] service "IO_MEM" [init] service "SIGNAL" [init] child "timer" [init] RAM quota: 884736 [init] ELF binary: timer [init] priority: 0 [init] provides service Timer [init] child "pci_drv" [init] RAM quota: 884736 [init] ELF binary: pci_drv [init] priority: 0 [init] provides service PCI [init] child "vesa_drv" [init] RAM quota: 884736 [init] ELF binary: vesa_drv [init] priority: 0 [init] provides service Framebuffer [init] child "ps2_drv" [init] RAM quota: 884736 [init] ELF binary: ps2_drv [init] priority: 0 [init] provides service Input [init] child "terminal" [init] RAM quota: 1933312 [init] ELF binary: terminal [init] priority: 0 [init] provides service Terminal [init] child "ram_fs" [init] RAM quota: 10321920 [init] ELF binary: ram_fs [init] priority: 0 [init] provides service File_system [init] Warning: Specified quota exceeds available quota. [init] Proceeding with a quota of 326463488 bytes. [init] child "noux" [init] RAM quota: 326299648 [init] ELF binary: noux [init] priority: 0 [init -> pci_drv] PCI driver started [init -> noux] --- noux started --- [init -> terminal] int main(int, char**): --- terminal service started --- [init -> ps2_drv] Detected ExPS/2 mouse - activating scroll-wheel and 5-button support. [init -> ps2_drv] Using keyboard with scan code set 1 (xlate). [init -> noux] tar archive 'coreutils.tar' local at 2000, size is 9175040 [init -> timer] Timer::Timeout_scheduler::Timeout_scheduler(Platform_timer*, Genode::Rpc_entrypoint*): starting timeout scheduler [init] child "timer" announces service "Timer" [init -> vesa_drv] int Framebuffer_drv::map_io_mem(Genode::addr_t, Genode::size_t, bool, void**, Genode::addr_t, Genode::Dataspace_capability*): fb mapped to 107a000 [init] child "vesa_drv" announces service "Framebuffer" [init -> vesa_drv] Could not open file "config" [init -> vesa_drv] Could not obtain config file [init -> noux] tar archive 'vim.tar' local at 108a000, size is 19898368 [init] child "pci_drv" announces service "PCI" [init] child "ps2_drv" announces service "Input"
Thing that was odd at build time: -vim saying that it was mapping to address 0 -bash complaining that libint.a , libint.h was missing
Freshly updated staging... you you convinced me... it is just a matter as going back to master.
Heuh... just build for pistachio, and include a bit the message I noted above: (citing pistachio messages, I remember was pretty the same for nova_x86_32) Program noux-pkg/bash/bash CONFIG bash BUILD bash [bash] making lib/intl/libintl.a in ./lib/intl [bash] cmp: libintl.h: No such file or directory [bash] [bash] *********************************************************** [bash] * * [bash] * GNU bash, version 4.1.0(1)-release (x86_64-pc-elf) [bash] * * [bash] *********************************************************** [bash] [bash] /home/paul/mygenode/ports/contrib/bash-4.1/expr.c:177:17: warning: conflicting types for built-in function ‘exp2’ [enabled by default]
2/32/libgcc.a -lncurses [vim] link.sh: Linked fine, no libraries can be omitted [vim] /usr/local/genode-gcc/bin/../lib/gcc/x86_64-elf/4.7.2/../../../../x86_64-elf/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000300000 INSTALL vim
I was finding weird that bash talk about x86_64_elf for a 32 bits platform. I said libint.h but it was libintl.h. Seems vim default to 300000 not 0, suppose it is ok.
Now I am happy to report that after a make cleanall, bash seems to work not too bad on Pistachio. Well, asking du did hang. vim started, and seems to work, but was not able to type the : escaping. Esc :q enter does nothing ... : does not move to bottom, and show nothing.
Now that the bug I had in staging with okl4 is fixed, make run noux_bash work quite similarly on OKL4 than on Pistachio.
cannot Esc :q in vim either
lots of could not unmap page errors in the terminal.
But overall, yes it does work quite a bit.
Hello,
On 01/29/2013 02:32 PM, Paul Dufresne wrote:
Now that the bug I had in staging with okl4 is fixed, make run noux_bash work quite similarly on OKL4 than on Pistachio.
cannot Esc :q in vim either
lots of could not unmap page errors in the terminal.
But overall, yes it does work quite a bit.
the "noux_bash" run script sets a german keyboard layout for the terminal. Could that be the problem?
Christian
Ah, sure it must be it! Let me check that.
Yes, vim works better now. :-)
Hi,
What did you do to resolve the keyboard issue ? Im away at the moment and cant investigate but it might be useful to share that knowledge for posterity.
Kt.
On 29 January 2013 15:26, Paul Dufresne <dufresnep@...9...> wrote:
Yes, vim works better now. :-)
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d _______________________________________________ Genode-main mailing list Genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
https://github.com/genodelabs/genode/blob/master/ports/run/noux_bash.run line 123 I changed "de" to "us".
Of course, this change affect only make run/noux_bash After that, ":" key was where I expected it to be on my keyboard. Don't search too much, the code up to now seems to know only "de" and not "de".
But I am/was still unable to type Ctrl-] in the help to select a topic. Might be that Ctrl is not where I expect it yet.