{"id":20826643,"url":"https://github.com/includeos/hello_world","last_synced_at":"2025-04-10T02:52:31.213Z","repository":{"id":82454774,"uuid":"177632339","full_name":"includeos/hello_world","owner":"includeos","description":"Basic IncludeOS example","archived":false,"fork":false,"pushed_at":"2024-11-22T13:06:01.000Z","size":22,"stargazers_count":11,"open_issues_count":4,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T04:22:30.564Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/includeos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-25T17:22:23.000Z","updated_at":"2024-12-30T08:56:37.000Z","dependencies_parsed_at":"2025-01-18T17:48:40.666Z","dependency_job_id":"2fc645ec-8595-456a-9b44-ef8a4395d4f9","html_url":"https://github.com/includeos/hello_world","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/includeos%2Fhello_world","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/includeos%2Fhello_world/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/includeos%2Fhello_world/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/includeos%2Fhello_world/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/includeos","download_url":"https://codeload.github.com/includeos/hello_world/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248147122,"owners_count":21055479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T23:09:40.060Z","updated_at":"2025-04-10T02:52:31.204Z","avatar_url":"https://github.com/includeos.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IncludeOS Hello World\nA basic example to demonstrate the open source unikernel project - [IncludeOS](https://github.com/includeos/includeos).\n\nIncludeOS is built with [nix](https://nixos.org). Before building the example\nyou need a working nix-installation. To speed up the build process, we also\nrecommend having [ccache enabled](https://nixos.wiki/wiki/CCache) installed, but this is\nnot a requirement. To use ccache, add `--arg withCcache true` to the nix commands below.\n\nThe source code for the example is in `./src/main.cpp`. It prints \"Hello world\" and calls shutdown:\n```c++\n$ cat ./src/main.cpp\n#include \u003ciostream\u003e\n#include \u003cos\u003e\n\nint main(){\n  std::cout \u003c\u003c \"Hello world\\n\";\n  os::shutdown();\n}\n```\n\nThe following steps let you build and boot this example with IncludeOS.\n\n```bash\n$ nix-build\n```\n\nThis will download and build the latest IncludeOS libraries and their\ndependencies and build the `hello-world` service. The final binary will be\ncalled `hello.bin.elf` in `./result/bin`.\n\n```bash\n$ ls ./result/bin\nhello.elf.bin\n```\n\nTo boot the unikernel you need to add a bootloader or use the IncludeOS\nchainloader. The separate tool\n[vmrunner](https://github.com/includeos/vmrunner), can be used to automatically\nmanage this. QEMU and `vmrunner` is already configured in `shell.nix`.\n\nTo boot the unikernel, run\n\n```\n$ nix-shell --command \"boot ./result/bin/hello.elf.bin\"\n[...]\nELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped\n\nSeaBIOS (version rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org)\n\n\niPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+06FD0E60+06F30E60 CA00\nPress Ctrl-B to configure iPXE (PCI 00:03.0)...\n\n\nBooting from ROM..* Multiboot begin: 0x9500\n* Multiboot cmdline @ 0x29d02e: /nix/store/jd9dhri62mz7lm5mld58c7c1wn2dsnbx-chainloader-static-i686-unknown-linux-musl-dev/bin/chainloader \"\"\n* Multiboot end: 0x29d09c\n* Module list @ 0x29d000\n\t * Module @ 0x29e000\n\t * Args: ./result/bin/hello.elf.bin \"\"\n \t * End: 0x43d6c0\n * Multiboot end: 0x43d6c0\n* ELF syms header CRC OK\n\u003cMultiboot\u003eBooted with multiboot\n\t* Boot flags: 0x24f\n\t* Valid memory (130559 Kib):\n\t  0x00000000 - 0x0009fbff (639 Kib)\n\t  0x00100000 - 0x07fdffff (129920 Kib)\n\n\t* Booted with parameters @ 0x29d02e: /nix/store/jd9dhri62mz7lm5mld58c7c1wn2dsnbx-chainloader-static-i686-unknown-linux-musl-dev/bin/chainloader \"\"\n\t* Multiboot provided memory map  (7 entries @ 0x9000)\n\t  0x0000000000 - 0x000009fbff FREE (639 Kb.)\n\t  0x000009fc00 - 0x000009ffff RESERVED (1 Kb.)\n\t  0x00000f0000 - 0x00000fffff RESERVED (64 Kb.)\n\t  0x0000100000 - 0x0007fdffff FREE (129920 Kb.)\n\t  0x0007fe0000 - 0x0007ffffff RESERVED (128 Kb.)\n\t  0x00fffc0000 - 0x00ffffffff RESERVED (256 Kb.)\n\t  0x0000000000 - 0x00ffffffff RESERVED (0 Kb.)\n\n\u003cMultiboot\u003eOS loaded with 1 modules\n\t* ./result/bin/hello.elf.bin \"\" @ 0x29e000 - 0x43d6c0, size: 1701568b\n* Multiboot begin: 0x9500\n* Multiboot end: 0x3e59c0\n[x86_64 PC] constructor\n[ Machine ] Initializing heap\n[ Machine ] Main memory detected as 129998656 b\n[ Machine ] Reserving 1048576 b for machine use\n\u003cMultiboot\u003eBooted with multiboot\n\t* Boot flags: 0x24f\n\t* Valid memory (130559 Kib):\n\t  0x00000000 - 0x0009fbff (639 Kib)\n\t  0x00100000 - 0x07fdffff (129920 Kib)\n\n\t* Booted with parameters @ 0x8000: ./result/bin/hello.elf.bin \"\"\n\t* Multiboot provided memory map  (7 entries @ 0x9000)\n\t  0x0000000000 - 0x000009fbff FREE (639 Kb.)\n\t  0x000009fc00 - 0x000009ffff RESERVED (1 Kb.)\n\t  0x00000f0000 - 0x00000fffff RESERVED (64 Kb.)\n\t  0x0000100000 - 0x0007fdffff FREE (129920 Kb.)\n\t  0x0007fe0000 - 0x0007ffffff RESERVED (128 Kb.)\n\t  0x00fffc0000 - 0x00ffffffff RESERVED (256 Kb.)\n\t  0xfd00000000 - 0xffffffffff RESERVED (12582912 Kb.)\n\n================================================================================\n IncludeOS VERY_DIRTY (x86_64 / 64-bit)\n +--\u003e Running [ Hello world - OS included ]\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n +--\u003e WARNING: No good random source found: RDRAND/RDSEED instructions not available.\n +--\u003e        To make this warning fatal, re-compile with FOR_PRODUCTION=ON.\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nHello world\n       [ main ] returned with status 0\n     [ Kernel ] Stopping service\n     [ Kernel ] Powering off\n\n[ SUCCESS ] process exited\n```\n\nYou can also use `shell.nix` to rebuild and boot the unikernel during\ndevelopment, without having to invoke `nix-shell` every time. Just run\n`nix-shell` and follow the instructions:\n\n```\n$ nix-shell\nTo build the hello_world unikernel:\n cmake src/CMakeLists.txt -B ./build\n cd ./build\n make\n boot ./hello.elf.bin\n```\n\nFor more details on how to develop with IncludeOS see the [main\nrepository](https://github.com/includeos/includeos.git).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fincludeos%2Fhello_world","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fincludeos%2Fhello_world","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fincludeos%2Fhello_world/lists"}