native gcc and external image mount example

Alexander Tormasov a.tormasov at innopolis.ru
Thu Jan 13 11:51:25 CET 2022


Hi Christian,

>> [init -> terminal] Error: bind to port 8888 failed
> 
> 1. It seems your configured 1 port for 2 clients. This will not work.
>   Please, configure different ports (or just one if you don't need
>   the VFS component, which failed to setup its connection anyway.

this is exactly my question - seems that I have to define policy for 2 connections - to /bin/bash and to vfs, why not 1?
                     <policy label_prefix="/bin/bash"  port="8888" />
                        <policy label_prefix="vfs" port="8888"/>
while I assume single chain like nic -> tcp_terminal -> bash 

Now I understand that implicitly I assume that tcp_terminal is like telnet server.
May be my assumption is wrong?

> 
> 2. You mention "localhost 5555" but the tcp_terminal should be
>   listening on 10.0.3.2 8888 according to the log.

sorry for misreport - initially I try to run on qemu + nova which configured for port 5555 and local host.
then I try to switch to linux. it give the same errors while run a bit faster, so, I now keep it (using linux tap driver)

for test above I definitely use "telnet 10.0.3.2 8888"

> 
> 3. As the configuration error must be in the configuration I can't
>   tell more without a look at the complete config.

below (I omit some portions of generated config file related to nic_drv platform/etc)

<config verbose="yes">
        <parent-provides>
                <service name="ROM"/>
                <service name="LOG"/>
                <service name="RM"/>
                <service name="CPU"/>
                <service name="PD"/>
                <service name="IRQ"/>
                <service name="IO_PORT"/>
                <service name="IO_MEM"/>
        </parent-provides>

        <default-route>
                <any-service> <parent/> <any-child/> </any-service>
        </default-route>

        <default caps="100"/>

        <start name="timer">
                <resource name="RAM" quantum="3M"/>
                <provides><service name="Timer"/></provides>
        </start>

        <start name="nic_drv" ld="no" caps="1000" managing_system="yes» >
...

        <start name="terminal" caps="200">
                <resource name="RAM" quantum="8M"/>
                <binary name="tcp_terminal"/>
                <provides> <service name="Terminal"/> </provides>
                <config>
                        <policy label_prefix="/bin/bash"  port="8888" />
                        <policy label_prefix="vfs" port="8888"/>
                        <vfs>
                                <dir name="dev">
                                        <!-- <log/> -->
                                        <inline name="rtc">2022-01-01 00:00</inline>
                                </dir>
                                <dir name="socket">
                                        <lwip dhcp="yes"/>
                                </dir>

                                <!-- pipe need for network polling -->
                                <dir name="pipe"> <pipe/> </dir>

                        </vfs>
                        <libc  stdout="/dev/log"  stderr="/dev/log"

                                pipe="/pipe"

                                rtc="/dev/rtc"

                        rng="/dev/random" socket="/socket">
                                <mmap local_area_default_size="1610612736"  />
                        </libc>
                </config>

                <route>
                        <service name="ROM" label="config"> <parent label="terminal.config"/> </service>
                        <service name="Nic"> <child name="nic_router"/> </service>
                        <any-service> <parent/> <any-child/> </any-service>
                </route>
        </start>

       <start name="vfs" caps="200">
                <resource name="RAM" quantum="124M"/>
                <provides> <service name="File_system"/> </provides>
                <config>
                        <vfs>
                                                                <tar name="bash.tar" />
                                <tar name="coreutils.tar" />
                                <tar name="grep.tar" />
                                <tar name="sed.tar" />
                                <tar name="findutils.tar" />
                                <tar name="make.tar" />
                                <tar name="which.tar" />
                                <tar name="binutils_x86.tar" />
                                <tar name="gcc_x86.tar" />
                                <tar name="tclsh.tar" />
                                <tar name="vim.tar" />

                                <dir name="dev">
                                        <zero/>
                                        <null/>
                                        <terminal/>
                                        <log/>
                                        <inline name="rtc">2022-01-01 00:01</inline>
                                </dir>
                                <dir name="pipe"> <pipe/> </dir>
                                <dir name="home">
                                        <ram/>
                                        <rom name=".bash_profile" label="bash_profile" binary="no"/>
                                </dir>
                                <dir name="share"> <dir name="vim"> <rom name="vimrc"/> </dir> </dir>
                                <dir name="genode"> <tar name="genode.tar"/> </dir>
                                <dir name="tmp"> <ram/> </dir>
                                <dir name="usr">
                                        <dir name="bin">
                                                <symlink name="make"  target="/bin/make" />
                                                <symlink name="mkdir" target="/bin/mkdir"/>
                                                <symlink name="echo"  target="/bin/echo" />
                                                <symlink name="tclsh" target="/bin/tclsh"/>
                                        </dir>
                                </dir>

                                <dir name="bin">
                                        <symlink name="nm" target="genode-x86-nm"/>
                                        <symlink name="sh" target="bash"/>
                                </dir>
                        </vfs>
                        <policy label_prefix="/bin/bash" root="/" writeable="yes" />
                        <default-policy root="/" writeable="yes"/>
                        <policy label_prefix="vfs_rom" root="/"/>
                </config>
                <route>
                        <service name="Terminal"> <child name="tcp_terminal"/> </service>
                        <service name="Timer"> <child name="timer"/> </service>
                        <any-service> <parent/> </any-service>
                </route>

        </start>
        <start name="vfs_rom">
                <resource name="RAM" quantum="60M"/>
                <binary name="fs_rom"/>
                <provides> <service name="ROM"/> </provides>
                <config/>
                <route>
                        <service name="File_system"> <child name="vfs"/> </service>
                        <any-service> <parent/> </any-service>
                </route>
        </start>

        <start name="/bin/bash" caps="2000">
                <resource name="RAM" quantum="300M" />
                <config ld_verbose="yes">
                        <libc stdin="/dev/terminal" stdout="/dev/terminal"
                              stderr="/dev/terminal"
                              rtc="/dev/rtc" pipe="/pipe"/>
                        <vfs>
                                <fs buffer_size="2M"/>
                                <dir name="dev"> <terminal/> <log/> <null/> </dir>
                                <inline name=".bash_profile">
                                        echo Welcome to bash Genode! > /dev/log
                                </inline>
                        </vfs>
                        <env key="HOME" value="/home"/>
                        <env key="PATH" value="/bin"/>
                        <env key="IGNOREEOF" value="3"/>
                        <arg value="/bin/bash"/>
                        <arg value="--login" />
                        <!-- <arg value="-c" /> -->
                        <!-- <arg value="echo files at /dev: /dev/* > /dev/terminal"/> -->
                </config>
                <route>
                        <service name="File_system"> <child name="vfs"/> </service>
                        <service name="ROM" label_suffix=".lib.so"> <parent/> </service>
                        <service name="ROM" label_last="/bin/bash">           <child name="vfs_rom"/> </service>
                        <service name="ROM" label_prefix="/genode/tool">      <child name="vfs_rom"/> </service>
                        <service name="ROM" label_prefix="/bin">              <child name="vfs_rom"/> </service>
                        <service name="ROM" label_prefix="/usr/bin">          <child name="vfs_rom"/> </service>
                        <service name="ROM" label_prefix="/libexec">          <child name="vfs_rom"/> </service>
                        <service name="ROM" label_prefix="/x86_64-pc-elf">    <child name="vfs_rom"/> </service>
                        <service name="ROM" label_prefix="/arm-none-eabi">    <child name="vfs_rom"/> </service>
                        <service name="ROM" label_prefix="/aarch64-none-elf"> <child name="vfs_rom"/> </service>

                        <any-service> <parent/> <any-child/> </any-service>
                </route>
        </start>

</config>




More information about the users mailing list