OSv and C applications

17 views
Skip to first unread message

DOR Nelly

unread,
Jul 1, 2019, 9:01:30 AM7/1/19
to osv...@googlegroups.com, in...@cloudius-systems.com
Hello,

I'm trying to use OSv with non-included C programs, so I naturally tried running OSv with one of the applications that are present in the OSv bundle first (eg groonga, cassandra, the java hello example, etc). I did follow the instructions on the README.md from the osv and the osv/apps folders, but those proved not to work effectively... especially the part about changing the "modules" section of the "config.json" file. When I modified it according to the README.md, I kept getting errors a "release.x64/modules/groonga" (for example) folder that was inexistant, so I simply deleted my modifications of the modules section and instead only added "groonga" to the "default" section. Only then did the script build generate an apparently groonga-enabled OSv image... which could be launched but displayed garbage and didn't recognize any usual command (eg ls, cd, etc).

Which brings me to my request : is there a document, aside from the README.md, describing how to create a working OSv image with one or more applications inside ? With precise steps, much like a tutorial...

Cheers,

Nelly DOR
 
  

Nadav Har'El

unread,
Jul 1, 2019, 12:30:05 PM7/1/19
to DOR Nelly, Waldek Kozaczuk, Osv Dev, in...@cloudius-systems.com
On Mon, Jul 1, 2019 at 4:01 PM DOR Nelly <Nell...@student.isae-supaero.fr> wrote:
Hello,

I'm trying to use OSv with non-included C programs, so I naturally tried running OSv with one of the applications that are present in the OSv bundle first (eg groonga, cassandra, the java hello example, etc).

To see a really minimal example, take a look at apps/native-example.
 
I did follow the instructions on the README.md from the osv and the osv/apps folders, but those proved not to work effectively... especially the part about changing the "modules" section of the "config.json" file.

The information in apps/README.md is completely outdated, and hasn't been touched in 6 years (!). I don't remember where we have newer information, Waldek, do you remember? Maybe in the wiki? We should definitely replace this README.md.

In reality, to build the "apps/native-example", all you need to do is to run "scripts/build image=native-example". Very easy.

The existing config.json already has:

    "repositories": [
        "${OSV_BASE}/apps",

Which means native-example is search in apps/.

 
When I modified it according to the README.md, I kept getting errors a "release.x64/modules/groonga" (for example) folder that was inexistant, so I simply deleted my modifications of the modules section and instead only added "groonga" to the "default" section. Only then did the script build generate an apparently groonga-enabled OSv image... which could be launched but displayed garbage and didn't recognize any usual command (eg ls, cd, etc).

Which brings me to my request : is there a document, aside from the README.md, describing how to create a working OSv image with one or more applications inside ? With precise steps, much like a tutorial...

Cheers,

Nelly DOR
 
  

--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/2a54-5d1a0400-db-3a470340%4028977614.
For more options, visit https://groups.google.com/d/optout.

Waldek Kozaczuk

unread,
Jul 2, 2019, 12:29:21 AM7/2/19
to OSv Development
Hi,


On Monday, July 1, 2019 at 12:30:05 PM UTC-4, Nadav Har'El wrote:
On Mon, Jul 1, 2019 at 4:01 PM DOR Nelly <Nell...@student.isae-supaero.fr> wrote:
Hello,

I'm trying to use OSv with non-included C programs, so I naturally tried running OSv with one of the applications that are present in the OSv bundle first (eg groonga, cassandra, the java hello example, etc).

To see a really minimal example, take a look at apps/native-example.
 
I did follow the instructions on the README.md from the osv and the osv/apps folders, but those proved not to work effectively... especially the part about changing the "modules" section of the "config.json" file.

The information in apps/README.md is completely outdated, and hasn't been touched in 6 years (!). I don't remember where we have newer information, Waldek, do you remember? Maybe in the wiki? We should definitely replace this README.md.

We are a small community of volunteers and there are too few of us to maintain the documentation properly as you have noticed. So, unfortunately, the documentation does not reflect reality in many cases. But we are looking to collaborate with anyone that volunteers to help update it ;-) At some point, I am planning to revamp it for the next release that hopefully will happen this month.
 
The most 2 up to date tutorials assume using capstan (Docker-like tool) to build OSv images -  
Please note that many old Wiki pages instruct to build the code as a shared library from the source. Fairly recently OSv has reached the state where it can run many completely unmodified Linux executables - PIEs as well as position-dependent ones. OSv does not support statically linked executables.

Finally there is fairly new shell script build/manifest_from_host.sh that can be used to build an image with arbitrary Linux executable from host. For details read comments in this commit - https://github.com/cloudius-systems/osv/commit/83128b2b10b641ab09892954eb2bdeffaea5e869.

If you have questions/difficulties please keep reaching to us. We might end up together revise some of this documentation.

Waldek


In reality, to build the "apps/native-example", all you need to do is to run "scripts/build image=native-example". Very easy.

The existing config.json already has:

    "repositories": [
        "${OSV_BASE}/apps",

Which means native-example is search in apps/.

 
When I modified it according to the README.md, I kept getting errors a "release.x64/modules/groonga" (for example) folder that was inexistant, so I simply deleted my modifications of the modules section and instead only added "groonga" to the "default" section. Only then did the script build generate an apparently groonga-enabled OSv image... which could be launched but displayed garbage and didn't recognize any usual command (eg ls, cd, etc).

Which brings me to my request : is there a document, aside from the README.md, describing how to create a working OSv image with one or more applications inside ? With precise steps, much like a tutorial...

Cheers,

Nelly DOR
 
  

--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv...@googlegroups.com.

Waldek Kozaczuk

unread,
Aug 2, 2019, 5:53:33 PM8/2/19
to OSv Development
Hi,

I have revised the main osv-apps readme - https://github.com/cloudius-systems/osv-apps#osv-applications - so hopefully it should be easier to use this repo. Also, there is this "unofficial" repo with set of Docker files to help you setup OSv development - https://github.com/wkozaczuk/docker_osv_builder.
Reply all
Reply to author
Forward
0 new messages