├── .github └── FUNDING.yml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── .travis └── cirp │ ├── check_precondition.sh │ ├── cleanup1.sh │ ├── cleanup2.sh │ ├── cleanup3.sh │ ├── cleanup4.sh │ ├── cleanup5.sh │ ├── collect.sh │ ├── install.sh │ ├── publish.sh │ └── store.sh ├── CODINGSTYLE.md ├── CONTRIBUTING ├── Doxyfile ├── LICENSE ├── Makefile ├── PORTING ├── README.md ├── arch ├── aarch64 │ ├── arch-cpu.cc │ ├── arch-cpu.hh │ ├── arch-dtb.cc │ ├── arch-dtb.hh │ ├── arch-elf.cc │ ├── arch-elf.hh │ ├── arch-interrupt.hh │ ├── arch-mmu.hh │ ├── arch-pci.hh │ ├── arch-setup.cc │ ├── arch-setup.hh │ ├── arch-switch.hh │ ├── arch-thread-state.hh │ ├── arch-tls.hh │ ├── arch-trace.cc │ ├── arch-trace.hh │ ├── arch.hh │ ├── arm-clock.cc │ ├── arm-clock.hh │ ├── backtrace.cc │ ├── boot.S │ ├── clone.cc │ ├── cpuid.cc │ ├── cpuid.hh │ ├── dump.cc │ ├── dump.hh │ ├── early-console.cc │ ├── early-console.hh │ ├── elf-dl.S │ ├── entry.S │ ├── exceptions.cc │ ├── exceptions.hh │ ├── feexcept.cc │ ├── firmware.cc │ ├── gic-common.cc │ ├── gic-common.hh │ ├── gic-v2.cc │ ├── gic-v2.hh │ ├── gic-v3.cc │ ├── gic-v3.hh │ ├── hypercall.S │ ├── hypervisor.cc │ ├── interrupt.cc │ ├── loader.ld │ ├── macros.S │ ├── memcpy.S │ ├── memmove.S │ ├── memset.S │ ├── mmu.cc │ ├── msi.cc │ ├── pci.cc │ ├── power.cc │ ├── preboot.S │ ├── preboot.ld │ ├── processor.hh │ ├── psci.cc │ ├── psci.hh │ ├── safe-ptr.hh │ ├── sched.S │ ├── signal.cc │ ├── smp.cc │ ├── tlsdesc.S │ ├── xen.cc │ └── xen.hh ├── common │ ├── fault-fixup.hh │ ├── pci-config.hh │ └── smp.hh └── x64 │ ├── apic-clock.cc │ ├── apic.cc │ ├── apic.hh │ ├── arch-cpu.cc │ ├── arch-cpu.hh │ ├── arch-elf.cc │ ├── arch-elf.hh │ ├── arch-interrupt.hh │ ├── arch-mmu.hh │ ├── arch-pci.hh │ ├── arch-setup.cc │ ├── arch-setup.hh │ ├── arch-switch.hh │ ├── arch-thread-state.hh │ ├── arch-tls.hh │ ├── arch-trace.cc │ ├── arch-trace.hh │ ├── arch.hh │ ├── backtrace.cc │ ├── boot.S │ ├── boot16.S │ ├── boot16.ld │ ├── cfi.S │ ├── clone.cc │ ├── cpuid.cc │ ├── cpuid.hh │ ├── dmi.cc │ ├── dmi.hh │ ├── dump.cc │ ├── dump.hh │ ├── early-console.cc │ ├── early-console.hh │ ├── elf-dl.S │ ├── entry-xen.S │ ├── entry.S │ ├── exceptions.cc │ ├── exceptions.hh │ ├── feexcept.cc │ ├── firmware.cc │ ├── hypervisor.cc │ ├── interrupt.cc │ ├── ioapic.cc │ ├── ioapic.hh │ ├── loader.ld │ ├── lzloader.ld │ ├── memcpy_decode.hh │ ├── mmu.cc │ ├── msi.cc │ ├── msr.hh │ ├── pci.cc │ ├── power.cc │ ├── prctl.cc │ ├── processor-flags.h │ ├── processor.hh │ ├── pvclock-abi.cc │ ├── pvh-boot.cc │ ├── safe-ptr.hh │ ├── signal.cc │ ├── smp.cc │ ├── sse.hh │ ├── string-ssse3.cc │ ├── string.cc │ ├── syscall.S │ ├── syscall.hh │ ├── tls-switch.hh │ ├── tlsdesc.S │ ├── vmlinux-boot64.S │ ├── vmlinux.cc │ ├── vmlinuz-boot.ld │ ├── vmlinuz-boot32.S │ ├── xen.cc │ └── xen.hh ├── bootfs.S ├── bootfs.manifest.skel ├── bootfs_empty.manifest.skel ├── bsd ├── aarch64 │ └── machine │ │ ├── _align.h │ │ ├── _inttypes.h │ │ ├── atomic.h │ │ ├── bus.h │ │ ├── clock.h │ │ ├── cpufunc.h │ │ ├── endian.h │ │ ├── frame.h │ │ ├── in_cksum.cc │ │ ├── in_cksum.h │ │ ├── intr_machdep.h │ │ ├── param.h │ │ ├── pcpu.h │ │ ├── resource.h │ │ ├── stdarg.h │ │ ├── vmparam.h │ │ └── xen │ │ ├── hypercall.h │ │ ├── synch_bitops.h │ │ └── xen-os.h ├── cddl │ ├── compat │ │ └── opensolaris │ │ │ ├── include │ │ │ ├── devid.h │ │ │ ├── fsshare.h │ │ │ ├── libshare.h │ │ │ ├── mnttab.h │ │ │ ├── priv.h │ │ │ ├── sha2.h │ │ │ ├── solaris.h │ │ │ ├── thread_pool.h │ │ │ └── zone.h │ │ │ ├── lib │ │ │ └── libumem │ │ │ │ └── umem.h │ │ │ └── misc │ │ │ ├── mkdirp.c │ │ │ └── zmount.c │ ├── contrib │ │ └── opensolaris │ │ │ ├── cmd │ │ │ ├── stat │ │ │ │ └── common │ │ │ │ │ └── statcommon.h │ │ │ ├── zdb │ │ │ │ ├── zdb.8 │ │ │ │ ├── zdb.c │ │ │ │ └── zdb_il.c │ │ │ ├── zfs │ │ │ │ ├── zfs.8 │ │ │ │ ├── zfs_iter.c │ │ │ │ ├── zfs_iter.h │ │ │ │ ├── zfs_main.c │ │ │ │ └── zfs_util.h │ │ │ ├── zhack │ │ │ │ └── zhack.c │ │ │ ├── zinject │ │ │ │ ├── translate.c │ │ │ │ ├── zinject.c │ │ │ │ └── zinject.h │ │ │ ├── zlook │ │ │ │ └── zlook.c │ │ │ ├── zpool │ │ │ │ ├── zpool-features.7 │ │ │ │ ├── zpool.8 │ │ │ │ ├── zpool_iter.c │ │ │ │ ├── zpool_main.c │ │ │ │ ├── zpool_util.c │ │ │ │ ├── zpool_util.h │ │ │ │ └── zpool_vdev.c │ │ │ ├── zstreamdump │ │ │ │ ├── zstreamdump.1 │ │ │ │ └── zstreamdump.c │ │ │ └── ztest │ │ │ │ └── ztest.c │ │ │ ├── head │ │ │ └── thread.h │ │ │ └── lib │ │ │ ├── libnvpair │ │ │ ├── libnvpair.c │ │ │ ├── libnvpair.h │ │ │ └── nvpair_alloc_system.c │ │ │ ├── libuutil │ │ │ └── common │ │ │ │ ├── libuutil.h │ │ │ │ ├── libuutil_common.h │ │ │ │ ├── libuutil_impl.h │ │ │ │ ├── uu_alloc.c │ │ │ │ ├── uu_avl.c │ │ │ │ ├── uu_dprintf.c │ │ │ │ ├── uu_ident.c │ │ │ │ ├── uu_list.c │ │ │ │ ├── uu_misc.c │ │ │ │ ├── uu_open.c │ │ │ │ ├── uu_pname.c │ │ │ │ ├── uu_string.c │ │ │ │ └── uu_strtoint.c │ │ │ ├── libzfs │ │ │ └── common │ │ │ │ ├── libzfs.h │ │ │ │ ├── libzfs_changelist.c │ │ │ │ ├── libzfs_config.c │ │ │ │ ├── libzfs_dataset.c │ │ │ │ ├── libzfs_diff.c │ │ │ │ ├── libzfs_fru.c │ │ │ │ ├── libzfs_impl.h │ │ │ │ ├── libzfs_import.c │ │ │ │ ├── libzfs_iter.c │ │ │ │ ├── libzfs_mount.c │ │ │ │ ├── libzfs_pool.c │ │ │ │ ├── libzfs_sendrecv.c │ │ │ │ ├── libzfs_status.c │ │ │ │ └── libzfs_util.c │ │ │ └── libzpool │ │ │ └── common │ │ │ ├── kernel.c │ │ │ ├── sys │ │ │ └── zfs_context.h │ │ │ └── util.c │ └── lib │ │ ├── libzfs │ │ └── Makefile │ │ └── libzpool │ │ └── Makefile ├── include │ └── arpa │ │ └── inet.h ├── init.cc ├── init.hh ├── lib │ └── libgeom │ │ └── libgeom.h ├── manifest.txt ├── net.cc ├── net.hh ├── porting │ ├── _callout.h │ ├── bus.h │ ├── bus_dma.cc │ ├── callout.cc │ ├── callout.h │ ├── cpu.cc │ ├── curthread.h │ ├── kobj.cc │ ├── kobj.h │ ├── kthread.cc │ ├── kthread.h │ ├── mmu.cc │ ├── mmu.h │ ├── mnttab.cc │ ├── netport.cc │ ├── netport.h │ ├── netport1.cc │ ├── networking.cc │ ├── networking.hh │ ├── pcpu.cc │ ├── pcpu.h │ ├── route.cc │ ├── route.h │ ├── rwlock.h │ ├── shrinker.cc │ ├── shrinker.h │ ├── sync_stub.c │ ├── sync_stub.h │ ├── synch.cc │ ├── synch.h │ ├── uma_stub.cc │ └── uma_stub.h ├── scripts │ └── init-order.py ├── sys │ ├── cddl │ │ ├── compat │ │ │ └── opensolaris │ │ │ │ ├── kern │ │ │ │ ├── opensolaris.c │ │ │ │ ├── opensolaris_acl.c │ │ │ │ ├── opensolaris_atomic.cc │ │ │ │ ├── opensolaris_cmn_err.c │ │ │ │ ├── opensolaris_kmem.c │ │ │ │ ├── opensolaris_kobj.c │ │ │ │ ├── opensolaris_kstat.c │ │ │ │ ├── opensolaris_lookup.c │ │ │ │ ├── opensolaris_misc.c │ │ │ │ ├── opensolaris_policy.c │ │ │ │ ├── opensolaris_string.c │ │ │ │ ├── opensolaris_sunddi.c │ │ │ │ ├── opensolaris_sysevent.c │ │ │ │ ├── opensolaris_taskq.c │ │ │ │ ├── opensolaris_uio.c │ │ │ │ ├── opensolaris_vfs.c │ │ │ │ └── opensolaris_zone.c │ │ │ │ ├── rpc │ │ │ │ └── xdr.h │ │ │ │ └── sys │ │ │ │ ├── acl.h │ │ │ │ ├── assfail.h │ │ │ │ ├── atomic.h │ │ │ │ ├── bitmap.h │ │ │ │ ├── byteorder.h │ │ │ │ ├── cmn_err.h │ │ │ │ ├── cpupart.h │ │ │ │ ├── cpuvar.h │ │ │ │ ├── cpuvar_defs.h │ │ │ │ ├── cred.h │ │ │ │ ├── cyclic.h │ │ │ │ ├── cyclic_impl.h │ │ │ │ ├── debug.h │ │ │ │ ├── dirent.h │ │ │ │ ├── dkio.h │ │ │ │ ├── dnlc.h │ │ │ │ ├── elf.h │ │ │ │ ├── fcntl.h │ │ │ │ ├── feature_tests.h │ │ │ │ ├── file.h │ │ │ │ ├── kcondvar.h │ │ │ │ ├── kidmap.h │ │ │ │ ├── kmem.h │ │ │ │ ├── kobj.h │ │ │ │ ├── kstat.h │ │ │ │ ├── lock.h │ │ │ │ ├── misc.h │ │ │ │ ├── mman.h │ │ │ │ ├── mntent.h │ │ │ │ ├── mnttab.h │ │ │ │ ├── modctl.h │ │ │ │ ├── mount.h │ │ │ │ ├── mutex.h │ │ │ │ ├── namei.h │ │ │ │ ├── objfs.h │ │ │ │ ├── param.h │ │ │ │ ├── pathname.h │ │ │ │ ├── pcpu.h │ │ │ │ ├── policy.h │ │ │ │ ├── proc.h │ │ │ │ ├── random.h │ │ │ │ ├── refstr.h │ │ │ │ ├── rwlock.h │ │ │ │ ├── sdt.h │ │ │ │ ├── sema.h │ │ │ │ ├── sid.h │ │ │ │ ├── sig.h │ │ │ │ ├── solaris_uio.h │ │ │ │ ├── stat.h │ │ │ │ ├── string.h │ │ │ │ ├── sunddi.h │ │ │ │ ├── systeminfo.h │ │ │ │ ├── systm.h │ │ │ │ ├── taskq.h │ │ │ │ ├── time.h │ │ │ │ ├── types.h │ │ │ │ ├── unistd.h │ │ │ │ ├── varargs.h │ │ │ │ ├── vfs.h │ │ │ │ ├── vnode.h │ │ │ │ └── zone.h │ │ └── contrib │ │ │ └── opensolaris │ │ │ ├── common │ │ │ ├── acl │ │ │ │ ├── acl_common.c │ │ │ │ └── acl_common.h │ │ │ ├── atomic │ │ │ │ ├── i386 │ │ │ │ │ └── opensolaris_atomic.S │ │ │ │ ├── ia64 │ │ │ │ │ └── opensolaris_atomic.S │ │ │ │ ├── powerpc64 │ │ │ │ │ └── opensolaris_atomic.S │ │ │ │ ├── sparc64 │ │ │ │ │ └── opensolaris_atomic.S │ │ │ │ └── x64 │ │ │ │ │ └── opensolaris_atomic.S │ │ │ ├── avl │ │ │ │ └── avl.c │ │ │ ├── nvpair │ │ │ │ ├── fnvpair.c │ │ │ │ ├── nvpair.c │ │ │ │ └── nvpair_alloc_fixed.c │ │ │ ├── unicode │ │ │ │ └── u8_textprep.c │ │ │ └── zfs │ │ │ │ ├── zfeature_common.c │ │ │ │ ├── zfeature_common.h │ │ │ │ ├── zfs_comutil.c │ │ │ │ ├── zfs_comutil.h │ │ │ │ ├── zfs_deleg.c │ │ │ │ ├── zfs_deleg.h │ │ │ │ ├── zfs_fletcher.c │ │ │ │ ├── zfs_fletcher.h │ │ │ │ ├── zfs_ioctl_compat.c │ │ │ │ ├── zfs_ioctl_compat.h │ │ │ │ ├── zfs_namecheck.c │ │ │ │ ├── zfs_namecheck.h │ │ │ │ ├── zfs_prop.c │ │ │ │ ├── zfs_prop.h │ │ │ │ ├── zpool_prop.c │ │ │ │ └── zprop_common.c │ │ │ └── uts │ │ │ └── common │ │ │ ├── fs │ │ │ └── zfs │ │ │ │ ├── arc.c │ │ │ │ ├── bplist.c │ │ │ │ ├── bpobj.c │ │ │ │ ├── bptree.c │ │ │ │ ├── dbuf.c │ │ │ │ ├── ddt.c │ │ │ │ ├── ddt_zap.c │ │ │ │ ├── dmu.c │ │ │ │ ├── dmu_diff.c │ │ │ │ ├── dmu_object.c │ │ │ │ ├── dmu_objset.c │ │ │ │ ├── dmu_send.c │ │ │ │ ├── dmu_traverse.c │ │ │ │ ├── dmu_tx.c │ │ │ │ ├── dmu_zfetch.c │ │ │ │ ├── dnode.c │ │ │ │ ├── dnode_sync.c │ │ │ │ ├── dsl_dataset.c │ │ │ │ ├── dsl_deadlist.c │ │ │ │ ├── dsl_deleg.c │ │ │ │ ├── dsl_dir.c │ │ │ │ ├── dsl_pool.c │ │ │ │ ├── dsl_prop.c │ │ │ │ ├── dsl_scan.c │ │ │ │ ├── dsl_synctask.c │ │ │ │ ├── gzip.c │ │ │ │ ├── lz4.c │ │ │ │ ├── lzjb.c │ │ │ │ ├── metaslab.c │ │ │ │ ├── refcount.c │ │ │ │ ├── rrwlock.c │ │ │ │ ├── sa.c │ │ │ │ ├── sha256.c │ │ │ │ ├── spa.c │ │ │ │ ├── spa_config.c │ │ │ │ ├── spa_errlog.c │ │ │ │ ├── spa_history.c │ │ │ │ ├── spa_misc.c │ │ │ │ ├── space_map.c │ │ │ │ ├── sys │ │ │ │ ├── arc.h │ │ │ │ ├── bplist.h │ │ │ │ ├── bpobj.h │ │ │ │ ├── bptree.h │ │ │ │ ├── dbuf.h │ │ │ │ ├── ddt.h │ │ │ │ ├── dmu.h │ │ │ │ ├── dmu_impl.h │ │ │ │ ├── dmu_objset.h │ │ │ │ ├── dmu_traverse.h │ │ │ │ ├── dmu_tx.h │ │ │ │ ├── dmu_zfetch.h │ │ │ │ ├── dnode.h │ │ │ │ ├── dsl_dataset.h │ │ │ │ ├── dsl_deadlist.h │ │ │ │ ├── dsl_deleg.h │ │ │ │ ├── dsl_dir.h │ │ │ │ ├── dsl_pool.h │ │ │ │ ├── dsl_prop.h │ │ │ │ ├── dsl_scan.h │ │ │ │ ├── dsl_synctask.h │ │ │ │ ├── metaslab.h │ │ │ │ ├── metaslab_impl.h │ │ │ │ ├── refcount.h │ │ │ │ ├── rrwlock.h │ │ │ │ ├── sa.h │ │ │ │ ├── sa_impl.h │ │ │ │ ├── spa.h │ │ │ │ ├── spa_boot.h │ │ │ │ ├── spa_impl.h │ │ │ │ ├── space_map.h │ │ │ │ ├── txg.h │ │ │ │ ├── txg_impl.h │ │ │ │ ├── uberblock.h │ │ │ │ ├── uberblock_impl.h │ │ │ │ ├── unique.h │ │ │ │ ├── vdev.h │ │ │ │ ├── vdev_disk.h │ │ │ │ ├── vdev_file.h │ │ │ │ ├── vdev_impl.h │ │ │ │ ├── zap.h │ │ │ │ ├── zap_impl.h │ │ │ │ ├── zap_leaf.h │ │ │ │ ├── zfeature.h │ │ │ │ ├── zfs_acl.h │ │ │ │ ├── zfs_context.h │ │ │ │ ├── zfs_ctldir.h │ │ │ │ ├── zfs_debug.h │ │ │ │ ├── zfs_dir.h │ │ │ │ ├── zfs_fuid.h │ │ │ │ ├── zfs_ioctl.h │ │ │ │ ├── zfs_onexit.h │ │ │ │ ├── zfs_rlock.h │ │ │ │ ├── zfs_sa.h │ │ │ │ ├── zfs_stat.h │ │ │ │ ├── zfs_vfsops.h │ │ │ │ ├── zfs_znode.h │ │ │ │ ├── zil.h │ │ │ │ ├── zil_impl.h │ │ │ │ ├── zio.h │ │ │ │ ├── zio_checksum.h │ │ │ │ ├── zio_compress.h │ │ │ │ ├── zio_impl.h │ │ │ │ ├── zrlock.h │ │ │ │ └── zvol.h │ │ │ │ ├── txg.c │ │ │ │ ├── uberblock.c │ │ │ │ ├── unique.c │ │ │ │ ├── vdev.c │ │ │ │ ├── vdev_cache.c │ │ │ │ ├── vdev_disk.c │ │ │ │ ├── vdev_file.c │ │ │ │ ├── vdev_geom.c │ │ │ │ ├── vdev_label.c │ │ │ │ ├── vdev_mirror.c │ │ │ │ ├── vdev_missing.c │ │ │ │ ├── vdev_queue.c │ │ │ │ ├── vdev_raidz.c │ │ │ │ ├── vdev_root.c │ │ │ │ ├── zap.c │ │ │ │ ├── zap_leaf.c │ │ │ │ ├── zap_micro.c │ │ │ │ ├── zfeature.c │ │ │ │ ├── zfs.conf │ │ │ │ ├── zfs_acl.c │ │ │ │ ├── zfs_byteswap.c │ │ │ │ ├── zfs_ctldir.c │ │ │ │ ├── zfs_debug.c │ │ │ │ ├── zfs_dir.c │ │ │ │ ├── zfs_fm.c │ │ │ │ ├── zfs_fuid.c │ │ │ │ ├── zfs_init.c │ │ │ │ ├── zfs_ioctl.c │ │ │ │ ├── zfs_log.c │ │ │ │ ├── zfs_onexit.c │ │ │ │ ├── zfs_replay.c │ │ │ │ ├── zfs_rlock.c │ │ │ │ ├── zfs_sa.c │ │ │ │ ├── zfs_vfsops.c │ │ │ │ ├── zfs_vnops.c │ │ │ │ ├── zfs_znode.c │ │ │ │ ├── zil.c │ │ │ │ ├── zio.c │ │ │ │ ├── zio_checksum.c │ │ │ │ ├── zio_compress.c │ │ │ │ ├── zio_inject.c │ │ │ │ ├── zle.c │ │ │ │ ├── zrlock.c │ │ │ │ └── zvol.c │ │ │ ├── os │ │ │ ├── callb.c │ │ │ ├── fm.c │ │ │ ├── list.c │ │ │ └── nvpair_alloc_system.c │ │ │ ├── sys │ │ │ ├── acl.h │ │ │ ├── acl_impl.h │ │ │ ├── asm_linkage.h │ │ │ ├── avl.h │ │ │ ├── avl_impl.h │ │ │ ├── bitmap.h │ │ │ ├── callb.h │ │ │ ├── ccompile.h │ │ │ ├── cmn_err.h │ │ │ ├── compress.h │ │ │ ├── cpupart.h │ │ │ ├── cpuvar.h │ │ │ ├── cred.h │ │ │ ├── ctf.h │ │ │ ├── ctf_api.h │ │ │ ├── debug.h │ │ │ ├── dtrace.h │ │ │ ├── dtrace_impl.h │ │ │ ├── errorq.h │ │ │ ├── extdirent.h │ │ │ ├── fasttrap.h │ │ │ ├── fasttrap_impl.h │ │ │ ├── feature_tests.h │ │ │ ├── fm │ │ │ │ ├── fs │ │ │ │ │ └── zfs.h │ │ │ │ ├── protocol.h │ │ │ │ └── util.h │ │ │ ├── fs │ │ │ │ ├── zfs.h │ │ │ │ └── zut.h │ │ │ ├── gfs.h │ │ │ ├── idmap.h │ │ │ ├── isa_defs.h │ │ │ ├── list.h │ │ │ ├── list_impl.h │ │ │ ├── note.h │ │ │ ├── nvpair.h │ │ │ ├── nvpair_impl.h │ │ │ ├── processor.h │ │ │ ├── procset.h │ │ │ ├── synch.h │ │ │ ├── sysevent.h │ │ │ ├── sysevent │ │ │ │ ├── dev.h │ │ │ │ └── eventdefs.h │ │ │ ├── sysmacros.h │ │ │ ├── taskq.h │ │ │ ├── u8_textprep.h │ │ │ ├── u8_textprep_data.h │ │ │ ├── vnode.h │ │ │ └── zmod.h │ │ │ └── zmod │ │ │ ├── adler32.c │ │ │ ├── crc32.h │ │ │ ├── deflate.c │ │ │ ├── deflate.h │ │ │ ├── inffast.c │ │ │ ├── inffast.h │ │ │ ├── inffixed.h │ │ │ ├── inflate.c │ │ │ ├── inflate.h │ │ │ ├── inftrees.c │ │ │ ├── inftrees.h │ │ │ ├── opensolaris_crc32.c │ │ │ ├── trees.c │ │ │ ├── zconf.h │ │ │ ├── zlib.h │ │ │ ├── zmod.c │ │ │ ├── zmod_subr.c │ │ │ ├── zutil.c │ │ │ └── zutil.h │ ├── compat │ │ └── linux │ │ │ ├── linux.h │ │ │ ├── linux_ioctl.cc │ │ │ ├── linux_netlink.cc │ │ │ ├── linux_netlink.h │ │ │ ├── linux_socket.cc │ │ │ └── linux_socket.h │ ├── contrib │ │ ├── ena_com │ │ │ ├── README │ │ │ ├── ena_com.cc │ │ │ ├── ena_com.h │ │ │ ├── ena_defs │ │ │ │ ├── ena_admin_defs.h │ │ │ │ ├── ena_common_defs.h │ │ │ │ ├── ena_eth_io_defs.h │ │ │ │ ├── ena_gen_info.h │ │ │ │ ├── ena_includes.h │ │ │ │ └── ena_regs_defs.h │ │ │ ├── ena_eth_com.cc │ │ │ ├── ena_eth_com.h │ │ │ ├── ena_fbsd_log.h │ │ │ └── ena_plat.h │ │ └── pf │ │ │ └── net │ │ │ └── pf_mtag.h │ ├── crypto │ │ ├── rijndael │ │ │ ├── rijndael-alg-fst.c │ │ │ ├── rijndael-api-fst.c │ │ │ ├── rijndael-api-fst.h │ │ │ ├── rijndael-api.c │ │ │ ├── rijndael.h │ │ │ └── rijndael_local.h │ │ └── sha2 │ │ │ ├── sha2.c │ │ │ └── sha2.h │ ├── dev │ │ ├── ena │ │ │ ├── README │ │ │ ├── ena.cc │ │ │ ├── ena.h │ │ │ ├── ena_datapath.cc │ │ │ └── ena_datapath.h │ │ ├── hyperv │ │ │ ├── include │ │ │ │ ├── hyperv.h │ │ │ │ ├── hyperv_busdma.h │ │ │ │ ├── vmbus.h │ │ │ │ └── vmbus_xact.h │ │ │ └── vmbus │ │ │ │ ├── hyperv.cc │ │ │ │ └── hyperv_reg.h │ │ ├── random │ │ │ ├── harvest.cc │ │ │ ├── hash.c │ │ │ ├── hash.h │ │ │ ├── live_entropy_sources.cc │ │ │ ├── live_entropy_sources.h │ │ │ ├── opt_random.h │ │ │ ├── random_adaptors.h │ │ │ ├── random_harvestq.cc │ │ │ ├── random_harvestq.h │ │ │ ├── randomdev.h │ │ │ ├── randomdev_soft.cc │ │ │ ├── randomdev_soft.h │ │ │ ├── yarrow.cc │ │ │ └── yarrow.h │ │ └── xen │ │ │ ├── blkfront │ │ │ ├── blkfront.cc │ │ │ └── block.h │ │ │ └── netfront │ │ │ ├── mbufq.h │ │ │ └── netfront.cc │ ├── geom │ │ ├── geom.h │ │ ├── geom_ctl.h │ │ └── geom_disk.h │ ├── kern │ │ ├── kern_mbuf.cc │ │ ├── md5c.c │ │ ├── opt_geom.h │ │ ├── subr_bufring.c │ │ ├── subr_disk.c │ │ ├── subr_eventhandler.c │ │ ├── subr_hash.c │ │ ├── subr_sbuf.c │ │ ├── subr_taskqueue.c │ │ ├── sys_socket.cc │ │ ├── uipc_domain.cc │ │ ├── uipc_mbuf.cc │ │ ├── uipc_mbuf2.cc │ │ ├── uipc_sockbuf.cc │ │ ├── uipc_socket.cc │ │ ├── uipc_syscalls.cc │ │ └── uipc_syscalls_wrap.cc │ ├── libkern │ │ ├── arc4random.c │ │ ├── inet_aton.c │ │ ├── inet_ntoa.c │ │ └── random.c │ ├── machine │ │ ├── cpu.h │ │ └── xen │ │ │ ├── xenpmap.h │ │ │ └── xenvar.h │ ├── net │ │ ├── bpf.h │ │ ├── ethernet.h │ │ ├── if.cc │ │ ├── if.h │ │ ├── if_arp.h │ │ ├── if_clone.cc │ │ ├── if_clone.h │ │ ├── if_data.h │ │ ├── if_dead.cc │ │ ├── if_dl.h │ │ ├── if_ethersubr.cc │ │ ├── if_llatbl.cc │ │ ├── if_llatbl.h │ │ ├── if_llc.h │ │ ├── if_loop.cc │ │ ├── if_media.h │ │ ├── if_types.h │ │ ├── if_var.h │ │ ├── if_vlan_var.h │ │ ├── netisr.cc │ │ ├── netisr.h │ │ ├── netisr1.cc │ │ ├── netisr_internal.h │ │ ├── pfil.cc │ │ ├── pfil.h │ │ ├── radix.cc │ │ ├── radix.h │ │ ├── raw_cb.cc │ │ ├── raw_cb.h │ │ ├── raw_usrreq.cc │ │ ├── route.cc │ │ ├── route.h │ │ ├── routecache.cc │ │ ├── routecache.hh │ │ ├── rtsock.cc │ │ └── vnet.h │ ├── netinet │ │ ├── arpcache.cc │ │ ├── arpcache.hh │ │ ├── cc.h │ │ ├── cc │ │ │ ├── cc.cc │ │ │ ├── cc_cubic.cc │ │ │ ├── cc_cubic.h │ │ │ ├── cc_htcp.cc │ │ │ ├── cc_module.h │ │ │ └── cc_newreno.cc │ │ ├── icmp_var.h │ │ ├── if_ether.cc │ │ ├── if_ether.h │ │ ├── igmp.cc │ │ ├── igmp.h │ │ ├── igmp_var.h │ │ ├── in.cc │ │ ├── in.h │ │ ├── in_mcast.cc │ │ ├── in_pcb.cc │ │ ├── in_pcb.h │ │ ├── in_proto.cc │ │ ├── in_rmx.cc │ │ ├── in_systm.h │ │ ├── in_var.h │ │ ├── ip.h │ │ ├── ip_icmp.cc │ │ ├── ip_icmp.h │ │ ├── ip_id.cc │ │ ├── ip_input.cc │ │ ├── ip_mroute.h │ │ ├── ip_options.cc │ │ ├── ip_options.h │ │ ├── ip_output.cc │ │ ├── ip_var.h │ │ ├── raw_ip.cc │ │ ├── tcp.h │ │ ├── tcp_debug.cc │ │ ├── tcp_debug.h │ │ ├── tcp_fsm.h │ │ ├── tcp_hostcache.cc │ │ ├── tcp_hostcache.h │ │ ├── tcp_input.cc │ │ ├── tcp_lro.cc │ │ ├── tcp_lro.h │ │ ├── tcp_output.cc │ │ ├── tcp_reass.cc │ │ ├── tcp_sack.cc │ │ ├── tcp_seq.h │ │ ├── tcp_subr.cc │ │ ├── tcp_syncache.cc │ │ ├── tcp_syncache.h │ │ ├── tcp_timer.cc │ │ ├── tcp_timer.h │ │ ├── tcp_timewait.cc │ │ ├── tcp_usrreq.cc │ │ ├── tcp_var.h │ │ ├── tcpip.h │ │ ├── toedev.h │ │ ├── udp.h │ │ ├── udp_usrreq.cc │ │ └── udp_var.h │ ├── netinet6 │ │ └── in6.h │ ├── rpc │ │ ├── netconfig.h │ │ ├── types.h │ │ └── xdr.h │ ├── sys │ │ ├── _bus_dma.h │ │ ├── _cpuset.h │ │ ├── _null.h │ │ ├── _sockaddr_storage.h │ │ ├── _task.h │ │ ├── bio.h │ │ ├── bitstring.h │ │ ├── buf_ring.h │ │ ├── bus.h │ │ ├── bus_dma.h │ │ ├── conf.h │ │ ├── cpuset.h │ │ ├── ctype.h │ │ ├── disk.h │ │ ├── domain.h │ │ ├── eventhandler.h │ │ ├── fcntl.h │ │ ├── filio.h │ │ ├── fnv_hash.h │ │ ├── interrupt.h │ │ ├── ioccom.h │ │ ├── kernel.h │ │ ├── kobj.h │ │ ├── kthread.h │ │ ├── libkern.h │ │ ├── limits.h │ │ ├── linker.h │ │ ├── linker_set.h │ │ ├── lock.h │ │ ├── malloc.h │ │ ├── mbuf.h │ │ ├── md5.h │ │ ├── module.h │ │ ├── mutex.h │ │ ├── param.h │ │ ├── pcpu.h │ │ ├── priority.h │ │ ├── priv.h │ │ ├── proc.h │ │ ├── protosw.h │ │ ├── queue.h │ │ ├── random.h │ │ ├── refcount.h │ │ ├── rman.h │ │ ├── sbuf.h │ │ ├── sdt.h │ │ ├── selinfo.h │ │ ├── smp.h │ │ ├── sockbuf.h │ │ ├── socket.h │ │ ├── socketvar.h │ │ ├── sockopt.h │ │ ├── sockstate.h │ │ ├── sx.h │ │ ├── sysctl.h │ │ ├── systm.h │ │ ├── taskqueue.h │ │ ├── tree.h │ │ ├── unistd.h │ │ ├── xenbus_if.h │ │ └── xenbusb_if.h │ ├── vm │ │ ├── pmap.h │ │ ├── vm.h │ │ ├── vm_extern.h │ │ ├── vm_kern.h │ │ └── vm_pmap.h │ ├── xdr │ │ ├── xdr.c │ │ ├── xdr_array.c │ │ └── xdr_mem.c │ ├── xen │ │ ├── blkif.h │ │ ├── evtchn.cc │ │ ├── evtchn.h │ │ ├── features.h │ │ ├── gnttab.cc │ │ ├── gnttab.h │ │ ├── hypervisor.h │ │ ├── interface │ │ │ ├── COPYING │ │ │ ├── acm.h │ │ │ ├── acm_ops.h │ │ │ ├── arch-aarch64.h │ │ │ ├── arch-ia64.h │ │ │ ├── arch-powerpc.h │ │ │ ├── arch-x86 │ │ │ │ ├── cpuid.h │ │ │ │ ├── hvm │ │ │ │ │ ├── save.h │ │ │ │ │ └── start_info.h │ │ │ │ ├── xen-mca.h │ │ │ │ ├── xen-x86_32.h │ │ │ │ ├── xen-x86_64.h │ │ │ │ └── xen.h │ │ │ ├── arch-x86_32.h │ │ │ ├── arch-x86_64.h │ │ │ ├── callback.h │ │ │ ├── dom0_ops.h │ │ │ ├── domctl.h │ │ │ ├── elfnote.h │ │ │ ├── elfstructs.h │ │ │ ├── event_channel.h │ │ │ ├── features.h │ │ │ ├── foreign │ │ │ │ ├── Makefile │ │ │ │ ├── mkchecker.py │ │ │ │ ├── mkheader.py │ │ │ │ ├── reference.size │ │ │ │ └── structs.py │ │ │ ├── grant_table.h │ │ │ ├── hvm │ │ │ │ ├── e820.h │ │ │ │ ├── hvm_info_table.h │ │ │ │ ├── hvm_op.h │ │ │ │ ├── ioreq.h │ │ │ │ ├── params.h │ │ │ │ ├── save.h │ │ │ │ └── vmx_assist.h │ │ │ ├── io │ │ │ │ ├── blkif.h │ │ │ │ ├── console.h │ │ │ │ ├── fbif.h │ │ │ │ ├── kbdif.h │ │ │ │ ├── netif.h │ │ │ │ ├── pciif.h │ │ │ │ ├── protocols.h │ │ │ │ ├── ring.h │ │ │ │ ├── tpmif.h │ │ │ │ ├── xenbus.h │ │ │ │ └── xs_wire.h │ │ │ ├── kexec.h │ │ │ ├── libelf.h │ │ │ ├── memory.h │ │ │ ├── nmi.h │ │ │ ├── physdev.h │ │ │ ├── platform.h │ │ │ ├── sched.h │ │ │ ├── sysctl.h │ │ │ ├── trace.h │ │ │ ├── vcpu.h │ │ │ ├── version.h │ │ │ ├── xen-compat.h │ │ │ ├── xen.h │ │ │ ├── xencomm.h │ │ │ └── xenoprof.h │ │ ├── xen_intr.h │ │ ├── xenbus │ │ │ ├── xenbus.cc │ │ │ ├── xenbusb.cc │ │ │ ├── xenbusb.h │ │ │ ├── xenbusb_front.cc │ │ │ └── xenbusvar.h │ │ └── xenstore │ │ │ ├── xenstore.cc │ │ │ ├── xenstore_internal.h │ │ │ └── xenstorevar.h │ ├── xenbus_if.h │ └── xenbusb_if.h ├── uipc_syscalls.h └── x64 │ └── machine │ ├── _align.h │ ├── _inttypes.h │ ├── atomic.h │ ├── bus.h │ ├── clock.h │ ├── cpufunc.h │ ├── endian.h │ ├── frame.h │ ├── in_cksum.cc │ ├── in_cksum.h │ ├── intr_machdep.h │ ├── param.h │ ├── pcpu.h │ ├── resource.h │ ├── stdarg.h │ ├── vmparam.h │ └── xen │ ├── hypercall.h │ ├── synch_bitops.h │ └── xen-os.h ├── compiler ├── attr │ └── cold-label.cc ├── empty.cc └── include │ └── intrinsics.hh ├── conf ├── Makefile ├── aarch64.mk ├── base.mk ├── debug.mk ├── examples │ └── minimal_microvm │ │ ├── hello_world_libc.config.aarch64 │ │ ├── hello_world_libc.config.x64 │ │ ├── hello_world_libc.version_script │ │ ├── hello_world_static.config.aarch64 │ │ ├── hello_world_static.config.x64 │ │ ├── hello_world_static.syscalls.aarch64 │ │ ├── hello_world_static.syscalls.x64 │ │ └── hello_world_static.version_script ├── kconfig │ ├── app │ ├── compiler │ ├── core │ ├── fs │ ├── main │ ├── memory │ ├── networking │ ├── threads │ └── tracepoints ├── profiles │ ├── README.md │ ├── aarch64 │ │ ├── all.mk │ │ ├── base.mk │ │ ├── kconfig │ │ ├── microvm.mk │ │ ├── nvme.mk │ │ ├── virtio-mmio.mk │ │ ├── virtio-pci.mk │ │ └── xen.mk │ └── x64 │ │ ├── all.mk │ │ ├── aws.mk │ │ ├── base.mk │ │ ├── cloud_hypervisor.mk │ │ ├── hyperv.mk │ │ ├── kconfig │ │ ├── microvm.mk │ │ ├── nvme.mk │ │ ├── vbox.mk │ │ ├── virtio-mmio.mk │ │ ├── virtio-pci.mk │ │ ├── vmware.mk │ │ └── xen.mk ├── release.mk └── x64.mk ├── config.json ├── core ├── alloctracker.cc ├── app.cc ├── async.cc ├── callstack.cc ├── chart.cc ├── commands.cc ├── condvar.cc ├── debug.cc ├── demangle.cc ├── dhcp.cc ├── elf.cc ├── epoll.cc ├── kprintf.c ├── lfmutex.cc ├── libaio.cc ├── math.cc ├── mempool.cc ├── mmio.cc ├── mmu.cc ├── net_channel.cc ├── net_trace.cc ├── newpoll.cc ├── options.cc ├── osv_c_wrappers.cc ├── osv_execve.cc ├── pagecache.cc ├── per-cpu-counter.cc ├── percpu-worker.cc ├── percpu.cc ├── poll.cc ├── power.cc ├── printf.cc ├── rcu.cc ├── run.cc ├── rwlock.cc ├── sampler.cc ├── sched.cc ├── select.cc ├── semaphore.cc ├── shutdown.cc ├── spinlock.cc ├── strace.cc ├── string_utils.cc ├── trace-count.cc ├── trace.cc ├── version.cc ├── waitqueue.cc └── xen_intr.cc ├── docker ├── Dockerfile.builder-fedora-base ├── Dockerfile.builder-ubuntu-base ├── Dockerfile.runner-fedora ├── Dockerfile.runner-ubuntu ├── README.md ├── etc │ ├── console-setup │ └── keyboard └── hooks │ └── build ├── documentation ├── LICENSE-freebsd ├── LICENSE-musl ├── LICENSE-opensolaris ├── LICENSE-prex ├── OSv_Component_Diagram.png ├── devices-and-drivers.txt ├── eventlist.txt └── logger.txt ├── drivers ├── acpi.cc ├── acpi.hh ├── ahci.cc ├── ahci.hh ├── blk-common.cc ├── blk-common.hh ├── cadence-uart.cc ├── cadence-uart.hh ├── clock-common.cc ├── clock-common.hh ├── clock.cc ├── clock.hh ├── clockevent.cc ├── clockevent.hh ├── console-driver.cc ├── console-driver.hh ├── console-multiplexer.cc ├── console-multiplexer.hh ├── console.cc ├── console.hh ├── device.cc ├── device.hh ├── driver.cc ├── driver.hh ├── ena.cc ├── ena.hh ├── hpet.cc ├── hypervclock.cc ├── ide.cc ├── ide.hh ├── isa-serial-base.cc ├── isa-serial-base.hh ├── isa-serial.cc ├── isa-serial.hh ├── kbd.cc ├── kbd.hh ├── kvmclock.cc ├── libtsm │ ├── README │ ├── libtsm.hh │ ├── libtsm_int.hh │ ├── shl_array.hh │ ├── shl_llog.hh │ ├── tsm_render.cc │ ├── tsm_screen.cc │ ├── tsm_vte.cc │ └── tsm_vte_charsets.cc ├── line-discipline.cc ├── line-discipline.hh ├── mmio-isa-serial.cc ├── mmio-isa-serial.hh ├── msi.cc ├── null.cc ├── null.hh ├── nvme-queue.cc ├── nvme-queue.hh ├── nvme-structs.h ├── nvme.cc ├── nvme.hh ├── pci-bridge.cc ├── pci-bridge.hh ├── pci-device.cc ├── pci-device.hh ├── pci-function.cc ├── pci-function.hh ├── pci-generic.cc ├── pci-generic.hh ├── pl011.cc ├── pl011.hh ├── pl031.cc ├── pl031.hh ├── pvpanic.cc ├── pvpanic.hh ├── ramdisk.c ├── random.cc ├── random.hh ├── rtc.cc ├── rtc.hh ├── scsi-common.cc ├── scsi-common.hh ├── vga.cc ├── vga.hh ├── virtio-blk.cc ├── virtio-blk.hh ├── virtio-device.hh ├── virtio-fs.cc ├── virtio-fs.hh ├── virtio-mmio.cc ├── virtio-mmio.hh ├── virtio-net.cc ├── virtio-net.hh ├── virtio-pci-device.cc ├── virtio-pci-device.hh ├── virtio-rng.cc ├── virtio-rng.hh ├── virtio-scsi.cc ├── virtio-scsi.hh ├── virtio-vring.cc ├── virtio-vring.hh ├── virtio.cc ├── virtio.hh ├── vmw-pvscsi.cc ├── vmw-pvscsi.hh ├── vmxnet3-queues.cc ├── vmxnet3-queues.hh ├── vmxnet3.cc ├── vmxnet3.hh ├── xenclock.cc ├── xenconsole.cc ├── xenconsole.hh ├── xenfront-blk.cc ├── xenfront-xenbus.cc ├── xenfront-xenbus.hh ├── xenfront.cc ├── xenfront.hh ├── xenplatform-pci.cc ├── xenplatform-pci.hh ├── zfs.cc └── zfs.hh ├── dummy-shlib.cc ├── exported_symbols ├── README.md ├── aarch64 │ └── osv_ld-linux-aarch64.so.1.symbols ├── osv_ld-linux.so.symbols ├── osv_ld-musl.so.1.symbols ├── osv_libaio.so.1.symbols ├── osv_libc.so.6.symbols ├── osv_libcrypt.so.1.symbols ├── osv_libdl.so.2.symbols ├── osv_libm.so.6.symbols ├── osv_libpthread.so.0.symbols ├── osv_libresolv.so.2.symbols ├── osv_librt.so.1.symbols ├── osv_libsolaris.so.symbols ├── osv_libutil.so.symbols ├── osv_libxenstore.so.3.0.symbols ├── osv_module_api.symbols └── x64 │ ├── osv_libc.so.6.symbols │ ├── osv_libpthread.so.0.symbols │ └── osv_libxenstore.so.3.0.symbols ├── external └── aarch64 │ └── libfdt │ ├── Makefile.libfdt │ ├── TODO │ ├── fdt.c │ ├── fdt.h │ ├── fdt_addresses.c │ ├── fdt_empty_tree.c │ ├── fdt_ro.c │ ├── fdt_rw.c │ ├── fdt_strerror.c │ ├── fdt_sw.c │ ├── fdt_wip.c │ ├── libfdt.h │ ├── libfdt_env.h │ ├── libfdt_internal.h │ └── version.lds ├── fastlz ├── fastlz.cc ├── fastlz.h ├── lz.cc └── lzloader.cc ├── fs ├── devfs │ ├── devfs.h │ ├── devfs_vnops.cc │ └── device.cc ├── ext │ └── ext_null_vfsops.cc ├── fs.cc ├── fs.hh ├── nfs │ └── nfs_null_vfsops.cc ├── procfs │ └── procfs_vnops.cc ├── pseudofs │ ├── pseudofs.cc │ └── pseudofs.hh ├── ramfs │ ├── ramfs.h │ ├── ramfs_vfsops.cc │ └── ramfs_vnops.cc ├── rofs │ ├── rofs.hh │ ├── rofs_cache.cc │ ├── rofs_common.cc │ ├── rofs_vfsops.cc │ └── rofs_vnops.cc ├── sysfs │ └── sysfs_vnops.cc ├── unsupported.cc ├── vfs │ ├── kern_descrip.cc │ ├── kern_physio.cc │ ├── main.cc │ ├── subr_uio.cc │ ├── vfs.h │ ├── vfs_bdev.cc │ ├── vfs_bio.cc │ ├── vfs_conf.cc │ ├── vfs_dentry.cc │ ├── vfs_fops.cc │ ├── vfs_id.h │ ├── vfs_lookup.cc │ ├── vfs_mount.cc │ ├── vfs_syscalls.cc │ ├── vfs_task.cc │ └── vfs_vnode.cc ├── virtiofs │ ├── fuse_kernel.h │ ├── virtiofs.hh │ ├── virtiofs_dax.cc │ ├── virtiofs_dax.hh │ ├── virtiofs_i.hh │ ├── virtiofs_vfsops.cc │ └── virtiofs_vnops.cc └── zfs │ ├── zfs_initialize.c │ └── zfs_null_vfsops.cc ├── gen-ctype-data.cc ├── images ├── default.py └── empty.py ├── include ├── api │ ├── LICENSE │ ├── __dlfcn.h │ ├── __fenv.h │ ├── aarch64 │ │ └── bits │ │ │ ├── alltypes.h.sh │ │ │ ├── endian.h │ │ │ ├── errno.h │ │ │ ├── fcntl.h │ │ │ ├── fenv.h │ │ │ ├── float.h │ │ │ ├── ioctl.h │ │ │ ├── ipc.h │ │ │ ├── ipcstat.h │ │ │ ├── limits.h │ │ │ ├── link.h │ │ │ ├── mman.h │ │ │ ├── poll.h │ │ │ ├── posix.h │ │ │ ├── setjmp.h │ │ │ ├── shm.h │ │ │ ├── signal.h │ │ │ ├── socket.h │ │ │ ├── stat.h │ │ │ ├── statfs.h │ │ │ ├── stdint.h │ │ │ ├── syscall.h │ │ │ └── termios.h │ ├── aio.h │ ├── alloca.h │ ├── ar.h │ ├── arpa │ │ ├── ftp.h │ │ ├── inet.h │ │ ├── nameser.h │ │ ├── nameser_compat.h │ │ ├── telnet.h │ │ └── tftp.h │ ├── assert.h │ ├── byteswap.h │ ├── complex.h │ ├── cpio.h │ ├── crypt.h │ ├── ctype.h │ ├── dirent.h │ ├── dlfcn.h │ ├── elf.h │ ├── endian.h │ ├── err.h │ ├── errno.h │ ├── fcntl.h │ ├── features.h │ ├── fenv.h │ ├── float.h │ ├── fnmatch.h │ ├── ftw.h │ ├── getopt.h │ ├── glob.h │ ├── grp.h │ ├── iconv.h │ ├── ifaddrs.h │ ├── internal_musl_headers │ │ ├── arpa │ │ │ └── inet.h │ │ ├── errno.h │ │ ├── pthread.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ ├── string.h │ │ ├── sys │ │ │ ├── mman.h │ │ │ ├── sysinfo.h │ │ │ └── time.h │ │ ├── time.h │ │ ├── unistd.h │ │ └── wchar.h │ ├── inttypes.h │ ├── iso646.h │ ├── langinfo.h │ ├── lastlog.h │ ├── libaio.h │ ├── libgen.h │ ├── libintl.h │ ├── limits.h │ ├── link.h │ ├── locale.h │ ├── malloc.h │ ├── math.h │ ├── memory.h │ ├── mntent.h │ ├── monetary.h │ ├── mqueue.h │ ├── net │ │ ├── __if.h │ │ ├── ethernet.h │ │ ├── if.h │ │ ├── if_arp.h │ │ └── route.h │ ├── netdb.h │ ├── netinet │ │ ├── __in.h │ │ ├── icmp6.h │ │ ├── if_ether.h │ │ ├── in.h │ │ ├── in_systm.h │ │ ├── ip.h │ │ ├── ip6.h │ │ ├── ip_icmp.h │ │ ├── tcp.h │ │ └── udp.h │ ├── netpacket │ │ └── packet.h │ ├── nl_types.h │ ├── paths.h │ ├── poll.h │ ├── printf.h │ ├── pthread.h │ ├── pty.h │ ├── pwd.h │ ├── regex.h │ ├── resolv.h │ ├── sched.h │ ├── scsi │ │ ├── scsi.h │ │ └── sg.h │ ├── search.h │ ├── semaphore.h │ ├── setjmp.h │ ├── shadow.h │ ├── signal.h │ ├── spawn.h │ ├── stdalign.h │ ├── stdarg.h │ ├── stdbool.h │ ├── stddef.h │ ├── stdint.h │ ├── stdio.h │ ├── stdio_ext.h │ ├── stdlib.h │ ├── stdnoreturn.h │ ├── string.h │ ├── strings.h │ ├── stropts.h │ ├── sys │ │ ├── __socket.h │ │ ├── acct.h │ │ ├── cachectl.h │ │ ├── epoll.h │ │ ├── eventfd.h │ │ ├── file.h │ │ ├── fsuid.h │ │ ├── inotify.h │ │ ├── io.h │ │ ├── ioctl.h │ │ ├── ipc.h │ │ ├── kd.h │ │ ├── klog.h │ │ ├── mman.h │ │ ├── mount.h │ │ ├── msg.h │ │ ├── mtio.h │ │ ├── param.h │ │ ├── personality.h │ │ ├── poll.h │ │ ├── prctl.h │ │ ├── procfs.h │ │ ├── ptrace.h │ │ ├── random.h │ │ ├── reboot.h │ │ ├── reg.h │ │ ├── resource.h │ │ ├── select.h │ │ ├── sem.h │ │ ├── sendfile.h │ │ ├── shm.h │ │ ├── signalfd.h │ │ ├── socket.h │ │ ├── soundcard.h │ │ ├── stat.h │ │ ├── statfs.h │ │ ├── statvfs.h │ │ ├── statx.h │ │ ├── stropts.h │ │ ├── swap.h │ │ ├── syscall.h │ │ ├── sysctl.h │ │ ├── sysinfo.h │ │ ├── syslog.h │ │ ├── sysmacros.h │ │ ├── time.h │ │ ├── timeb.h │ │ ├── timerfd.h │ │ ├── times.h │ │ ├── timex.h │ │ ├── types.h │ │ ├── ucontext.h │ │ ├── uio.h │ │ ├── un.h │ │ ├── user.h │ │ ├── utsname.h │ │ ├── vfs.h │ │ ├── vt.h │ │ ├── wait.h │ │ └── xattr.h │ ├── syscall.h │ ├── sysexits.h │ ├── syslog.h │ ├── tar.h │ ├── termios.h │ ├── tgmath.h │ ├── time.h │ ├── ucontext.h │ ├── ulimit.h │ ├── unistd.h │ ├── utime.h │ ├── utmp.h │ ├── utmpx.h │ ├── values.h │ ├── wchar.h │ ├── wctype.h │ ├── wordexp.h │ └── x64 │ │ ├── bits │ │ ├── alltypes.h.sh │ │ ├── endian.h │ │ ├── errno.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── io.h │ │ ├── ioctl.h │ │ ├── ipc.h │ │ ├── ipcstat.h │ │ ├── limits.h │ │ ├── link.h │ │ ├── mman.h │ │ ├── msg.h │ │ ├── poll.h │ │ ├── posix.h │ │ ├── reg.h │ │ ├── setjmp.h │ │ ├── shm.h │ │ ├── signal.h │ │ ├── socket.h │ │ ├── stat.h │ │ ├── statfs.h │ │ ├── stdint.h │ │ ├── syscall.h │ │ ├── termios.h │ │ └── user.h │ │ ├── pthread_arch.h │ │ └── syscall_arch.h ├── glibc-compat │ ├── bits │ │ └── wordsize.h │ ├── ctype.h │ ├── features.h │ ├── linux │ │ └── version.h │ ├── locale.h │ ├── sys │ │ ├── cdefs.h │ │ ├── errno.h │ │ └── ioctl.h │ └── xlocale.h ├── lockfree │ ├── mutex.hh │ ├── queue-mpsc.hh │ ├── ring.hh │ ├── unordered-queue-mpsc.hh │ ├── unordered-queue-spsc.hh │ └── unordered_ring_mpsc.hh └── osv │ ├── addr_range.hh │ ├── align.hh │ ├── aligned_new.hh │ ├── alloctracker.hh │ ├── alternative.hh │ ├── app.hh │ ├── async.hh │ ├── barrier.hh │ ├── bio.h │ ├── bitops.h │ ├── bitset-iter.hh │ ├── boot.hh │ ├── buf.h │ ├── callstack.hh │ ├── clock.hh │ ├── commands.hh │ ├── compiler.h │ ├── condvar.h │ ├── contiguous_alloc.hh │ ├── dbg-alloc.hh │ ├── debug.h │ ├── debug.hh │ ├── defer.hh │ ├── demangle.hh │ ├── dentry.h │ ├── device.h │ ├── dhcp.hh │ ├── elf.hh │ ├── error.h │ ├── exception_utils.hh │ ├── execinfo.h │ ├── execinfo.hh │ ├── export.h │ ├── fcntl.h │ ├── file.h │ ├── firmware.hh │ ├── hypervisor.hh │ ├── ilog2.hh │ ├── index-list.hh │ ├── initialize.hh │ ├── interrupt.hh │ ├── intr_random.hh │ ├── ioctl.h │ ├── irqlock.hh │ ├── latch.hh │ ├── lazy_indirect.hh │ ├── lockless-queue.hh │ ├── mempool.hh │ ├── migration-lock.hh │ ├── mmio.hh │ ├── mmu-defs.hh │ ├── mmu.hh │ ├── mount.h │ ├── msi.hh │ ├── mutex.h │ ├── net_channel.hh │ ├── net_trace.hh │ ├── newpoll.hh │ ├── nway_merger.hh │ ├── options.hh │ ├── osv_c_wrappers.h │ ├── osv_execve.h │ ├── pagealloc.hh │ ├── pagecache.hh │ ├── pci.hh │ ├── per-cpu-counter.hh │ ├── percpu-worker.hh │ ├── percpu.hh │ ├── percpu_xmit.hh │ ├── pid.h │ ├── poll.h │ ├── power.hh │ ├── preempt-lock.hh │ ├── prex.h │ ├── printf.hh │ ├── prio.hh │ ├── pvclock-abi.hh │ ├── rcu-hashtable.hh │ ├── rcu-list.hh │ ├── rcu.hh │ ├── run.hh │ ├── rwlock.h │ ├── sampler.hh │ ├── sched.hh │ ├── semaphore.hh │ ├── shrinker.h │ ├── shutdown.hh │ ├── signal.hh │ ├── socket.hh │ ├── spinlock.h │ ├── strace.hh │ ├── string.h │ ├── string_utils.hh │ ├── stubbing.hh │ ├── symbols.hh │ ├── timer-set.hh │ ├── trace-count.hh │ ├── trace.hh │ ├── tracecontrol.hh │ ├── types.h │ ├── uio.h │ ├── version.hh │ ├── vfs_file.hh │ ├── virt_to_phys.hh │ ├── vnode.h │ ├── vnode_attr.h │ ├── wait_record.hh │ ├── waitqueue.hh │ ├── xen.hh │ ├── xen_intr.hh │ ├── zcopy.h │ └── zcopy.hh ├── libc ├── README.md ├── __pread64_chk.cc ├── __read_chk.c ├── af_local.cc ├── af_local.h ├── aliases.ld ├── arch │ ├── README.md │ ├── aarch64 │ │ ├── atomic.h │ │ └── setjmp │ │ │ └── sigsetjmp.s │ └── x64 │ │ ├── atomic.h │ │ ├── setjmp │ │ └── sigsetjmp.s │ │ └── ucontext │ │ ├── getcontext.s │ │ ├── setcontext.s │ │ ├── start_context.s │ │ └── ucontext.cc ├── cpu_set.cc ├── cxa_thread_atexit.cc ├── dlfcn.cc ├── env │ ├── README.md │ ├── __environ.c │ └── secure_getenv.c ├── errno │ ├── README.md │ └── strerror.c ├── eventfd.cc ├── include │ └── sys │ │ └── random.h ├── inotify.cc ├── internal │ ├── _chk_fail.cc │ ├── floatscan.c │ ├── floatscan.h │ ├── fp_arch.h │ ├── intscan.c │ ├── intscan.h │ ├── libc.c │ ├── libc.h │ ├── libm.h │ ├── locale_impl.h │ ├── lock.h │ ├── pthread_stubs.h │ ├── shgetc.c │ └── shgetc.h ├── libc.cc ├── libc.hh ├── linux │ └── makedev.c ├── locale │ ├── README.md │ ├── catopen.c │ ├── duplocale.c │ ├── freelocale.c │ ├── iconv_stubs.cc │ ├── intl.c │ ├── langinfo.c │ ├── setlocale.c │ ├── strtod_l.c │ ├── strtof_l.c │ ├── strtold_l.c │ └── uselocale.c ├── malloc_hooks.cc ├── mallopt.cc ├── manifest.txt ├── math │ ├── README.md │ └── finitel.c ├── misc │ ├── README.md │ ├── __longjmp_chk.cc │ ├── backtrace.cc │ ├── error.c │ ├── gethostid.cc │ ├── getopt.cc │ ├── getopt.hh │ ├── getopt_long.cc │ ├── lockf.cc │ ├── mntent.cc │ ├── realpath.c │ └── uname.c ├── mman.cc ├── mount.cc ├── multibyte │ ├── __mbsnrtowcs_chk.c │ ├── __mbsrtowcs_chk.c │ └── __mbstowcs_chk.c ├── network │ ├── README.md │ ├── __dns.cc │ ├── __dns.hh │ ├── __ipparse.c │ ├── __netlink.h │ ├── __socket.h │ ├── freeaddrinfo.c │ ├── getaddrinfo.c │ ├── gethostbyname_r.c │ └── getnameinfo.c ├── pipe.cc ├── pipe_buffer.cc ├── pipe_buffer.hh ├── prng │ ├── README.md │ └── random.c ├── process │ ├── README.md │ ├── execve.cc │ └── waitpid.cc ├── pthread.cc ├── pthread.hh ├── pthread_barrier.cc ├── random.c ├── resource.cc ├── sem.cc ├── shm.cc ├── signal.cc ├── signal.hh ├── signal │ ├── README.md │ ├── block.c │ └── siglongjmp.c ├── stdio │ ├── README.md │ ├── __fdopen.c │ ├── __fopen_rb_ca.c │ ├── __fprintf_chk.c │ ├── __fread_chk.c │ ├── __lockfile.c │ ├── __stdio_read.c │ ├── __stdout_write.cc │ ├── __vfprintf_chk.c │ ├── fgetc.c │ ├── flockfile.c │ ├── fmemopen.c │ ├── fputc.c │ ├── ftrylockfile.c │ ├── funlockfile.c │ ├── getc.c │ ├── getchar.c │ ├── ofl.c │ ├── open_memstream.c │ ├── open_wmemstream.c │ ├── printf-hooks.cc │ ├── putc.c │ ├── putchar.c │ ├── remove.c │ ├── setvbuf.c │ ├── shgetc.h │ ├── sscanf.c │ ├── stderr.c │ ├── stdin.c │ ├── stdio_impl.h │ ├── stdout.c │ ├── vdprintf.c │ ├── vfprintf.c │ ├── vsnprintf.c │ ├── vsscanf.c │ ├── vswprintf.c │ └── vswscanf.c ├── stdlib │ ├── README.md │ ├── qsort_r.c │ ├── strtod.c │ ├── strtol.c │ ├── unimplemented.cc │ └── wcstol.c ├── string │ ├── README.md │ ├── __explicit_bzero_chk.c │ ├── __memcpy_chk.c │ ├── __memmove_chk.c │ ├── __memset_chk.c │ ├── __stpcpy_chk.c │ ├── __strcat_chk.c │ ├── __strcpy_chk.c │ ├── __strncat_chk.c │ ├── __strncpy_chk.c │ ├── __wcscpy_chk.c │ ├── __wcsncpy_chk.c │ ├── __wmemcpy_chk.c │ ├── __wmemmove_chk.c │ ├── __wmemset_chk.c │ ├── explicit_bzero.c │ ├── memcpy.c │ ├── memmove.c │ ├── memset.c │ ├── rawmemchr.c │ ├── strerror_r.c │ └── stresep.c ├── syscall_to_function.h ├── syslog.c ├── time.cc ├── time │ ├── __tz.c │ ├── __year_to_secs.c │ └── time_impl.h ├── timerfd.cc ├── unistd │ ├── README.md │ ├── getpgid.c │ ├── getpgrp.c │ ├── getppid.c │ ├── getsid.c │ ├── sethostname.c │ ├── setpgid.cc │ ├── sync.cc │ └── ttyname_r.c ├── user.cc └── vdso │ ├── aarch64 │ └── vdso.version │ ├── vdso.cc │ ├── vdso.lds │ └── x64 │ └── vdso.version ├── libvdso-content.S ├── licenses ├── acpica.txt ├── bionic.txt ├── boost.txt ├── cirp.txt ├── fastlog2.txt ├── fastlz.txt ├── freebsd-md5c.txt ├── libm.txt ├── libtsm.txt ├── lsroute.txt ├── lz4.txt ├── mfs.txt ├── musl.txt ├── newlib.txt ├── prex.txt ├── qsort.txt ├── realpath.txt ├── ucb+att.txt ├── ucb.txt └── virtio.txt ├── linux.cc ├── loader.cc ├── modules ├── ca-certificates │ ├── Makefile │ └── usr.manifest ├── certs │ ├── Makefile │ ├── ca.info │ ├── client.info │ ├── import-to-nss.sh │ ├── server.info │ └── usr.manifest ├── cli │ ├── .gitignore │ ├── Makefile │ ├── cli.c │ ├── cli.lua │ ├── commands │ │ ├── api.lua │ │ ├── cat.lua │ │ ├── cd.lua │ │ ├── date.lua │ │ ├── df.lua │ │ ├── dmesg.lua │ │ ├── echo.lua │ │ ├── exit.lua │ │ ├── free.lua │ │ ├── hello.lua │ │ ├── help.lua │ │ ├── ls.lua │ │ ├── mkdir.lua │ │ ├── poweroff.lua │ │ ├── reboot.lua │ │ ├── rm.lua │ │ ├── run.lua │ │ ├── top.lua │ │ └── uptime.lua │ ├── doc │ │ ├── osv-cli.md │ │ └── osv.lua.md │ ├── lib │ │ ├── context.lua │ │ ├── cwd.lua │ │ ├── data_dumper.lua │ │ ├── osv_api.lua │ │ ├── testing.lua │ │ └── util.lua │ ├── module.py │ ├── mpm │ │ └── package.yaml │ ├── rpmbuild │ │ ├── .gitignore │ │ ├── Makefile │ │ └── SPECS │ │ │ └── osv-cli.spec │ ├── test.sh │ └── test │ │ ├── cat_test.lua │ │ ├── cd_test.lua │ │ ├── date_test.lua │ │ ├── df_test.lua │ │ ├── dmesg_test.lua │ │ ├── echo_test.lua │ │ ├── free_test.lua │ │ ├── ls_test.lua │ │ ├── mkdir_test.lua │ │ └── rm_test.lua ├── cloud-init │ ├── .gitignore │ ├── Makefile │ ├── cassandra-module.cc │ ├── cassandra-module.hh │ ├── client.cc │ ├── client.hh │ ├── cloud-init.cc │ ├── cloud-init.hh │ ├── cloud-init.yaml │ ├── cmdline │ ├── data-source.cc │ ├── data-source.hh │ ├── files-module.hh │ ├── json.cc │ ├── json.hh │ ├── main.cc │ ├── module.py │ ├── monitor-agent-module.hh │ ├── server-module.hh │ ├── template.cc │ ├── template.hh │ └── tst-template.cc ├── common.gmk ├── dl_tests │ ├── Makefile │ └── bionic │ │ └── tests │ │ └── libs │ │ ├── check_rtld_next_from_library.cpp │ │ ├── dlext_test_library.cpp │ │ ├── dlopen_testlib_simple.cpp │ │ ├── dlsym_from_this_functions.cpp │ │ ├── dlsym_from_this_symbol.cpp │ │ ├── dlsym_from_this_symbol2.cpp │ │ └── empty.cpp ├── empty │ ├── module.py │ └── mpm │ │ └── package.yaml ├── golang │ ├── .gitignore │ ├── Makefile │ ├── go.cc │ └── mpm │ │ └── package.yaml ├── httpserver-api-https-tests │ ├── init │ │ └── 30-auto-00 │ └── usr.manifest ├── httpserver-api-tests │ ├── init │ │ └── 30-auto-00 │ ├── mpm │ │ └── package.yaml │ └── usr.manifest ├── httpserver-api │ ├── .gitignore │ ├── Makefile │ ├── api-doc │ │ └── listings │ │ │ ├── api.json │ │ │ ├── app.json │ │ │ ├── env.json │ │ │ ├── file.json │ │ │ ├── fs.json │ │ │ ├── hardware.json │ │ │ ├── network.json │ │ │ ├── os.json │ │ │ └── trace.json │ ├── api │ │ ├── api.cc │ │ ├── api.hh │ │ ├── app.cc │ │ ├── app.hh │ │ ├── env.cc │ │ ├── env.hh │ │ ├── file.cc │ │ ├── file.hh │ │ ├── fs.cc │ │ ├── fs.hh │ │ ├── hardware.cc │ │ ├── hardware.hh │ │ ├── network.cc │ │ ├── network.hh │ │ ├── os.cc │ │ ├── os.hh │ │ ├── trace.cc │ │ └── trace.hh │ ├── common.cc │ ├── common.hh │ ├── connection.cc │ ├── connection.hh │ ├── connection_manager.cc │ ├── connection_manager.hh │ ├── exception.hh │ ├── global_server.cc │ ├── global_server.hh │ ├── handlers.cc │ ├── handlers.hh │ ├── header.hh │ ├── json │ │ ├── api_docs.cc │ │ ├── api_docs.hh │ │ ├── formatter.cc │ │ ├── formatter.hh │ │ ├── json_elements.cc │ │ ├── json_elements.hh │ │ ├── json_path.cc │ │ └── json_path.hh │ ├── json2code.py │ ├── main.cc │ ├── matcher.cc │ ├── matcher.hh │ ├── matchrules.hh │ ├── mime_types.cc │ ├── mime_types.hh │ ├── module.py │ ├── mpm │ │ └── package.yaml │ ├── openssl-init.cc │ ├── openssl-init.hh │ ├── path_holder.cc │ ├── path_holder.hh │ ├── plain_server.cc │ ├── plain_server.hh │ ├── reply.cc │ ├── reply.hh │ ├── request.hh │ ├── request_handler.cc │ ├── request_handler.hh │ ├── request_parser.cc │ ├── request_parser.hh │ ├── routes.cc │ ├── routes.hh │ ├── server.cc │ ├── server.hh │ ├── ssl_server.cc │ ├── ssl_server.hh │ ├── stub │ │ ├── debug.cc │ │ ├── java_api.cc │ │ ├── shutdown.cc │ │ ├── trace_api.cc │ │ └── version.cc │ ├── test.sh │ ├── tests │ │ ├── api │ │ │ ├── testenv.py │ │ │ ├── testfile.py │ │ │ ├── testfs.py │ │ │ ├── testjolokia.py │ │ │ ├── testjvm.py │ │ │ ├── testnetwork.py │ │ │ ├── testos.py │ │ │ └── testtrace.py │ │ ├── basetest.py │ │ ├── monitoring-api │ │ │ ├── testenv.py │ │ │ ├── testfile.py │ │ │ ├── testfs.py │ │ │ ├── testnetwork.py │ │ │ └── testos.py │ │ ├── ssl │ │ │ └── test_connection.py │ │ ├── testhttpserver-api.py │ │ └── testhttpserver-monitoring-api.py │ ├── transformers.cc │ ├── transformers.hh │ └── transport.hh ├── httpserver-html5-gui │ ├── Makefile │ ├── httpserver.conf │ ├── module.py │ ├── mpm │ │ └── package.yaml │ └── tests │ │ ├── static │ │ └── teststatic.py │ │ └── testhttpserver.py ├── httpserver-jolokia-plugin │ ├── .gitignore │ ├── Makefile │ ├── api-doc │ │ └── listings │ │ │ └── jolokia.json │ ├── jolokia-agent │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── osv │ │ │ └── jolokia │ │ │ ├── Dispatcher.java │ │ │ └── RequestAndResponse.java │ ├── jolokia.cc │ ├── jolokia.hh │ └── module.py ├── httpserver-jvm-plugin │ ├── Makefile │ ├── api-doc │ │ └── listings │ │ │ └── jvm.json │ ├── jvm.cc │ ├── jvm.hh │ └── module.py ├── httpserver-monitoring-api │ ├── .gitignore │ ├── Makefile │ ├── add_aarch64_libraries.sh │ ├── api-doc │ │ └── listings │ │ │ ├── api.json │ │ │ ├── env.json │ │ │ ├── file.json │ │ │ ├── fs.json │ │ │ ├── hardware.json │ │ │ ├── network.json │ │ │ └── os.json │ ├── module.py │ └── mpm │ │ └── package.yaml ├── httpserver │ ├── Makefile │ └── module.py ├── java-base │ ├── Makefile │ ├── balloon │ │ ├── balloon_api.hh │ │ ├── jvm_balloon.cc │ │ └── jvm_balloon.hh │ ├── common.gmk │ ├── java.cc │ ├── jni │ │ ├── monitor.cc │ │ └── monitor.hh │ ├── jvm │ │ ├── java_api.cc │ │ ├── java_api.hh │ │ ├── jni_helpers.cc │ │ └── jni_helpers.hh │ ├── module.py │ ├── pom.xml │ ├── runjava-common │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── osv │ │ │ ├── AppThreadTerminatedWithUncaughtException.java │ │ │ ├── GCInfo.java │ │ │ ├── JavaInfo.java │ │ │ ├── Jvm.java │ │ │ ├── MainClassNotFoundException.java │ │ │ ├── OSvGCMonitor.java │ │ │ ├── RunJvmAppHelper.java │ │ │ └── util │ │ │ ├── ClassDiagnostics.java │ │ │ └── json │ │ │ ├── ArrayBuilder.java │ │ │ └── JsonGenerator.java │ ├── runjava-isolated │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── osv │ │ │ ├── isolated │ │ │ ├── Context.java │ │ │ ├── ContextFailedException.java │ │ │ ├── IsolatedJvm.java │ │ │ ├── IsolatingOsvSystemClassLoader.java │ │ │ ├── MultiJarLoader.java │ │ │ └── RunIsolatedJvmApp.java │ │ │ ├── jul │ │ │ ├── DefaultLogManager.java │ │ │ ├── IsolatingLogManager.java │ │ │ └── LogManagerWrapper.java │ │ │ └── util │ │ │ ├── InitializationException.java │ │ │ └── LazilyInitialized.java │ ├── runjava-non-isolated │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── osv │ │ │ └── nonisolated │ │ │ ├── NonIsolatedJvm.java │ │ │ ├── NonIsolatingOsvSystemClassLoader.java │ │ │ └── RunNonIsolatedJvmApp.java │ └── usr.manifest ├── java-cmd │ └── module.py ├── java-isolated │ ├── .java.policy │ ├── Makefile │ ├── module.py │ └── usr.manifest ├── java-mgmt │ ├── Makefile │ ├── cloudius │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── cloudius │ │ │ ├── Config.java │ │ │ ├── balloon │ │ │ └── Balloon.java │ │ │ ├── cli │ │ │ ├── tests │ │ │ │ ├── TCPConcurrentDownloads.java │ │ │ │ ├── TCPDownloadFile.java │ │ │ │ ├── TCPEchoServerTest.java │ │ │ │ ├── TCPExternalCommunication.java │ │ │ │ ├── Test.java │ │ │ │ ├── TestELF.java │ │ │ │ └── TestRunner.java │ │ │ └── util │ │ │ │ ├── ELFLoader.java │ │ │ │ ├── Networking.java │ │ │ │ └── Shrew.java │ │ │ ├── net │ │ │ ├── Arp.java │ │ │ ├── DHCP.java │ │ │ ├── IFConfig.java │ │ │ └── Route.java │ │ │ ├── trace │ │ │ ├── Callstack.java │ │ │ ├── Counter.java │ │ │ └── Tracepoint.java │ │ │ └── util │ │ │ ├── Exec.java │ │ │ ├── IStty.java │ │ │ ├── MD5.java │ │ │ ├── Power.java │ │ │ ├── PrintClassPath.java │ │ │ └── Stty.java │ ├── jni │ │ ├── balloon.c │ │ ├── elf-loader.cc │ │ ├── networking.cc │ │ ├── power.cc │ │ ├── stty.c │ │ ├── tracepoint.cc │ │ └── tracepoint.hh │ └── usr.manifest ├── java-non-isolated │ ├── .java.policy │ ├── Makefile │ ├── module.py │ ├── mpm │ │ └── package.yaml │ └── usr.manifest ├── java-tests │ ├── .gitignore │ ├── .java.policy │ ├── Makefile │ ├── module.py │ ├── pom.xml │ ├── tests-for-java9_1x │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── osv │ │ │ ├── BasicTest.java │ │ │ ├── BasicTests.java │ │ │ ├── LoggingTest.java │ │ │ ├── TemporarySecurityManager.java │ │ │ └── TestDomainPermissions.java │ ├── tests-isolates │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── tests │ │ │ ├── ClassFinder.java │ │ │ ├── ClassPresentInBothContexts.java │ │ │ ├── FieldTester.java │ │ │ ├── LoggingProcess.java │ │ │ ├── NonIsolatedLoggingProcess.java │ │ │ ├── PropertyReader.java │ │ │ ├── PropertySetter.java │ │ │ └── StaticFieldSetter.java │ ├── tests-jre-extension │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── tests │ │ │ └── SomeExtensionClass.java │ └── tests │ │ ├── pom.xml │ │ └── src │ │ └── main │ │ └── java │ │ ├── io │ │ └── osv │ │ │ ├── AllTestsThatTestIsolatedApp.java │ │ │ ├── AllTestsThatTestNonIsolatedApp.java │ │ │ ├── BasicTest.java │ │ │ ├── BasicTests.java │ │ │ ├── ClassLoaderIsolationTest.java │ │ │ ├── ClassLoaderWithoutIsolationTest.java │ │ │ ├── LoggingIsolationTest.java │ │ │ ├── LoggingTest.java │ │ │ ├── LoggingWithoutIsolationTest.java │ │ │ ├── OsvApiTest.java │ │ │ ├── PropertyIsolationTest.java │ │ │ ├── TemporarySecurityManager.java │ │ │ ├── TestDomainPermissions.java │ │ │ └── TestLaunching.java │ │ └── tests │ │ ├── ClassPresentInBothContexts.java │ │ ├── ClassPresentOnlyInParentContext.java │ │ └── ClassPutInRoot.java ├── java │ └── module.py ├── josvsym │ ├── Makefile │ ├── josvsym.cc │ └── usr.manifest ├── libcdio │ ├── .gitignore │ ├── Makefile │ ├── exit.patch │ ├── module.py │ └── relink-binary.sh ├── libedit │ ├── .gitignore │ ├── Makefile │ └── module.py ├── libext │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── ext_vfsops.cc │ ├── ext_vnops.cc │ ├── module.py │ └── test.sh ├── libnfs │ ├── .gitignore │ ├── Makefile │ └── usr.manifest ├── libtools │ ├── .gitignore │ ├── Makefile │ ├── ifconfig.cc │ ├── lsroute.cc │ ├── network_interface.cc │ ├── network_interface.hh │ ├── route_info.cc │ └── route_info.hh ├── libyaml │ └── Makefile ├── libz │ ├── .gitignore │ └── Makefile ├── lua │ ├── .gitignore │ ├── Makefile │ └── module.py ├── lwext4 │ ├── .gitignore │ ├── Makefile │ └── usr.manifest ├── monitoring-agent │ ├── .gitignore │ ├── Makefile │ ├── client.cc │ ├── client.hh │ ├── cmdline │ ├── main.cc │ ├── module.py │ ├── monitor-agent.cc │ └── monitor-agent.hh ├── ncurses │ ├── .gitignore │ ├── Makefile │ ├── module.py │ └── ncurses-5.9-gcc-5.patch ├── nfs-tests │ ├── .gitignore │ ├── Makefile │ ├── fsx-linux.c │ ├── module.py │ ├── test.py │ └── tst-nfs.cc ├── nfs │ ├── .gitignore │ ├── Makefile │ ├── module.py │ ├── nfs.cc │ ├── nfs.hh │ ├── nfs_vfsops.cc │ └── nfs_vnops.cc ├── openjdk8-from-host │ ├── .gitignore │ ├── Makefile │ └── module.py ├── openjdk9_1x-from-host │ ├── .gitignore │ ├── Makefile │ └── module.py ├── openssl │ ├── .gitignore │ ├── Makefile │ └── module.py ├── sysinfo │ ├── .gitignore │ ├── Makefile │ ├── module.py │ ├── sysinfo.cc │ └── usr.manifest ├── terminfo │ ├── .gitignore │ ├── Makefile │ └── module.py ├── tests-with-linux-ld │ ├── .gitignore │ ├── Makefile │ ├── create_static.sh │ ├── module.py │ └── usr.manifest.skel ├── tests │ ├── .gitignore │ ├── Makefile │ ├── add_aarch64_boost_libraries.sh │ ├── create_static.sh │ ├── module.py │ ├── mpm │ │ └── package.yaml │ ├── test.sh │ └── usr.manifest.skel ├── uush │ ├── bootfs.manifest │ └── module.py ├── zfs-tools │ └── usr.manifest └── zfs │ └── usr.manifest ├── musl ├── runtime.cc ├── scripts ├── README.md ├── aws │ ├── instance-parameters.json │ └── instance.yaml ├── benchs │ └── zfs_mount.py ├── build ├── build-capstan-base-image ├── build-capstan-mpm-packages ├── build-vm-images ├── build-vm-img ├── check-image-size.sh ├── check-libcfunc-avail.sh ├── checkpatch.pl ├── convert ├── create_tap_device.sh ├── deploy_to_aws.sh ├── deploy_to_gce.sh ├── disk.bin ├── download_aarch64_packages.py ├── download_aarch64_toolchain.sh ├── download_and_build_boost.sh ├── download_and_build_qemu.sh ├── download_fedora_aarch64_rpm_package.sh ├── download_ubuntu_aarch64_deb_package.sh ├── ec2-gc.py ├── ec2-make-ami.py ├── ec2-simulator.py ├── ec2-tester.sh ├── ec2-utils.sh ├── export_manifest.py ├── extract_symbols.sh ├── firecracker.py ├── freq.py ├── gen-drivers-config-header ├── gen-gce-tarball.sh ├── gen-kernel-config-headers ├── gen-rofs-img.py ├── gen-syscalls ├── gen-vbox-ova.sh ├── gen-version-header ├── gen-vmx.sh ├── generate_app_version_script.sh ├── generate_version_script.sh ├── github_releases_util.py ├── imgedit.py ├── libosv.py ├── linux_distro.py ├── list_manifest_files.py ├── loader.py ├── manifest_common.py ├── manifest_from_host.sh ├── memory_analyzer.py ├── metadata.py ├── mkbootfs.py ├── mkromfs.sh ├── module.py ├── nbd_client.py ├── osv-version.sh ├── osv │ ├── __init__.py │ ├── client.py │ ├── debug.py │ ├── modules │ │ ├── __init__.py │ │ ├── api.py │ │ ├── filemap.py │ │ └── resolve.py │ ├── prof.py │ ├── trace.py │ └── tree.py ├── post-processing │ └── scheduler │ │ ├── README.txt │ │ ├── histo.py │ │ └── trace_sched_timings.py ├── prof.py ├── pull_github_pr.sh ├── qemu-ifup.sh ├── release-ec2.sh ├── release-s3 ├── remove_dnsmasq.sh ├── restore_iptables.sh ├── run.py ├── setup-external-bridge.sh ├── setup.py ├── setup_dnsmasq.sh ├── setup_fc_networking.sh ├── setup_iptables.sh ├── silentant.py ├── test-ruby.py ├── test.py ├── tester.py ├── tests │ ├── __init__.py │ ├── compose_and_test_selected_apps.sh │ ├── run_misc_tests.sh │ ├── test_app.py │ ├── test_app_with_test_script.py │ ├── test_http_app.py │ ├── test_net.py │ ├── test_tracing.py │ └── testing.py ├── top.py ├── trace.py ├── upload-capstan-release ├── upload-cli ├── upload-ec2.sh ├── upload-gce-release ├── upload-libvirt.sh ├── upload-standalone-release ├── upload_manifest.py └── zfs-image-on-host.sh ├── static └── etc │ ├── fstab │ ├── fstab_rofs │ ├── hosts │ └── inputrc ├── syscalls ├── syscall_tracepoints.cc.in └── syscalls.cc.in ├── tests ├── bench │ ├── .classpath │ ├── .project │ ├── build.xml │ ├── com │ │ └── cloudiussystems │ │ │ ├── bench │ │ │ ├── Bench.java │ │ │ ├── Benchmark.java │ │ │ ├── ContextSwitchBench.java │ │ │ ├── NanoTimeBench.java │ │ │ ├── NullPointerExceptionBench.java │ │ │ └── SieveBench.java │ │ │ └── test │ │ │ ├── ClassLoadingTest.java │ │ │ ├── ClassWithAssertion.java │ │ │ ├── ClassWithAssertion2.java │ │ │ ├── ClassWithAssertion3.java │ │ │ ├── ClassWithAssertion4.java │ │ │ ├── ClassWithAssertion5.java │ │ │ ├── TCPEcho.java │ │ │ └── TCPEchoClient.java │ └── test.txt ├── env-common.inc ├── hello │ └── Hello.java ├── lib-circular-reloc1.cc ├── lib-circular-reloc2.cc ├── lib-misc-tls.cc ├── libtls.cc ├── misc-bdev-rw.cc ├── misc-bdev-wlatency.cc ├── misc-bdev-write.cc ├── misc-bsd-callout.cc ├── misc-concurrent-io.cc ├── misc-console.cc ├── misc-ctxsw.cc ├── misc-execve-payload.c ├── misc-execve.c ├── misc-free-perf.cc ├── misc-fs-stress.cc ├── misc-fsx.c ├── misc-futex-perf.cc ├── misc-gtod.c ├── misc-leak.cc ├── misc-lfring.cc ├── misc-loadbalance.cc ├── misc-lock-perf.cc ├── misc-malloc.cc ├── misc-memcpy.cc ├── misc-mmap-anon-perf.cc ├── misc-mmap-big-file.cc ├── misc-mutex.cc ├── misc-mutex2.cc ├── misc-panic.cc ├── misc-printf.cc ├── misc-procfs.c ├── misc-ramdisk.c ├── misc-random.c ├── misc-readbench.cc ├── misc-reboot.cc ├── misc-scheduler.cc ├── misc-setpriority.cc ├── misc-sockets.cc ├── misc-syscall-perf.c ├── misc-tcp-close-without-reading.cc ├── misc-tcp-hash-srv.cc ├── misc-tcp-sendonly.cc ├── misc-tcp.cc ├── misc-timeslice.cc ├── misc-tls.cc ├── misc-urandom.c ├── misc-vdso-perf.c ├── misc-wake.cc ├── misc-zfs-arc.cc ├── misc-zfs-disk.c ├── misc-zfs-io.cc ├── payload-env.cc ├── payload-merge-env.cc ├── payload-namespace.cc ├── reclaim │ ├── build.xml │ └── com │ │ └── cloudiussystems │ │ └── reclaim │ │ ├── FSConsumer.java │ │ ├── JVMConsumer.java │ │ └── Reclaim.java ├── stat.hh ├── testrunner.cc ├── tst-af-local.cc ├── tst-align.cc ├── tst-app.cc ├── tst-async.cc ├── tst-bitset-iter.cc ├── tst-brk.c ├── tst-bsd-evh.c ├── tst-bsd-kthread.c ├── tst-bsd-synch.hh ├── tst-bsd-taskqueue.c ├── tst-bsd-tcp1-zrcv.cc ├── tst-bsd-tcp1-zsnd.cc ├── tst-bsd-tcp1-zsndrcv.cc ├── tst-bsd-tcp1.cc ├── tst-calloc.cc ├── tst-chdir.cc ├── tst-chmod.cc ├── tst-clock.cc ├── tst-commands.cc ├── tst-concurrent-init.cc ├── tst-concurrent-read.cc ├── tst-condvar.cc ├── tst-console.cc ├── tst-crypt.c ├── tst-ctype.cc ├── tst-cxxlocale.cc ├── tst-dax.cc ├── tst-devices.hh ├── tst-dlfcn.cc ├── tst-dns-resolver.cc ├── tst-elf-circular-reloc.cc ├── tst-elf-init.cc ├── tst-elf-permissions.cc ├── tst-epoll.cc ├── tst-eventfd.cc ├── tst-except.cc ├── tst-f128.cc ├── tst-faccessat.cc ├── tst-fallocate.cc ├── tst-fcntl.cc ├── tst-feexcept.cc ├── tst-fpu.cc ├── tst-fread.cc ├── tst-fs-link.cc ├── tst-fs.hh ├── tst-fstatat.cc ├── tst-futimesat.cc ├── tst-getdents.cc ├── tst-getopt.cc ├── tst-hello.cc ├── tst-hostname.cc ├── tst-hub.cc ├── tst-hub.hh ├── tst-huge.cc ├── tst-ifaddrs.cc ├── tst-kill.cc ├── tst-libc-locking.cc ├── tst-malloc.hh ├── tst-math.cc ├── tst-memmove.cc ├── tst-mmap-file.cc ├── tst-mmap.cc ├── tst-mmap.hh ├── tst-mmx-fpu.cc ├── tst-namespace.cc ├── tst-net_if_test.cc ├── tst-netlink.c ├── tst-non-fpic.cc ├── tst-non-pie.cc ├── tst-nway-merger.cc ├── tst-openat.cc ├── tst-options.cc ├── tst-pin.cc ├── tst-pipe.cc ├── tst-poll.cc ├── tst-preempt.cc ├── tst-printf.cc ├── tst-promise.cc ├── tst-pthread-affinity-inherit.cc ├── tst-pthread-affinity.cc ├── tst-pthread-barrier.cc ├── tst-pthread-clock.cc ├── tst-pthread-create.cc ├── tst-pthread-setcancelstate.cc ├── tst-pthread-tsd.cc ├── tst-pthread.c ├── tst-queue-mpsc.cc ├── tst-rcu-hashtable.cc ├── tst-rcu-list.cc ├── tst-read.cc ├── tst-readdir.cc ├── tst-realloc.cc ├── tst-regex.cc ├── tst-reloc.c ├── tst-remove.cc ├── tst-rename.cc ├── tst-resolve.c ├── tst-ring-spsc-wraparound.cc ├── tst-run.cc ├── tst-rwlock.hh ├── tst-sampler.cc ├── tst-seek.cc ├── tst-select-timeout.cc ├── tst-sem-timed-wait.cc ├── tst-semaphore.c ├── tst-sendfile.cc ├── tst-setjmp.cc ├── tst-shm.cc ├── tst-sigaction.cc ├── tst-sigaltstack.cc ├── tst-sigwait.cc ├── tst-sleep.cc ├── tst-small-malloc.cc ├── tst-solaris-taskq.c ├── tst-stat.cc ├── tst-stdio.cc ├── tst-strerror_r.cc ├── tst-string-utils.cc ├── tst-string.cc ├── tst-symlink.cc ├── tst-syscall.cc ├── tst-tcp-cork.cc ├── tst-tcp-hash-cli.py ├── tst-tcp-listen.cc ├── tst-tcp-nbwrite.cc ├── tst-tcp-siocoutq.cc ├── tst-tcp-v6.cc ├── tst-thread-local.cc ├── tst-threadcomplete.cc ├── tst-threads.hh ├── tst-time.cc ├── tst-timer-set.cc ├── tst-timer.hh ├── tst-timerfd.cc ├── tst-tls.cc ├── tst-tracepoint.cc ├── tst-truncate.c ├── tst-ttyname.c ├── tst-uio.cc ├── tst-unordered-ring-mpsc.cc ├── tst-utimensat.cc ├── tst-utimes.cc ├── tst-vblk.c ├── tst-vfs.cc ├── tst-wait-for.cc ├── tst-wctype.cc ├── tst-without-namespace.cc ├── tst-yield.cc └── tst-zfs-mount.cc ├── tools ├── cpiod │ ├── cpio.cc │ ├── cpio.hh │ └── cpiod.cc ├── mkfs │ └── mkfs.cc ├── mount │ ├── mount-fs.cc │ └── umount.cc └── uush │ ├── ls.cc │ ├── mkdir.cc │ └── uush.cc ├── usr.manifest.skel ├── usr_ramfs.manifest.skel ├── usr_rofs.manifest.skel ├── zfs_builder_bootfs.S └── zfs_builder_bootfs.manifest.skel /arch/aarch64/arch-cpu.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * Copyright (C) 2014 Huawei Technologies Duesseldorf GmbH 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | 10 | #include "arch-cpu.hh" 11 | #include 12 | #include 13 | 14 | namespace sched { 15 | 16 | __thread unsigned exception_depth = 0; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /arch/aarch64/dump.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef DUMP_HH 9 | #define DUMP_HH 10 | 11 | struct exception_frame; 12 | 13 | void dump_registers(exception_frame* ef); 14 | 15 | #endif /* DUMP_HH */ 16 | -------------------------------------------------------------------------------- /arch/aarch64/early-console.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Huawei Technologies Duesseldorf GmbH 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | #include "early-console.hh" 12 | 13 | namespace console { 14 | 15 | union AARCH64_Console aarch64_console; 16 | console_driver & arch_early_console = aarch64_console.pl011; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /arch/aarch64/firmware.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | namespace osv { 11 | 12 | void firmware_probe() 13 | { 14 | } 15 | 16 | std::string firmware_vendor() 17 | { 18 | return "Unknown"; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /arch/aarch64/hypervisor.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | namespace osv { 11 | 12 | hypervisor_type hypervisor() 13 | { 14 | return hypervisor_type::unknown; 15 | } 16 | 17 | std::string hypervisor_name() 18 | { 19 | return "Unknown"; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /arch/aarch64/preboot.ld: -------------------------------------------------------------------------------- 1 | SECTIONS 2 | { 3 | .text : { *(.text) } 4 | } 5 | -------------------------------------------------------------------------------- /arch/aarch64/xen.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Sergiy Kibrik 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef XEN_ARCH_HH 9 | #define XEN_ARCH_HH 10 | 11 | #include "cpuid.hh" 12 | 13 | namespace xen { 14 | 15 | void get_features(processor::features_type &features); 16 | 17 | } 18 | 19 | #endif /* XEN_ARCH_HH */ 20 | 21 | 22 | -------------------------------------------------------------------------------- /arch/common/fault-fixup.hh: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct fault_fixup { 4 | ulong pc; 5 | ulong divert; 6 | friend bool operator<(fault_fixup a, fault_fixup b) { 7 | return a.pc < b.pc; 8 | } 9 | }; 10 | 11 | extern fault_fixup fault_fixup_start[], fault_fixup_end[]; 12 | 13 | static void sort_fault_fixup() __attribute__((constructor(init_prio::sort))); 14 | 15 | static void sort_fault_fixup() 16 | { 17 | std::sort(fault_fixup_start, fault_fixup_end); 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /arch/x64/boot16.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | OUTPUT_FORMAT(binary) 9 | 10 | MEMORY 11 | { 12 | BOOTSECT : ORIGIN = 0, LENGTH = 0x10000 13 | } 14 | 15 | SECTIONS 16 | { 17 | .text 0x7c00 : { *(.text) } > BOOTSECT 18 | } 19 | 20 | -------------------------------------------------------------------------------- /arch/x64/cfi.S: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Cloudius Systems, Ltd. 2 | # 3 | # This work is open source software, licensed under the terms of the 4 | # BSD license as described in the LICENSE file in the top-level directory. 5 | 6 | # macros for cfi annotations 7 | 8 | .macro pushq_cfi reg 9 | pushq \reg 10 | .cfi_adjust_cfa_offset 8 11 | .cfi_rel_offset \reg, 0 12 | .endm 13 | 14 | .macro popq_cfi reg 15 | popq \reg 16 | .cfi_adjust_cfa_offset -8 17 | .cfi_restore \reg 18 | .endm 19 | 20 | -------------------------------------------------------------------------------- /arch/x64/dmi.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef X64_DMI_HH 9 | #define X64_DMI_HH 10 | 11 | #include 12 | 13 | extern std::string dmi_bios_vendor; 14 | 15 | void dmi_probe(); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /arch/x64/dump.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef DUMP_HH 9 | #define DUMP_HH 10 | 11 | struct exception_frame; 12 | 13 | void dump_registers(exception_frame* ef); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /arch/x64/early-console.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Huawei Technologies Duesseldorf GmbH 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include "drivers/isa-serial.hh" 9 | #include 10 | 11 | namespace console { 12 | 13 | isa_serial_console arch_early_console __attribute__((init_priority((int)init_prio::console))); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /arch/x64/early-console.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Huawei Technologies Duesseldorf GmbH 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef EARLY_CONSOLE_HH 9 | #define EARLY_CONSOLE_HH 10 | 11 | #include "drivers/isa-serial.hh" 12 | 13 | namespace console { 14 | 15 | extern isa_serial_console arch_early_console; 16 | 17 | } 18 | 19 | #endif /* EARLY_CONSOLE_HH */ 20 | -------------------------------------------------------------------------------- /arch/x64/firmware.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | #include "dmi.hh" 11 | 12 | namespace osv { 13 | 14 | void firmware_probe() 15 | { 16 | dmi_probe(); 17 | } 18 | 19 | std::string firmware_vendor() 20 | { 21 | return dmi_bios_vendor; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /arch/x64/ioapic.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef IOAPIC_HH_ 9 | #define IOAPIC_HH_ 10 | 11 | namespace ioapic { 12 | 13 | void init(); 14 | 15 | } 16 | 17 | #endif /* IOAPIC_HH_ */ 18 | -------------------------------------------------------------------------------- /arch/x64/tlsdesc.S: -------------------------------------------------------------------------------- 1 | .text 2 | .global __tlsdesc_static 3 | .hidden __tlsdesc_static 4 | .type __tlsdesc_static,@function 5 | __tlsdesc_static: 6 | mov 8(%rax),%rax 7 | ret 8 | -------------------------------------------------------------------------------- /arch/x64/xen.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef XEN_ARCH_HH 9 | #define XEN_ARCH_HH 10 | 11 | #include "cpuid.hh" 12 | 13 | class gsi_level_interrupt; 14 | 15 | namespace xen { 16 | 17 | void xen_init(processor::features_type &features, unsigned base); 18 | gsi_level_interrupt *xen_set_callback(int irqno); 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /bootfs.S: -------------------------------------------------------------------------------- 1 | .pushsection .data 2 | .global bootfs_start 3 | .hidden bootfs_start 4 | bootfs_start: 5 | .incbin "bootfs.bin" 6 | .popsection 7 | -------------------------------------------------------------------------------- /bootfs.manifest.skel: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /usr/lib/fs/libsolaris.so: libsolaris.so 3 | -------------------------------------------------------------------------------- /bootfs_empty.manifest.skel: -------------------------------------------------------------------------------- 1 | [manifest] 2 | -------------------------------------------------------------------------------- /bsd/aarch64/machine/_inttypes.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD__INTTYPES_H 2 | #define _BSD__INTTYPES_H 3 | #include 4 | #endif 5 | -------------------------------------------------------------------------------- /bsd/aarch64/machine/bus.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_BUS_H_ 2 | #define _BSD_BUS_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/aarch64/machine/clock.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_CLOCK_H_ 2 | #define _BSD_CLOCK_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/aarch64/machine/cpufunc.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_CPUFUNC_H_ 2 | #define _BSD_CPUFUNC_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/aarch64/machine/frame.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_MACHINE_FRAME_H 2 | #define _OSV_BSD_MACHINE_FRAME_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/aarch64/machine/pcpu.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_MACHINE_PCPU_H 2 | #define _OSV_BSD_MACHINE_PCPU_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/aarch64/machine/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_RESOURCE_H_ 2 | #define _BSD_RESOURCE_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/aarch64/machine/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_STDARG_H 2 | #define _OSV_BSD_STDARG_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/aarch64/machine/vmparam.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_vmparam_H_ 2 | #define _BSD_vmparam_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/cddl/compat/opensolaris/include/priv.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD$ */ 2 | 3 | #ifndef _OPENSOLARIS_PRIV_H_ 4 | #define _OPENSOLARIS_PRIV_H_ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define PRIV_SYS_CONFIG 0 11 | 12 | static __inline int 13 | priv_ineffect(int priv) 14 | { 15 | 16 | assert(priv == PRIV_SYS_CONFIG); 17 | return (geteuid() == 0); 18 | } 19 | 20 | #endif /* !_OPENSOLARIS_PRIV_H_ */ 21 | -------------------------------------------------------------------------------- /bsd/cddl/compat/opensolaris/include/solaris.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD$ */ 2 | 3 | #ifndef _SOLARIS_H_ 4 | #define _SOLARIS_H_ 5 | 6 | #include 7 | 8 | #include 9 | 10 | #define NOTE(s) 11 | 12 | int mkdirp(const char *, mode_t); 13 | 14 | #endif /* !_SOLARIS_H_ */ 15 | -------------------------------------------------------------------------------- /bsd/cddl/compat/opensolaris/include/zone.h: -------------------------------------------------------------------------------- 1 | /* $FreeBSD$ */ 2 | 3 | #ifndef _ZONE_H_ 4 | #define _ZONE_H_ 5 | 6 | #include 7 | 8 | #endif /* !_ZONE_H_ */ 9 | -------------------------------------------------------------------------------- /bsd/init.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef INIT_HH 9 | #define INIT_HH 10 | 11 | void bsd_init(void); 12 | 13 | #endif // INIT_HH 14 | -------------------------------------------------------------------------------- /bsd/net.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef NET_HH 9 | #define NET_HH 10 | 11 | void net_init(void); 12 | 13 | 14 | #endif // NET_HH 15 | 16 | -------------------------------------------------------------------------------- /bsd/porting/kobj.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef _OSV_KOBJ_H 9 | #define _OSV_KOBJ_H 10 | #include 11 | struct _buf { 12 | intptr_t _fd; 13 | }; 14 | #endif 15 | -------------------------------------------------------------------------------- /bsd/porting/shrinker.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef SHRINKER_H_ 9 | #define SHRINKER_H_ 10 | 11 | void __attribute__((constructor)) bsd_shrinker_init(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /bsd/sys/cddl/compat/opensolaris/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bsd/sys/cddl/compat/opensolaris/sys/namei.h: -------------------------------------------------------------------------------- 1 | /* empty */ 2 | -------------------------------------------------------------------------------- /bsd/sys/cddl/compat/opensolaris/sys/systeminfo.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SYSTEMINFO_H_ 2 | #define _SYS_SYSTEMINFO_H_ 3 | 4 | #define HW_HOSTID_LEN 11 5 | 6 | #endif /* !_SYS_SYSTEMINFO_H_ */ 7 | -------------------------------------------------------------------------------- /bsd/sys/cddl/compat/opensolaris/sys/unistd.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bsd/sys/cddl/contrib/opensolaris/uts/common/zmod/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #pragma ident "%Z%%M% %I% %E% SMI" 7 | 8 | /* WARNING: this file should *not* be used by applications. It is 9 | part of the implementation of the compression library and is 10 | subject to change. Applications should only use zlib.h. 11 | */ 12 | 13 | void inflate_fast OF((z_streamp strm, unsigned start)); 14 | -------------------------------------------------------------------------------- /bsd/sys/contrib/ena_com/README: -------------------------------------------------------------------------------- 1 | Copied "as is" from https://github.com/amzn/amzn-drivers 2 | - release TAG - ena_linux_2.10.0 3 | - commit - e715298d09c6a4c378d5178c71515c43c1a75a8e 4 | 5 | In reality the FreeBSD part of the source tree has not changed 6 | since July 4th, 2023 and the commit 50e1bc8ea0149083f2a4a284d97357fc6d63b75f 7 | when the FreeBSD driver was updated to the version v2.6.3 which 8 | is the latest as of November 28th, 2023. 9 | 10 | Please note the C files were copied as *.cc to help track follow-up changes 11 | to this code. 12 | -------------------------------------------------------------------------------- /bsd/sys/contrib/ena_com/ena_defs/ena_includes.h: -------------------------------------------------------------------------------- 1 | #include "ena_common_defs.h" 2 | #include "ena_regs_defs.h" 3 | #include "ena_admin_defs.h" 4 | #include "ena_eth_io_defs.h" 5 | -------------------------------------------------------------------------------- /bsd/sys/crypto/rijndael/rijndael_local.h: -------------------------------------------------------------------------------- 1 | /* $KAME: rijndael_local.h,v 1.5 2003/08/28 08:37:24 itojun Exp $ */ 2 | /* $FreeBSD$ */ 3 | 4 | #ifdef __OSV__ 5 | #include 6 | #endif 7 | 8 | /* the file should not be used from outside */ 9 | typedef u_int8_t u8; 10 | typedef u_int16_t u16; 11 | typedef u_int32_t u32; 12 | -------------------------------------------------------------------------------- /bsd/sys/dev/ena/README: -------------------------------------------------------------------------------- 1 | Copied "as is" from https://github.com/amzn/amzn-drivers 2 | - release TAG - ena_linux_2.10.0 3 | - commit - e715298d09c6a4c378d5178c71515c43c1a75a8e 4 | 5 | In reality the FreeBSD part of the source tree has not changed 6 | since July 4th, 2023 and the commit 50e1bc8ea0149083f2a4a284d97357fc6d63b75f 7 | when the FreeBSD driver was updated to the version v2.6.3 which 8 | is the latest as of November 28th, 2023. 9 | 10 | Please note the C files were copied as *.cc to help track follow-up changes 11 | to this code. 12 | -------------------------------------------------------------------------------- /bsd/sys/dev/random/opt_random.h: -------------------------------------------------------------------------------- 1 | #ifndef OSV_OPT_RANDOM_H 2 | #define OSV_OPT_RANDOM_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/kern/opt_geom.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/bsd/sys/kern/opt_geom.h -------------------------------------------------------------------------------- /bsd/sys/net/bpf.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_BPF_H_ 2 | #define _BSD_BPF_H_ 3 | #define BPF_MTAP(x, y) do {} while (0) 4 | #endif 5 | -------------------------------------------------------------------------------- /bsd/sys/sys/bio.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_BIO_H_ 2 | #define _BSD_BIO_H_ 3 | #include 4 | #endif 5 | -------------------------------------------------------------------------------- /bsd/sys/sys/bus.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_BUS_H 2 | #define _BSD_BUS_H 3 | #include 4 | #endif 5 | 6 | -------------------------------------------------------------------------------- /bsd/sys/sys/conf.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_SYS_CONF_H 2 | #define _OSV_BSD_SYS_CONF_H 3 | #include 4 | #if CONF_logger_debug 5 | #define bootverbose 1 6 | #else 7 | #define bootverbose 0 8 | #endif 9 | #endif 10 | -------------------------------------------------------------------------------- /bsd/sys/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_FCNTL_H 2 | #define _OSV_BSD_FCNTL_H 3 | #include 4 | #endif 5 | -------------------------------------------------------------------------------- /bsd/sys/sys/interrupt.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_INTERRUPT_H 2 | #define _OSV_BSD_INTERRUPT_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/sys/kernel.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_KERN_H 2 | #define _BSD_KERN_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #endif 8 | -------------------------------------------------------------------------------- /bsd/sys/sys/limits.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /bsd/sys/sys/lock.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_LOCK_H 2 | #define _OSV_BSD_LOCK_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/sys/module.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_MODULE_H 2 | #define _OSV_BSD_MODULE_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/sys/mutex.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_MUTEX_H 2 | #define _BSD_MUTEX_H 3 | #include 4 | #include 5 | 6 | #define MTX_SPIN 0x00000001 /* Spin lock (disables interrupts) */ 7 | 8 | #define mtx_lock_spin(x) do { mtx_lock(x); } while (0) 9 | #define mtx_unlock_spin(x) do { mtx_unlock(x); } while (0) 10 | #define msleep_spin_sbt(chan, mtx, wmesg, sbt, pr, flags) \ 11 | do { msleep(chan, mtx, 0, wmesg, sbt); } while (0) 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /bsd/sys/sys/pcpu.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_PCPU_H 2 | #define _BSD_PCPU_H 3 | #include 4 | #endif 5 | -------------------------------------------------------------------------------- /bsd/sys/sys/proc.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_PROC_H 2 | #define _BSD_PROC_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/sys/rman.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_RMAN_H_ 2 | #define _BSD_RMAN_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/sys/smp.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_SMP_H 2 | #define _OSV_BSD_SMP_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/sys/sx.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_SX_H 2 | #define _BSD_SX_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/sys/systm.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_SYSTM_H 2 | #define _OSV_BSD_SYSTM_H 3 | 4 | /* Nothing defined here, but lots of files include this header */ 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /bsd/sys/sys/unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_UNISTD_H 2 | #define _BSD_UNISTD_H 3 | #include 4 | #endif 5 | -------------------------------------------------------------------------------- /bsd/sys/sys/xenbus_if.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_XENBUS_IF_H 2 | #define _OSV_BSD_XENBUS_IF_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/sys/xenbusb_if.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_XENBUSB_IF_H 2 | #define _OSV_BSD_XENBUSB_IF_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/vm/pmap.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_PMAP_H 2 | #define _OSV_BSD_PMAP_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/vm/vm.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_VM_H 2 | #define _OSV_BSD_VM_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/vm/vm_extern.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_VM_EXTERN_H 2 | #define _OSV_BSD_VM_EXTERN_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/vm/vm_kern.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_VM_KERN_H 2 | #define _OSV_BSD_VM_KERN_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/vm/vm_pmap.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_VM_PMAP_H 2 | #define _OSV_BSD_VM_PMAP_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/xenbus_if.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_XENBUS_IF_H 2 | #define _OSV_BSD_XENBUS_IF_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/sys/xenbusb_if.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_XENBUSB_IF_H 2 | #define _OSV_BSD_XENBUSB_IF_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/x64/machine/_inttypes.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD__INTTYPES_H 2 | #define _BSD__INTTYPES_H 3 | #include 4 | #endif 5 | -------------------------------------------------------------------------------- /bsd/x64/machine/bus.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_BUS_H_ 2 | #define _BSD_BUS_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/x64/machine/clock.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_CLOCK_H_ 2 | #define _BSD_CLOCK_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/x64/machine/cpufunc.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_CPUFUNC_H_ 2 | #define _BSD_CPUFUNC_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/x64/machine/frame.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_MACHINE_FRAME_H 2 | #define _OSV_BSD_MACHINE_FRAME_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/x64/machine/pcpu.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_MACHINE_PCPU_H 2 | #define _OSV_BSD_MACHINE_PCPU_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/x64/machine/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_RESOURCE_H_ 2 | #define _BSD_RESOURCE_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/x64/machine/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_BSD_STDARG_H 2 | #define _OSV_BSD_STDARG_H 3 | #endif 4 | -------------------------------------------------------------------------------- /bsd/x64/machine/vmparam.h: -------------------------------------------------------------------------------- 1 | #ifndef _BSD_vmparam_H_ 2 | #define _BSD_vmparam_H_ 3 | #endif 4 | -------------------------------------------------------------------------------- /compiler/attr/cold-label.cc: -------------------------------------------------------------------------------- 1 | 2 | void f() 3 | { 4 | goto lbl; 5 | lbl: __attribute__((cold)); 6 | } 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /compiler/empty.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | -------------------------------------------------------------------------------- /compiler/include/intrinsics.hh: -------------------------------------------------------------------------------- 1 | 2 | #ifndef COMPILER_INTRINSICS_HH 3 | #define COMPILER_INTRINSICS_HH 4 | 5 | #ifndef __ASSEMBLY__ 6 | 7 | #if __GNUC__ == 4 && __GNUC_MINOR__ < 8 8 | 9 | extern unsigned char __builtin_ia32_addcarryx_u32(unsigned char, unsigned int, unsigned int, unsigned int*); 10 | extern unsigned char __builtin_ia32_addcarryx_u64(unsigned char, long long unsigned int, long long unsigned int, long long unsigned int*); 11 | 12 | #endif 13 | 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /conf/aarch64.mk: -------------------------------------------------------------------------------- 1 | # You will die horribly without -mstrict-align, due to 2 | # unaligned access to a stack attr variable with stp. 3 | # Relaxing alignment checks via sctlr_el1 A bit setting should solve 4 | # but it doesn't - setting ignored? 5 | # 6 | # Also, mixed TLS models resulted in different var addresses seen by 7 | # different objects depending on the TLS model used. 8 | # Force all __thread variables encountered to local exec. 9 | conf_compiler_cflags = -mstrict-align -mtls-dialect=desc -ftls-model=local-exec -DAARCH64_PORT_STUB 10 | -------------------------------------------------------------------------------- /conf/base.mk: -------------------------------------------------------------------------------- 1 | conf_preempt=1 2 | conf_tracing=0 3 | conf_debug_memory=0 4 | 5 | # debug level logging (enabled automatically in mode=debug) 6 | conf_logger_debug=0 7 | 8 | conf_debug_elf=0 9 | conf_hide_symbols=0 10 | conf_linker_extra_options= 11 | conf_cxx_level=gnu++11 12 | 13 | conf_lazy_stack=0 14 | conf_lazy_stack_invariant=0 15 | -------------------------------------------------------------------------------- /conf/debug.mk: -------------------------------------------------------------------------------- 1 | conf_compiler_opt = -O0 -Wno-maybe-uninitialized 2 | conf_logger_debug=1 3 | -------------------------------------------------------------------------------- /conf/examples/minimal_microvm/hello_world_libc.version_script: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | 4 | /* Kernel and VDSO */ 5 | clock_gettime; 6 | gettimeofday; 7 | time; 8 | __errno_location; 9 | fsgsbase_avail; 10 | 11 | /* APP */ 12 | __libc_start_main; 13 | abort; 14 | puts; 15 | local: 16 | *; 17 | }; 18 | -------------------------------------------------------------------------------- /conf/examples/minimal_microvm/hello_world_static.syscalls.aarch64: -------------------------------------------------------------------------------- 1 | clock_gettime 2 | fstatat 3 | getegid 4 | geteuid 5 | getgid 6 | getrandom 7 | getuid 8 | mprotect 9 | prlimit64 10 | readlinkat 11 | sys_brk 12 | sys_ioctl 13 | sys_set_robust_list 14 | sys_set_tid_address 15 | uname 16 | write 17 | sys_exit 18 | sys_exit_group 19 | -------------------------------------------------------------------------------- /conf/examples/minimal_microvm/hello_world_static.syscalls.x64: -------------------------------------------------------------------------------- 1 | arch_prctl 2 | clock_gettime 3 | fstatat 4 | getrandom 5 | mprotect 6 | prlimit64 7 | readlink 8 | sys_brk 9 | sys_ioctl 10 | sys_set_robust_list 11 | sys_set_tid_address 12 | write 13 | sys_exit 14 | sys_exit_group 15 | -------------------------------------------------------------------------------- /conf/examples/minimal_microvm/hello_world_static.version_script: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | 4 | /* Kernel and VDSO */ 5 | clock_gettime; 6 | gettimeofday; 7 | time; 8 | __errno_location; 9 | fsgsbase_avail; 10 | local: 11 | *; 12 | }; 13 | -------------------------------------------------------------------------------- /conf/kconfig/app: -------------------------------------------------------------------------------- 1 | config version_script 2 | prompt "Version script path" 3 | string 4 | default $(shell,echo build/$mode.$arch/default_version_script) 5 | 6 | config syscalls_list_file 7 | prompt "Syscalls list file" 8 | string 9 | -------------------------------------------------------------------------------- /conf/kconfig/compiler: -------------------------------------------------------------------------------- 1 | config compiler_opt 2 | prompt "Optimizations" 3 | string 4 | default $(shell,grep ^conf_compiler_opt conf/$mode.mk | cut -d = -f 2-) 5 | 6 | config compiler_cflags 7 | prompt "Other flags" 8 | string 9 | default $(shell,grep ^conf_compiler_cflags conf/$arch.mk | cut -d = -f 2-) 10 | 11 | config compiler_cxx_level 12 | prompt "C++ level" 13 | string 14 | default $(shell,grep ^conf_cxx_level conf/base.mk | cut -d = -f 2) 15 | -------------------------------------------------------------------------------- /conf/kconfig/fs: -------------------------------------------------------------------------------- 1 | config fs_procfs 2 | prompt "Include procfs filesystem" 3 | bool 4 | default y 5 | 6 | config fs_sysfs 7 | prompt "Include sysfs filesystem" 8 | bool 9 | default y 10 | 11 | config fs_max_file_descriptors 12 | prompt "Maximum file descriptors" 13 | hex 14 | default 0x4000 15 | 16 | config fs_buffer_cache_size 17 | prompt "Buffer cache size" 18 | int 19 | default 256 20 | -------------------------------------------------------------------------------- /conf/kconfig/networking: -------------------------------------------------------------------------------- 1 | config networking_stack 2 | prompt "Include networking stack" 3 | bool 4 | default y 5 | 6 | config networking_dhcp 7 | prompt "Include DHCP support" 8 | depends on networking_stack 9 | bool 10 | default y 11 | 12 | -------------------------------------------------------------------------------- /conf/kconfig/tracepoints: -------------------------------------------------------------------------------- 1 | config tracepoints 2 | prompt "Enable tracepoints support" 3 | bool 4 | default y 5 | 6 | config tracepoints_sampler 7 | prompt "Include sampler support" 8 | depends on tracepoints 9 | bool 10 | default y 11 | 12 | config tracepoints_strace 13 | prompt "Include strace support" 14 | depends on tracepoints 15 | bool 16 | default y 17 | 18 | config tracepoints_callstack 19 | prompt "Include callstack support" 20 | depends on tracepoints 21 | bool 22 | default n 23 | -------------------------------------------------------------------------------- /conf/profiles/aarch64/all.mk: -------------------------------------------------------------------------------- 1 | include conf/profiles/$(arch)/virtio-mmio.mk 2 | include conf/profiles/$(arch)/virtio-pci.mk 3 | include conf/profiles/$(arch)/xen.mk 4 | include conf/profiles/$(arch)/nvme.mk 5 | 6 | conf_drivers_cadence?=1 7 | -------------------------------------------------------------------------------- /conf/profiles/aarch64/kconfig: -------------------------------------------------------------------------------- 1 | choice 2 | prompt "Devices Profile" 3 | default drivers_profile_all 4 | 5 | config drivers_profile_base 6 | bool "No Device Drivers" 7 | config drivers_profile_all 8 | bool "All Device Drivers" 9 | config drivers_profile_microvm 10 | bool "MicroVM Device Drivers" 11 | config drivers_profile_virtio-mmio 12 | bool "VirtI/O Over MMIO Device Drivers" 13 | config drivers_profile_virtio-pci 14 | bool "VirtI/O Over PCI Device Drivers" 15 | config drivers_profile_xen 16 | bool "Xen Device Drivers" 17 | 18 | endchoice 19 | -------------------------------------------------------------------------------- /conf/profiles/aarch64/microvm.mk: -------------------------------------------------------------------------------- 1 | virtio-mmio.mk -------------------------------------------------------------------------------- /conf/profiles/aarch64/nvme.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | 3 | conf_drivers_nvme?=1 4 | -------------------------------------------------------------------------------- /conf/profiles/aarch64/virtio-mmio.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_mmio?=1 2 | 3 | conf_drivers_virtio_blk?=1 4 | conf_drivers_virtio_net?=1 5 | -------------------------------------------------------------------------------- /conf/profiles/aarch64/virtio-pci.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | 3 | conf_drivers_virtio_blk?=1 4 | conf_drivers_virtio_fs?=1 5 | conf_drivers_virtio_net?=1 6 | conf_drivers_virtio_rng?=1 7 | conf_drivers_virtio_scsi?=1 8 | -------------------------------------------------------------------------------- /conf/profiles/aarch64/xen.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | conf_drivers_xen?=1 3 | -------------------------------------------------------------------------------- /conf/profiles/x64/all.mk: -------------------------------------------------------------------------------- 1 | include conf/profiles/$(arch)/hyperv.mk 2 | include conf/profiles/$(arch)/vbox.mk 3 | include conf/profiles/$(arch)/virtio-mmio.mk 4 | include conf/profiles/$(arch)/virtio-pci.mk 5 | include conf/profiles/$(arch)/vmware.mk 6 | include conf/profiles/$(arch)/xen.mk 7 | include conf/profiles/$(arch)/aws.mk 8 | include conf/profiles/$(arch)/nvme.mk 9 | 10 | conf_drivers_vga?=1 11 | -------------------------------------------------------------------------------- /conf/profiles/x64/aws.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | conf_drivers_acpi?=1 3 | 4 | conf_drivers_ena?=1 5 | 6 | conf_drivers_pvpanic?=1 7 | conf_drivers_hpet?=1 8 | -------------------------------------------------------------------------------- /conf/profiles/x64/cloud_hypervisor.mk: -------------------------------------------------------------------------------- 1 | include conf/profiles/$(arch)/virtio-pci.mk 2 | conf_drivers_pvpanic?=1 3 | -------------------------------------------------------------------------------- /conf/profiles/x64/hyperv.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | conf_drivers_acpi?=1 3 | conf_drivers_hyperv?=1 4 | 5 | conf_drivers_pvpanic?=1 6 | conf_drivers_hpet?=1 7 | -------------------------------------------------------------------------------- /conf/profiles/x64/microvm.mk: -------------------------------------------------------------------------------- 1 | virtio-mmio.mk -------------------------------------------------------------------------------- /conf/profiles/x64/nvme.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | 3 | conf_drivers_nvme?=1 4 | -------------------------------------------------------------------------------- /conf/profiles/x64/vbox.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | conf_drivers_acpi?=1 3 | 4 | conf_drivers_ahci?=1 5 | conf_drivers_virtio_net?=1 6 | 7 | conf_drivers_pvpanic?=1 8 | conf_drivers_hpet?=1 9 | -------------------------------------------------------------------------------- /conf/profiles/x64/virtio-mmio.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_mmio?=1 2 | 3 | conf_drivers_virtio_blk?=1 4 | conf_drivers_virtio_net?=1 5 | -------------------------------------------------------------------------------- /conf/profiles/x64/virtio-pci.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | conf_drivers_acpi?=1 3 | 4 | conf_drivers_virtio_blk?=1 5 | conf_drivers_virtio_scsi?=1 6 | conf_drivers_virtio_fs?=1 7 | conf_drivers_virtio_net?=1 8 | conf_drivers_virtio_rng?=1 9 | 10 | conf_drivers_pvpanic?=1 11 | -------------------------------------------------------------------------------- /conf/profiles/x64/vmware.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | conf_drivers_acpi?=1 3 | conf_drivers_scsi?=1 4 | 5 | conf_drivers_pvscsi?=1 6 | conf_drivers_vmxnet3?=1 7 | conf_drivers_ide?=1 8 | 9 | conf_drivers_pvpanic?=1 10 | conf_drivers_hpet?=1 11 | -------------------------------------------------------------------------------- /conf/profiles/x64/xen.mk: -------------------------------------------------------------------------------- 1 | conf_drivers_pci?=1 2 | conf_drivers_acpi?=1 3 | conf_drivers_xen?=1 4 | 5 | conf_drivers_pvpanic?=1 6 | conf_drivers_hpet?=1 7 | -------------------------------------------------------------------------------- /conf/release.mk: -------------------------------------------------------------------------------- 1 | conf_compiler_opt = -O2 -DNDEBUG 2 | -------------------------------------------------------------------------------- /conf/x64.mk: -------------------------------------------------------------------------------- 1 | conf_compiler_cflags = -msse2 2 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "osvinit": { 4 | "type": "direct-dir", 5 | "path": "${OSV_BASE}/modules/cloud-init/" 6 | }, 7 | "repositories": [ 8 | "${OSV_BASE}/apps", 9 | "${OSV_BASE}/modules" 10 | ] 11 | }, 12 | "default": [ "cloud-init", "httpserver" ] 13 | } 14 | -------------------------------------------------------------------------------- /core/version.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | #include // For the OSV_VERSION macro 11 | 12 | namespace osv { 13 | 14 | std::string version() 15 | { 16 | return OSV_VERSION; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /docker/etc/console-setup: -------------------------------------------------------------------------------- 1 | # CONFIGURATION FILE FOR SETUPCON 2 | 3 | # Consult the console-setup(5) manual page. 4 | 5 | ACTIVE_CONSOLES="/dev/tty[1-6]" 6 | 7 | CHARMAP="UTF-8" 8 | 9 | CODESET="guess" 10 | FONTFACE="Fixed" 11 | FONTSIZE="8x16" 12 | 13 | VIDEOMODE= 14 | 15 | # The following is an example how to use a braille font 16 | # FONT='lat9w-08.psf.gz brl-8x8.psf' 17 | -------------------------------------------------------------------------------- /docker/etc/keyboard: -------------------------------------------------------------------------------- 1 | # KEYBOARD CONFIGURATION FILE 2 | 3 | # Consult the keyboard(5) manual page. 4 | 5 | XKBMODEL="pc105" 6 | XKBLAYOUT="us" 7 | XKBVARIANT="" 8 | XKBOPTIONS="" 9 | 10 | BACKSPACE="guess" 11 | -------------------------------------------------------------------------------- /docker/hooks/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | docker build --build-arg DIST_VERSION=$DIST_VERSION -f $DOCKERFILE_PATH -t $IMAGE_NAME . 3 | -------------------------------------------------------------------------------- /documentation/OSv_Component_Diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/documentation/OSv_Component_Diagram.png -------------------------------------------------------------------------------- /drivers/acpi.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Nodalink, SARL. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | #ifndef _OSV_DRIVER_ACPI_HH_ 8 | #define _OSV_DRIVER_ACPI_HH_ 9 | 10 | #include "acpi.h" 11 | 12 | namespace acpi { 13 | 14 | extern uint64_t pvh_rsdp_paddr; 15 | 16 | void init(); 17 | bool is_enabled(); 18 | 19 | } 20 | 21 | #endif //!_OSV_DRIVER_ACPI_HH_ 22 | -------------------------------------------------------------------------------- /drivers/blk-common.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Jan Braunwarth 3 | * Copyright (C) 2024 Waldemar Kozaczuk 4 | * 5 | * This work is open source software, licensed under the terms of the 6 | * BSD license as described in the LICENSE file in the top-level directory. 7 | */ 8 | 9 | #ifndef BLK_COMMON_HH 10 | #define BLK_COMMON_HH 11 | 12 | #include 13 | 14 | int blk_ioctl(struct device* dev, u_long io_cmd, void* buf); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /drivers/clock.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | #include "clock.hh" 10 | 11 | clock* clock::_c; 12 | 13 | clock::~clock() 14 | { 15 | } 16 | 17 | void clock::register_clock(clock* c) 18 | { 19 | assert(!_c); 20 | _c = c; 21 | } 22 | 23 | clock* clock::get() 24 | { 25 | return _c; 26 | } 27 | -------------------------------------------------------------------------------- /drivers/null.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef DRIVERS_NULL_HH 9 | #define DRIVERS_NULL_HH 10 | 11 | namespace nulldev { 12 | 13 | void nulldev_init(); 14 | 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /drivers/pvpanic.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Nodalink, SARL. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef _OS_DRIVERS_PVPANIC_HH_ 9 | #define _OS_DRIVERS_PVPANIC_HH_ 10 | 11 | namespace panic { 12 | namespace pvpanic { 13 | 14 | void probe_and_setup(); 15 | // avoid using panic() as a name because of macro substitutions 16 | void panicked(); 17 | 18 | }} 19 | #endif // !_OS_DRIVERS_PVPANIC_HH_ 20 | -------------------------------------------------------------------------------- /dummy-shlib.cc: -------------------------------------------------------------------------------- 1 | char force_creation_of_a_dynamic_executable; 2 | -------------------------------------------------------------------------------- /exported_symbols/aarch64/osv_ld-linux-aarch64.so.1.symbols: -------------------------------------------------------------------------------- 1 | __stack_chk_guard 2 | -------------------------------------------------------------------------------- /exported_symbols/osv_ld-linux.so.symbols: -------------------------------------------------------------------------------- 1 | __libc_stack_end 2 | __tls_get_addr 3 | -------------------------------------------------------------------------------- /exported_symbols/osv_libaio.so.1.symbols: -------------------------------------------------------------------------------- 1 | io_cancel 2 | io_destroy 3 | io_getevents 4 | io_setup 5 | io_submit 6 | -------------------------------------------------------------------------------- /exported_symbols/osv_libcrypt.so.1.symbols: -------------------------------------------------------------------------------- 1 | crypt 2 | crypt_r 3 | encrypt 4 | setkey 5 | -------------------------------------------------------------------------------- /exported_symbols/osv_libdl.so.2.symbols: -------------------------------------------------------------------------------- 1 | dladdr 2 | dlclose 3 | dlerror 4 | dlopen 5 | dlsym 6 | dlvsym 7 | -------------------------------------------------------------------------------- /exported_symbols/osv_libresolv.so.2.symbols: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/exported_symbols/osv_libresolv.so.2.symbols -------------------------------------------------------------------------------- /exported_symbols/osv_librt.so.1.symbols: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/exported_symbols/osv_librt.so.1.symbols -------------------------------------------------------------------------------- /exported_symbols/osv_libutil.so.symbols: -------------------------------------------------------------------------------- 1 | forkpty 2 | openpty 3 | -------------------------------------------------------------------------------- /exported_symbols/osv_libxenstore.so.3.0.symbols: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/exported_symbols/osv_libxenstore.so.3.0.symbols -------------------------------------------------------------------------------- /exported_symbols/osv_module_api.symbols: -------------------------------------------------------------------------------- 1 | osv_cmdline 2 | osv_current_app_on_termination_request 3 | osv_debug_buffer 4 | osv_debug_enabled 5 | osv_firmware_vendor 6 | osv_get_all_app_threads 7 | osv_get_all_threads 8 | osv_hypervisor_name 9 | osv_processor_features 10 | osv_run_app 11 | osv_version 12 | -------------------------------------------------------------------------------- /exported_symbols/x64/osv_libc.so.6.symbols: -------------------------------------------------------------------------------- 1 | getcontext 2 | makecontext 3 | setcontext 4 | swapcontext 5 | fsgsbase_avail 6 | -------------------------------------------------------------------------------- /exported_symbols/x64/osv_libpthread.so.0.symbols: -------------------------------------------------------------------------------- 1 | pthread_atfork 2 | -------------------------------------------------------------------------------- /exported_symbols/x64/osv_libxenstore.so.3.0.symbols: -------------------------------------------------------------------------------- 1 | xs_close 2 | xs_daemon_open 3 | xs_directory 4 | xs_read 5 | xs_rm 6 | xs_transaction_end 7 | xs_transaction_start 8 | xs_write 9 | -------------------------------------------------------------------------------- /external/aarch64/libfdt/Makefile.libfdt: -------------------------------------------------------------------------------- 1 | # Makefile.libfdt 2 | # 3 | # This is not a complete Makefile of itself. Instead, it is designed to 4 | # be easily embeddable into other systems of Makefiles. 5 | # 6 | LIBFDT_soname = libfdt.$(SHAREDLIB_EXT).1 7 | LIBFDT_INCLUDES = fdt.h libfdt.h libfdt_env.h 8 | LIBFDT_VERSION = version.lds 9 | LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c \ 10 | fdt_addresses.c 11 | LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o) 12 | -------------------------------------------------------------------------------- /external/aarch64/libfdt/TODO: -------------------------------------------------------------------------------- 1 | - Tree traversal functions 2 | - Graft function 3 | - Complete libfdt.h documenting comments 4 | -------------------------------------------------------------------------------- /images/default.py: -------------------------------------------------------------------------------- 1 | from osv.modules.api import * 2 | 3 | _cli = require('cli') 4 | run = [ _cli.full ] 5 | -------------------------------------------------------------------------------- /images/empty.py: -------------------------------------------------------------------------------- 1 | run = [] 2 | -------------------------------------------------------------------------------- /include/api/LICENSE: -------------------------------------------------------------------------------- 1 | Unless otherwise stated, the header files in this directory have been 2 | copied from the Musl project. 3 | 4 | The Musl "COPYRIGHT" file states that "[these] files are trivial, in my 5 | opinion not copyrightable in the first place, and hereby explicitly released 6 | to the Public Domain". 7 | -------------------------------------------------------------------------------- /include/api/__fenv.h: -------------------------------------------------------------------------------- 1 | #ifndef ___FENV_H 2 | #define ___FENV_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int feenableexcept(int); 9 | int fedisableexcept(int); 10 | int fegetexcept(void); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /include/api/aarch64/bits/endian.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/endian.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/errno.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/errno.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/fcntl.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/fcntl.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/fenv.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/fenv.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/float.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/float.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/ipc.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/ipc.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/ipcstat.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/ipcstat.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/limits.h: -------------------------------------------------------------------------------- 1 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 2 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 3 | #define PAGE_SHIFT 12 4 | #define PAGE_SIZE 4096 5 | #define LONG_BIT 64 6 | #endif 7 | 8 | #define LONG_MAX 0x7fffffffffffffffL 9 | #define LLONG_MAX 0x7fffffffffffffffLL 10 | -------------------------------------------------------------------------------- /include/api/aarch64/bits/link.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/link.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/mman.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/mman.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/poll.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/poll.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/posix.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/posix.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/setjmp.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/shm.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/shm.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/signal.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/signal.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/socket.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/socket.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/stat.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/stat.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/statfs.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/statfs.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/stdint.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/aarch64/bits/stdint.h -------------------------------------------------------------------------------- /include/api/aarch64/bits/termios.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/termios.h -------------------------------------------------------------------------------- /include/api/aio.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/aio.h -------------------------------------------------------------------------------- /include/api/alloca.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/alloca.h -------------------------------------------------------------------------------- /include/api/ar.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/ar.h -------------------------------------------------------------------------------- /include/api/arpa/ftp.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/arpa/ftp.h -------------------------------------------------------------------------------- /include/api/arpa/nameser.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/arpa/nameser.h -------------------------------------------------------------------------------- /include/api/arpa/nameser_compat.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/arpa/nameser_compat.h -------------------------------------------------------------------------------- /include/api/arpa/telnet.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/arpa/telnet.h -------------------------------------------------------------------------------- /include/api/arpa/tftp.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/arpa/tftp.h -------------------------------------------------------------------------------- /include/api/byteswap.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/byteswap.h -------------------------------------------------------------------------------- /include/api/complex.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/complex.h -------------------------------------------------------------------------------- /include/api/cpio.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/cpio.h -------------------------------------------------------------------------------- /include/api/crypt.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/crypt.h -------------------------------------------------------------------------------- /include/api/ctype.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/ctype.h -------------------------------------------------------------------------------- /include/api/dirent.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/dirent.h -------------------------------------------------------------------------------- /include/api/dlfcn.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/dlfcn.h -------------------------------------------------------------------------------- /include/api/elf.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/elf.h -------------------------------------------------------------------------------- /include/api/err.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/err.h -------------------------------------------------------------------------------- /include/api/errno.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/errno.h -------------------------------------------------------------------------------- /include/api/features.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/features.h -------------------------------------------------------------------------------- /include/api/fenv.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/fenv.h -------------------------------------------------------------------------------- /include/api/float.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/float.h -------------------------------------------------------------------------------- /include/api/fnmatch.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/fnmatch.h -------------------------------------------------------------------------------- /include/api/ftw.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/ftw.h -------------------------------------------------------------------------------- /include/api/getopt.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/getopt.h -------------------------------------------------------------------------------- /include/api/glob.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/glob.h -------------------------------------------------------------------------------- /include/api/grp.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/grp.h -------------------------------------------------------------------------------- /include/api/iconv.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/iconv.h -------------------------------------------------------------------------------- /include/api/ifaddrs.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/ifaddrs.h -------------------------------------------------------------------------------- /include/api/internal_musl_headers/arpa/inet.h: -------------------------------------------------------------------------------- 1 | #ifndef ARPA_INET_H 2 | #define ARPA_INET_H 3 | 4 | #include "../../arpa/inet.h" 5 | 6 | hidden int __inet_aton(const char *, struct in_addr *); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /include/api/internal_musl_headers/errno.h: -------------------------------------------------------------------------------- 1 | #ifndef ERRNO_H 2 | #define ERRNO_H 3 | 4 | #include "../errno.h" 5 | 6 | #ifdef __GNUC__ 7 | __attribute__((const)) 8 | #endif 9 | int *___errno_location(void); 10 | 11 | #undef errno 12 | #define errno (*___errno_location()) 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/api/internal_musl_headers/stdio.h: -------------------------------------------------------------------------------- 1 | #ifndef STDIO_H 2 | #define STDIO_H 3 | 4 | #define __DEFINED_struct__IO_FILE 5 | 6 | #include "../stdio.h" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /include/api/internal_musl_headers/stdlib.h: -------------------------------------------------------------------------------- 1 | #ifndef STDLIB_H 2 | #define STDLIB_H 3 | 4 | #include "../stdlib.h" 5 | 6 | hidden int __putenv(char *, size_t, char *); 7 | hidden void __env_rm_add(char *, char *); 8 | hidden int __mkostemps(char *, int, int); 9 | hidden int __ptsname_r(int, char *, size_t); 10 | hidden char *__randname(char *); 11 | 12 | #endif 13 | 14 | -------------------------------------------------------------------------------- /include/api/internal_musl_headers/string.h: -------------------------------------------------------------------------------- 1 | #ifndef STRING_H 2 | #define STRING_H 3 | 4 | #include "../string.h" 5 | 6 | hidden void *__memrchr(const void *, int, size_t); 7 | char *__stpcpy(char *, const char *); 8 | char *__stpncpy(char *, const char *, size_t); 9 | hidden char *__strchrnul(const char *, int); 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /include/api/internal_musl_headers/sys/sysinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef SYS_SYSINFO_H 2 | #define SYS_SYSINFO_H 3 | 4 | #include "../../sys/sysinfo.h" 5 | #include 6 | 7 | hidden int __lsysinfo(struct sysinfo *); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/api/internal_musl_headers/sys/time.h: -------------------------------------------------------------------------------- 1 | #ifndef SYS_TIME_H 2 | #define SYS_TIME_H 3 | 4 | #include "../../sys/time.h" 5 | 6 | hidden int __futimesat(int, const char *, const struct timeval [2]); 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /include/api/internal_musl_headers/unistd.h: -------------------------------------------------------------------------------- 1 | #ifndef UNISTD_H 2 | #define UNISTD_H 3 | 4 | #include "../unistd.h" 5 | 6 | extern char **__environ; 7 | 8 | hidden int __dup3(int, int, int); 9 | hidden int __mkostemps(char *, int, int); 10 | hidden int __execvpe(const char *, char *const *, char *const *); 11 | hidden int __aio_close(int); 12 | hidden off_t __lseek(int, off_t, int); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /include/api/internal_musl_headers/wchar.h: -------------------------------------------------------------------------------- 1 | #ifndef WCHAR_H 2 | #define WCHAR_H 3 | 4 | #define __DEFINED_struct__IO_FILE 5 | 6 | #include "../wchar.h" 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /include/api/inttypes.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/inttypes.h -------------------------------------------------------------------------------- /include/api/iso646.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/iso646.h -------------------------------------------------------------------------------- /include/api/langinfo.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/langinfo.h -------------------------------------------------------------------------------- /include/api/lastlog.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/lastlog.h -------------------------------------------------------------------------------- /include/api/libgen.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/libgen.h -------------------------------------------------------------------------------- /include/api/libintl.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/libintl.h -------------------------------------------------------------------------------- /include/api/limits.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/limits.h -------------------------------------------------------------------------------- /include/api/link.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/link.h -------------------------------------------------------------------------------- /include/api/locale.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/locale.h -------------------------------------------------------------------------------- /include/api/malloc.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/malloc.h -------------------------------------------------------------------------------- /include/api/memory.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/memory.h -------------------------------------------------------------------------------- /include/api/mntent.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/mntent.h -------------------------------------------------------------------------------- /include/api/monetary.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/monetary.h -------------------------------------------------------------------------------- /include/api/mqueue.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/mqueue.h -------------------------------------------------------------------------------- /include/api/net/__if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Nodalink, SARL. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef OSV__IF_H_ 9 | #define OSV__IF_H_ 10 | 11 | struct if_nameindex { 12 | unsigned int if_index; 13 | char *if_name; 14 | }; 15 | 16 | #endif /* OSV__IF_H_ */ 17 | -------------------------------------------------------------------------------- /include/api/net/ethernet.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/net/ethernet.h -------------------------------------------------------------------------------- /include/api/net/if_arp.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/net/if_arp.h -------------------------------------------------------------------------------- /include/api/net/route.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/net/route.h -------------------------------------------------------------------------------- /include/api/netdb.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/netdb.h -------------------------------------------------------------------------------- /include/api/netinet/icmp6.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/netinet/icmp6.h -------------------------------------------------------------------------------- /include/api/netinet/if_ether.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/netinet/if_ether.h -------------------------------------------------------------------------------- /include/api/netinet/in_systm.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/netinet/in_systm.h -------------------------------------------------------------------------------- /include/api/netinet/ip.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/netinet/ip.h -------------------------------------------------------------------------------- /include/api/netinet/ip6.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/netinet/ip6.h -------------------------------------------------------------------------------- /include/api/netinet/ip_icmp.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/netinet/ip_icmp.h -------------------------------------------------------------------------------- /include/api/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/netinet/tcp.h -------------------------------------------------------------------------------- /include/api/netinet/udp.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/netinet/udp.h -------------------------------------------------------------------------------- /include/api/netpacket/packet.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/netpacket/packet.h -------------------------------------------------------------------------------- /include/api/nl_types.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/nl_types.h -------------------------------------------------------------------------------- /include/api/poll.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/poll.h -------------------------------------------------------------------------------- /include/api/pty.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/pty.h -------------------------------------------------------------------------------- /include/api/pwd.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/pwd.h -------------------------------------------------------------------------------- /include/api/regex.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/regex.h -------------------------------------------------------------------------------- /include/api/resolv.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/resolv.h -------------------------------------------------------------------------------- /include/api/scsi/scsi.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/scsi/scsi.h -------------------------------------------------------------------------------- /include/api/scsi/sg.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/scsi/sg.h -------------------------------------------------------------------------------- /include/api/search.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/search.h -------------------------------------------------------------------------------- /include/api/semaphore.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/semaphore.h -------------------------------------------------------------------------------- /include/api/setjmp.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/setjmp.h -------------------------------------------------------------------------------- /include/api/shadow.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/shadow.h -------------------------------------------------------------------------------- /include/api/signal.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/signal.h -------------------------------------------------------------------------------- /include/api/spawn.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/spawn.h -------------------------------------------------------------------------------- /include/api/stdalign.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/stdalign.h -------------------------------------------------------------------------------- /include/api/stdarg.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/stdarg.h -------------------------------------------------------------------------------- /include/api/stdbool.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/stdbool.h -------------------------------------------------------------------------------- /include/api/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDDEF_H 2 | #define _STDDEF_H 3 | 4 | #define NULL 0L 5 | 6 | #define __NEED_ptrdiff_t 7 | #define __NEED_size_t 8 | #define __NEED_wchar_t 9 | 10 | #include 11 | 12 | #if __GNUC__ > 3 13 | #define offsetof(type, member) __builtin_offsetof(type, member) 14 | #else 15 | #define offsetof(type, member) ((size_t)( (char *)&(((type *)0)->member) - (char *)0 )) 16 | #endif 17 | 18 | typedef union { long long ll; long double ld; void* p; } max_align_t; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /include/api/stdint.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/stdint.h -------------------------------------------------------------------------------- /include/api/stdio.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/stdio.h -------------------------------------------------------------------------------- /include/api/stdio_ext.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/stdio_ext.h -------------------------------------------------------------------------------- /include/api/stdnoreturn.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/stdnoreturn.h -------------------------------------------------------------------------------- /include/api/strings.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/strings.h -------------------------------------------------------------------------------- /include/api/stropts.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/stropts.h -------------------------------------------------------------------------------- /include/api/sys/__socket.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef OSV__SOCKET_H_ 9 | #define OSV__SOCKET_H_ 10 | 11 | #include 12 | 13 | struct linger 14 | { 15 | int l_onoff; 16 | int l_linger; 17 | }; 18 | 19 | #ifndef SOL_SOCKET 20 | #define SOL_SOCKET 1 21 | #endif 22 | 23 | #endif /* OSV__SOCKET_H_ */ 24 | -------------------------------------------------------------------------------- /include/api/sys/acct.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/acct.h -------------------------------------------------------------------------------- /include/api/sys/cachectl.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/cachectl.h -------------------------------------------------------------------------------- /include/api/sys/epoll.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/epoll.h -------------------------------------------------------------------------------- /include/api/sys/eventfd.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/eventfd.h -------------------------------------------------------------------------------- /include/api/sys/file.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/file.h -------------------------------------------------------------------------------- /include/api/sys/fsuid.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/fsuid.h -------------------------------------------------------------------------------- /include/api/sys/inotify.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/inotify.h -------------------------------------------------------------------------------- /include/api/sys/io.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/io.h -------------------------------------------------------------------------------- /include/api/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_IOCTL_H 2 | #define _SYS_IOCTL_H 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | int ioctl (int, unsigned long, ...); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /include/api/sys/ipc.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/ipc.h -------------------------------------------------------------------------------- /include/api/sys/kd.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/kd.h -------------------------------------------------------------------------------- /include/api/sys/klog.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/klog.h -------------------------------------------------------------------------------- /include/api/sys/mman.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/mman.h -------------------------------------------------------------------------------- /include/api/sys/msg.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/msg.h -------------------------------------------------------------------------------- /include/api/sys/mtio.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/mtio.h -------------------------------------------------------------------------------- /include/api/sys/param.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/param.h -------------------------------------------------------------------------------- /include/api/sys/personality.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/personality.h -------------------------------------------------------------------------------- /include/api/sys/poll.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /include/api/sys/prctl.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/prctl.h -------------------------------------------------------------------------------- /include/api/sys/procfs.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/procfs.h -------------------------------------------------------------------------------- /include/api/sys/ptrace.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/ptrace.h -------------------------------------------------------------------------------- /include/api/sys/random.h: -------------------------------------------------------------------------------- 1 | ../../../libc/include/sys/random.h -------------------------------------------------------------------------------- /include/api/sys/reboot.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/reboot.h -------------------------------------------------------------------------------- /include/api/sys/reg.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/reg.h -------------------------------------------------------------------------------- /include/api/sys/select.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/select.h -------------------------------------------------------------------------------- /include/api/sys/sem.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/sem.h -------------------------------------------------------------------------------- /include/api/sys/sendfile.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/sendfile.h -------------------------------------------------------------------------------- /include/api/sys/shm.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/shm.h -------------------------------------------------------------------------------- /include/api/sys/signalfd.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/signalfd.h -------------------------------------------------------------------------------- /include/api/sys/soundcard.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/soundcard.h -------------------------------------------------------------------------------- /include/api/sys/stat.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/stat.h -------------------------------------------------------------------------------- /include/api/sys/statfs.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/statfs.h -------------------------------------------------------------------------------- /include/api/sys/statvfs.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/statvfs.h -------------------------------------------------------------------------------- /include/api/sys/stropts.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/stropts.h -------------------------------------------------------------------------------- /include/api/sys/swap.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/swap.h -------------------------------------------------------------------------------- /include/api/sys/syscall.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/syscall.h -------------------------------------------------------------------------------- /include/api/sys/sysctl.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SYSCTL_H 2 | #define _SYS_SYSCTL_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define __NEED_size_t 9 | #include 10 | 11 | #if 0 12 | int sysctl (int *, int, void *, size_t *, void *, size_t); 13 | #endif 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/api/sys/syslog.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/syslog.h -------------------------------------------------------------------------------- /include/api/sys/sysmacros.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_SYSMACROS_H 2 | #define _SYS_SYSMACROS_H 3 | 4 | extern unsigned int gnu_dev_major (unsigned long long int __dev); 5 | extern unsigned int gnu_dev_minor (unsigned long long int __dev); 6 | extern unsigned long long int gnu_dev_makedev (unsigned int __major, 7 | unsigned int __minor); 8 | 9 | #define major(x) gnu_dev_major(x) 10 | #define minor(x) gnu_dev_minor(x) 11 | #define makedev(x,y) gnu_dev_makedev(x,y) 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /include/api/sys/timeb.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/timeb.h -------------------------------------------------------------------------------- /include/api/sys/timerfd.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/timerfd.h -------------------------------------------------------------------------------- /include/api/sys/times.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/times.h -------------------------------------------------------------------------------- /include/api/sys/timex.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/timex.h -------------------------------------------------------------------------------- /include/api/sys/ucontext.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/ucontext.h -------------------------------------------------------------------------------- /include/api/sys/uio.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/uio.h -------------------------------------------------------------------------------- /include/api/sys/un.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/un.h -------------------------------------------------------------------------------- /include/api/sys/user.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/user.h -------------------------------------------------------------------------------- /include/api/sys/utsname.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/utsname.h -------------------------------------------------------------------------------- /include/api/sys/vfs.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/vfs.h -------------------------------------------------------------------------------- /include/api/sys/vt.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/vt.h -------------------------------------------------------------------------------- /include/api/sys/wait.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/wait.h -------------------------------------------------------------------------------- /include/api/sys/xattr.h: -------------------------------------------------------------------------------- 1 | ../../../musl/include/sys/xattr.h -------------------------------------------------------------------------------- /include/api/syscall.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/syscall.h -------------------------------------------------------------------------------- /include/api/sysexits.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/sysexits.h -------------------------------------------------------------------------------- /include/api/syslog.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/syslog.h -------------------------------------------------------------------------------- /include/api/tar.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/tar.h -------------------------------------------------------------------------------- /include/api/termios.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/termios.h -------------------------------------------------------------------------------- /include/api/tgmath.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/tgmath.h -------------------------------------------------------------------------------- /include/api/time.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/time.h -------------------------------------------------------------------------------- /include/api/ucontext.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/ucontext.h -------------------------------------------------------------------------------- /include/api/ulimit.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/ulimit.h -------------------------------------------------------------------------------- /include/api/utime.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/utime.h -------------------------------------------------------------------------------- /include/api/utmp.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/utmp.h -------------------------------------------------------------------------------- /include/api/utmpx.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/utmpx.h -------------------------------------------------------------------------------- /include/api/values.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/values.h -------------------------------------------------------------------------------- /include/api/wctype.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/wctype.h -------------------------------------------------------------------------------- /include/api/wordexp.h: -------------------------------------------------------------------------------- 1 | ../../musl/include/wordexp.h -------------------------------------------------------------------------------- /include/api/x64/bits/endian.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/endian.h -------------------------------------------------------------------------------- /include/api/x64/bits/errno.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/errno.h -------------------------------------------------------------------------------- /include/api/x64/bits/fcntl.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/fcntl.h -------------------------------------------------------------------------------- /include/api/x64/bits/fenv.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/fenv.h -------------------------------------------------------------------------------- /include/api/x64/bits/float.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/float.h -------------------------------------------------------------------------------- /include/api/x64/bits/io.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/io.h -------------------------------------------------------------------------------- /include/api/x64/bits/ipc.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/ipc.h -------------------------------------------------------------------------------- /include/api/x64/bits/ipcstat.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/ipcstat.h -------------------------------------------------------------------------------- /include/api/x64/bits/limits.h: -------------------------------------------------------------------------------- 1 | #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 2 | || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 3 | #define PAGE_SHIFT 12 4 | #define PAGE_SIZE 4096 5 | #define LONG_BIT 64 6 | #endif 7 | 8 | #define LONG_MAX 0x7fffffffffffffffL 9 | #define LLONG_MAX 0x7fffffffffffffffLL 10 | -------------------------------------------------------------------------------- /include/api/x64/bits/link.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/link.h -------------------------------------------------------------------------------- /include/api/x64/bits/mman.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/mman.h -------------------------------------------------------------------------------- /include/api/x64/bits/msg.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/msg.h -------------------------------------------------------------------------------- /include/api/x64/bits/poll.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/poll.h -------------------------------------------------------------------------------- /include/api/x64/bits/posix.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/posix.h -------------------------------------------------------------------------------- /include/api/x64/bits/reg.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/reg.h -------------------------------------------------------------------------------- /include/api/x64/bits/setjmp.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/setjmp.h -------------------------------------------------------------------------------- /include/api/x64/bits/shm.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/shm.h -------------------------------------------------------------------------------- /include/api/x64/bits/signal.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/signal.h -------------------------------------------------------------------------------- /include/api/x64/bits/socket.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/socket.h -------------------------------------------------------------------------------- /include/api/x64/bits/stat.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/stat.h -------------------------------------------------------------------------------- /include/api/x64/bits/statfs.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/statfs.h -------------------------------------------------------------------------------- /include/api/x64/bits/stdint.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/stdint.h -------------------------------------------------------------------------------- /include/api/x64/bits/termios.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/generic/bits/termios.h -------------------------------------------------------------------------------- /include/api/x64/bits/user.h: -------------------------------------------------------------------------------- 1 | ../../../../musl/arch/x86_64/bits/user.h -------------------------------------------------------------------------------- /include/api/x64/pthread_arch.h: -------------------------------------------------------------------------------- 1 | ../../../musl/arch/x86_64/pthread_arch.h -------------------------------------------------------------------------------- /include/api/x64/syscall_arch.h: -------------------------------------------------------------------------------- 1 | ../../../musl/arch/x86_64/syscall_arch.h -------------------------------------------------------------------------------- /include/glibc-compat/bits/wordsize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef WORDSIZE_H_ 9 | #define WORDSIZE_H_ 10 | 11 | #define __WORDSIZE 64 12 | 13 | 14 | #endif /* WORDSIZE_H_ */ 15 | -------------------------------------------------------------------------------- /include/glibc-compat/linux/version.h: -------------------------------------------------------------------------------- 1 | #define LINUX_VERSION_CODE 198400 2 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 3 | -------------------------------------------------------------------------------- /include/glibc-compat/locale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef GLIBCCOMPAT_LOCALE_H_ 9 | #define GLIBCCOMPAT_LOCALE_H_ 10 | 11 | #include "libc/internal/locale_impl.h" 12 | 13 | #include_next 14 | 15 | #endif /* LOCALE_H_ */ 16 | -------------------------------------------------------------------------------- /include/glibc-compat/sys/errno.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /include/glibc-compat/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef GLIBCCOMPAT_IOCTL_H_ 9 | #define GLIBCCOMPAT_IOCTL_H_ 10 | 11 | #include 12 | #include_next 13 | 14 | #endif /* IOCTL_H_ */ 15 | -------------------------------------------------------------------------------- /include/glibc-compat/xlocale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef GLIBCCOMPAT_XLOCALE_H_ 9 | #define GLIBCCOMPAT_XLOCALE_H_ 10 | 11 | #include "libc/internal/locale_impl.h" 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /include/osv/barrier.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef BARRIER_HH_ 9 | #define BARRIER_HH_ 10 | 11 | static inline void barrier() 12 | { 13 | asm volatile("" : : : "memory"); 14 | } 15 | 16 | 17 | #endif /* BARRIER_HH_ */ 18 | -------------------------------------------------------------------------------- /include/osv/compiler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef COMPILER_H_ 9 | #define COMPILER_H_ 10 | 11 | #ifdef HAVE_ATTR_COLD_LABEL 12 | # define ATTR_COLD_LABEL __attribute__((cold)) 13 | #else 14 | # define ATTR_COLD_LABEL 15 | #endif 16 | 17 | #endif /* COMPILER_H_ */ 18 | -------------------------------------------------------------------------------- /include/osv/contiguous_alloc.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef CONTIGUOUS_ALLOC_HH 9 | #define CONTIGUOUS_ALLOC_HH 10 | 11 | namespace memory { 12 | 13 | void* alloc_phys_contiguous_aligned(size_t sz, size_t align, bool block = true); 14 | void free_phys_contiguous_aligned(void* p); 15 | 16 | }; 17 | 18 | #endif /* CONTIGUOUS_ALLOC_HH */ 19 | -------------------------------------------------------------------------------- /include/osv/firmware.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef OSV_FIRMWARE_HH 9 | #define OSV_FIRMWARE_HH 10 | 11 | #include 12 | 13 | namespace osv { 14 | 15 | void firmware_probe(); 16 | 17 | std::string firmware_vendor(); 18 | 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /include/osv/net_trace.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef NET_TRACE_HH 9 | #define NET_TRACE_HH 10 | 11 | #include 12 | #include 13 | 14 | void log_packet_in(struct mbuf *m, int proto); 15 | void log_packet_out(struct mbuf *m, int proto); 16 | void log_packet_handling(struct mbuf *m, int proto); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/osv/pid.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _OSV_PID_H_ 3 | #define _OSV_PID_H 4 | 5 | #define OSV_PID 2 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /include/osv/printf.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef PRINTF_HH_ 9 | #define PRINTF_HH_ 10 | 11 | #include 12 | 13 | namespace osv { 14 | 15 | std::string sprintf(const char* fmt...); 16 | std::string vsprintf(const char* fmt, va_list ap); 17 | 18 | } // namespace osv 19 | 20 | #endif /* PRINTF_HH_ */ 21 | -------------------------------------------------------------------------------- /include/osv/shutdown.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef INCLUDED_OSV_SHUTDOWN_H 9 | #define INCLUDED_OSV_SHUTDOWN_H 10 | 11 | namespace osv { 12 | 13 | /** 14 | * Powers off the machine with best effort to gracefully release resources. 15 | * Unmounts file systems. 16 | */ 17 | void shutdown() __attribute__((noreturn)); 18 | 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /include/osv/strace.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 Waldemar Kozaczuk 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef STRACE_HH_ 9 | #define STRACE_HH_ 10 | 11 | #include 12 | 13 | void start_strace(); 14 | void wait_strace_complete(); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /include/osv/string.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSV_STRING_H 2 | #define _OSV_STRING_H 3 | #include 4 | 5 | __BEGIN_DECLS 6 | void *memcpy_backwards(void *dest, const void *src, size_t n); 7 | __END_DECLS 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/osv/version.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef OSV_VERSION_HH_ 9 | #define OSV_VERSION_HH_ 10 | 11 | #include 12 | 13 | namespace osv { 14 | 15 | /** 16 | * Returns OSv version number as a string. 17 | * @return a string representing OSv version 18 | */ 19 | std::string version(); 20 | 21 | } 22 | 23 | #endif /* OSV_VERSION_HH_ */ 24 | -------------------------------------------------------------------------------- /include/osv/virt_to_phys.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef VIRT_TO_PHYS_HH 9 | #define VIRT_TO_PHYS_HH 10 | 11 | namespace mmu { 12 | 13 | typedef uint64_t phys; 14 | phys virt_to_phys(void *virt); 15 | 16 | }; 17 | 18 | 19 | #endif /* VIRT_TO_PHYS_HH */ 20 | 21 | -------------------------------------------------------------------------------- /include/osv/zcopy.h: -------------------------------------------------------------------------------- 1 | #ifndef _ZCOPY_H 2 | #define _ZCOPY_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | struct zmsghdr { 9 | struct msghdr zm_msg; 10 | int zm_txfd; 11 | void *zm_txhandle; 12 | void *zm_rxhandle; 13 | }; 14 | 15 | ssize_t zcopy_tx(int sockfd, struct zmsghdr *zm); 16 | void zcopy_txclose(struct zmsghdr *zm); 17 | ssize_t zcopy_rx(int sockfd, struct zmsghdr *zm); 18 | int zcopy_rxgc(struct zmsghdr *zm); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /include/osv/zcopy.hh: -------------------------------------------------------------------------------- 1 | #ifndef _ZCOPY_HH 2 | #define _ZCOPY_HH 3 | 4 | #include 5 | 6 | struct ztx_handle { 7 | ztx_handle() : zh_remained(0) {}; 8 | std::atomic zh_remained; 9 | }; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /libc/__pread64_chk.cc: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | extern "C" ssize_t __pread64_chk(int fd, void *buf, size_t count, off64_t offset, size_t bufsize) 6 | { 7 | if (count > bufsize) { 8 | _chk_fail(__FUNCTION__); 9 | } 10 | return pread64(fd, buf, count, offset); 11 | } 12 | -------------------------------------------------------------------------------- /libc/__read_chk.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | ssize_t __read_chk(int fd, void *buf, size_t count, size_t bufsize) 6 | { 7 | if (count > bufsize) { 8 | _chk_fail(__FUNCTION__); 9 | } 10 | return read(fd, buf, count); 11 | } 12 | -------------------------------------------------------------------------------- /libc/af_local.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef AF_LOCAL_H_ 9 | #define AF_LOCAL_H_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | int socketpair_af_local(int type, int proto, int sv[2]); 16 | 17 | int shutdown_af_local(int fd, int how); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif /* AF_LOCAL_H_ */ 24 | -------------------------------------------------------------------------------- /libc/arch/README.md: -------------------------------------------------------------------------------- 1 | * `/setjmp/sigsetjmp.s` - both x64 and aarch64 versions come from the musl commit 81e18eb3cd61f7b68a8f99b3e6c728f2a4d79221 2 | * `/atomic.h` 3 | 4 | These function seems to have been written by hand for OSv and are NOT in musl (see #8e42e07e3416ecfc7faf43e41f76262e6bc16be3 and #60fa1e93f0e1e01394cc7bd8bd1e79e34fefbfa9). Also there is no aarch64 version of it. 5 | * `x64/ucontext/getcontext.s` 6 | * `x64/ucontext/ucontext.cc` 7 | * `x64/ucontext/start_context.s` 8 | * `x64/ucontext/setcontext.s` 9 | -------------------------------------------------------------------------------- /libc/arch/aarch64/setjmp/sigsetjmp.s: -------------------------------------------------------------------------------- 1 | .global sigsetjmp 2 | .global __sigsetjmp 3 | .type sigsetjmp,%function 4 | .type __sigsetjmp,%function 5 | sigsetjmp: 6 | __sigsetjmp: 7 | str x1,[x0,#176] 8 | cbz x1,setjmp 9 | 10 | // TODO errno? 11 | // sigprocmask(SIG_SETMASK, 0, (sigset_t*)buf->__ss); 12 | stp x0,x30,[sp,#-16]! 13 | add x2,x0,#184 14 | mov x1,#0 15 | mov x0,#2 16 | bl sigprocmask 17 | ldp x0,x30,[sp],#16 18 | 19 | b setjmp 20 | -------------------------------------------------------------------------------- /libc/arch/x64/setjmp/sigsetjmp.s: -------------------------------------------------------------------------------- 1 | /* Copyright 2011-2012 Nicholas J. Kain, licensed under standard MIT license */ 2 | .global sigsetjmp 3 | .global __sigsetjmp 4 | .type sigsetjmp,@function 5 | .type __sigsetjmp,@function 6 | __sigsetjmp: 7 | sigsetjmp: 8 | andl %esi,%esi 9 | movq %rsi,64(%rdi) 10 | jz 1f 11 | pushq %rdi 12 | leaq 72(%rdi),%rdx 13 | xorl %esi,%esi 14 | movl $2,%edi 15 | call sigprocmask 16 | popq %rdi 17 | 1: jmp setjmp 18 | -------------------------------------------------------------------------------- /libc/env/README.md: -------------------------------------------------------------------------------- 1 | The only 2 files in here should stay as is. 2 | 3 | Musl has its own copy of `env/secure_getenv.c` but it references the `libc.secure` global variable which we do not have. 4 | -------------------------------------------------------------------------------- /libc/env/__environ.c: -------------------------------------------------------------------------------- 1 | #include "libc.h" 2 | 3 | static char *__initial_environ = NULL; 4 | 5 | #undef environ 6 | char **__environ = &__initial_environ; 7 | weak_alias(__environ, ___environ); 8 | weak_alias(__environ, _environ); 9 | weak_alias(__environ, environ); 10 | -------------------------------------------------------------------------------- /libc/env/secure_getenv.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *secure_getenv(const char *name) 4 | { 5 | return getenv(name); 6 | } 7 | -------------------------------------------------------------------------------- /libc/errno/README.md: -------------------------------------------------------------------------------- 1 | The only file - `strerror.c` provides deprecated `sys_errlist` and `sys_nerr` symbols 2 | that musl does not implement. So should stay as is and should be unaffected by future musl upgrades. 3 | -------------------------------------------------------------------------------- /libc/errno/strerror.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | const char *const sys_errlist[] = { 11 | #define E(num, message) [num] = message, 12 | #include "../../musl/src/errno/__strerror.h" 13 | #undef E 14 | }; 15 | 16 | const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); 17 | -------------------------------------------------------------------------------- /libc/include/sys/random.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_RANDOM_H 2 | #define _SYS_RANDOM_H 3 | 4 | /* 5 | * Flags for getrandom(2) 6 | * 7 | * GRND_NONBLOCK Don't block and return EAGAIN instead 8 | * GRND_RANDOM Use the /dev/random pool instead of /dev/urandom 9 | */ 10 | #define GRND_NONBLOCK 0x0001 11 | #define GRND_RANDOM 0x0002 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | ssize_t getrandom(void *buf, size_t count, unsigned int flags); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | #endif 23 | -------------------------------------------------------------------------------- /libc/internal/_chk_fail.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern "C" void _chk_fail(const char *func) 4 | { 5 | abort("%s: aborting on failed check\n", func); 6 | } 7 | -------------------------------------------------------------------------------- /libc/internal/floatscan.c: -------------------------------------------------------------------------------- 1 | ../../musl/src/internal/floatscan.c -------------------------------------------------------------------------------- /libc/internal/floatscan.h: -------------------------------------------------------------------------------- 1 | ../../musl/src/internal/floatscan.h -------------------------------------------------------------------------------- /libc/internal/fp_arch.h: -------------------------------------------------------------------------------- 1 | ../../musl/arch/generic/fp_arch.h -------------------------------------------------------------------------------- /libc/internal/intscan.c: -------------------------------------------------------------------------------- 1 | ../../musl/src/internal/intscan.c -------------------------------------------------------------------------------- /libc/internal/intscan.h: -------------------------------------------------------------------------------- 1 | ../../musl/src/internal/intscan.h -------------------------------------------------------------------------------- /libc/internal/libc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct __libc __libc; 4 | -------------------------------------------------------------------------------- /libc/internal/libm.h: -------------------------------------------------------------------------------- 1 | ../../musl/src/internal/libm.h -------------------------------------------------------------------------------- /libc/internal/lock.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define LOCK(x) mutex_lock(&(x)) 4 | #define UNLOCK(x) mutex_unlock(&(x)) 5 | -------------------------------------------------------------------------------- /libc/internal/pthread_stubs.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* until we get proper pthread cancellation support */ 4 | #undef pthread_cleanup_push 5 | #define pthread_cleanup_push(c, f) do { } while (0) 6 | 7 | #undef pthread_cleanup_pop 8 | #define pthread_cleanup_pop(n ) do { } while (0) 9 | 10 | -------------------------------------------------------------------------------- /libc/internal/shgetc.c: -------------------------------------------------------------------------------- 1 | ../../musl/src/internal/shgetc.c -------------------------------------------------------------------------------- /libc/internal/shgetc.h: -------------------------------------------------------------------------------- 1 | ../../musl/src/internal/shgetc.h -------------------------------------------------------------------------------- /libc/locale/catopen.c: -------------------------------------------------------------------------------- 1 | ../../musl_0.9.12/src/locale/catopen.c -------------------------------------------------------------------------------- /libc/locale/duplocale.c: -------------------------------------------------------------------------------- 1 | ../../musl_0.9.12/src/locale/duplocale.c -------------------------------------------------------------------------------- /libc/locale/freelocale.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "locale_impl.h" 3 | #include "libc.h" 4 | 5 | void __freelocale(locale_t l) 6 | { 7 | // In our implementation, newlocale() might return c_locale instead of 8 | // allocating a new copy of the locale... We can't free that. 9 | extern locale_t __c_locale_ptr; 10 | if (l == __c_locale_ptr) { 11 | return; 12 | } 13 | 14 | free(l); 15 | } 16 | 17 | /* OSv local: a libstdc++ build against glibc wants the __ version */ 18 | weak_alias(__freelocale, freelocale); 19 | -------------------------------------------------------------------------------- /libc/locale/intl.c: -------------------------------------------------------------------------------- 1 | ../../musl_0.9.12/src/locale/intl.c -------------------------------------------------------------------------------- /libc/locale/setlocale.c: -------------------------------------------------------------------------------- 1 | ../../musl_0.9.12/src/locale/setlocale.c -------------------------------------------------------------------------------- /libc/locale/strtod_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "libc.h" 5 | 6 | double __strtod_l(const char *restrict s, char **restrict p, locale_t l) 7 | { 8 | return strtod(s, p); 9 | } 10 | 11 | /* OSv local: a libstdc++ build against glibc wants the __ version */ 12 | weak_alias(__strtod_l, strtod_l); 13 | -------------------------------------------------------------------------------- /libc/locale/strtof_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "libc.h" 5 | 6 | float __strtof_l(const char *restrict s, char **restrict p, locale_t l) 7 | { 8 | return strtof(s, p); 9 | } 10 | 11 | /* OSv local: a libstdc++ build against glibc wants the __ version */ 12 | weak_alias(__strtof_l, strtof_l); 13 | -------------------------------------------------------------------------------- /libc/locale/strtold_l.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "libc.h" 5 | 6 | long double __strtold_l(const char *restrict s, char **restrict p, locale_t l) 7 | { 8 | return strtold(s, p); 9 | } 10 | 11 | /* OSv local: a libstdc++ build against glibc wants the __ version */ 12 | weak_alias(__strtold_l, strtold_l); 13 | -------------------------------------------------------------------------------- /libc/locale/uselocale.c: -------------------------------------------------------------------------------- 1 | #include "locale_impl.h" 2 | #include "libc.h" 3 | 4 | OSV_HIDDEN 5 | __thread locale_t __current_locale; 6 | 7 | locale_t __uselocale(locale_t l) 8 | { 9 | locale_t old = __current_locale; 10 | if (l) __current_locale = l; 11 | return old; 12 | } 13 | 14 | /* OSv local: a libstdc++ build against glibc wants the __ version */ 15 | weak_alias(__uselocale, uselocale); 16 | -------------------------------------------------------------------------------- /libc/mallopt.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | extern "C" 9 | int mallopt(int param, int value) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /libc/math/README.md: -------------------------------------------------------------------------------- 1 | All from musl except for finitel.c which is missing musl 2 | -------------------------------------------------------------------------------- /libc/math/finitel.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "libc.h" 3 | 4 | int finitel(long double x) 5 | { 6 | return isfinite(x); 7 | } 8 | -------------------------------------------------------------------------------- /libc/misc/README.md: -------------------------------------------------------------------------------- 1 | All files but `getopt*.cc` did not come from musl and were implemented from scratch. 2 | 3 | **TODO**: `getopt_long.cc` and `getopt.cc` need to be updated with the latest version from musl. 4 | -------------------------------------------------------------------------------- /libc/misc/__longjmp_chk.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern "C" 4 | void __longjmp_chk (jmp_buf env, int val) 5 | { 6 | // TODO: Glibc's __longjmp_chk additionally does some sanity checks about 7 | // whether we're jumping a sane stack frame. 8 | longjmp(env, val); 9 | } 10 | -------------------------------------------------------------------------------- /libc/multibyte/__mbstowcs_chk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Waldemar Kozaczuk 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | size_t __mbstowcs_chk(wchar_t *restrict dest, const char *restrict src, size_t n, size_t dstlen) 12 | { 13 | if (n > dstlen) { 14 | _chk_fail("mbstowcs"); 15 | } 16 | return mbstowcs(dest, src, n); 17 | } 18 | -------------------------------------------------------------------------------- /libc/network/__netlink.h: -------------------------------------------------------------------------------- 1 | #include 2 | #undef MSG_DONTWAIT 3 | //Let us disable the non-blocking call to recv() netlink.c by re-defining MSG_DONTWAIT as 0 4 | #define MSG_DONTWAIT 0 5 | -------------------------------------------------------------------------------- /libc/network/__socket.h: -------------------------------------------------------------------------------- 1 | #include 2 | //This header is included by musl src/network/if_indextoname.c and src/network/if_nametoindex.c 3 | //to force that socket is opened using AF_INET family as AF_UNIX is not supported 4 | #undef AF_UNIX 5 | #define AF_UNIX AF_INET 6 | -------------------------------------------------------------------------------- /libc/network/freeaddrinfo.c: -------------------------------------------------------------------------------- 1 | ../../musl_0.9.12/src/network/freeaddrinfo.c -------------------------------------------------------------------------------- /libc/prng/README.md: -------------------------------------------------------------------------------- 1 | The only file - `random.c` - came originally from older musl (possibly before 0.9.12) 2 | and has changed in musl since. 3 | 4 | On top of that, functions like `random_r` and friends were added to this OSv copy manually. 5 | 6 | **TODO**: Update this with newest musl. 7 | -------------------------------------------------------------------------------- /libc/process/README.md: -------------------------------------------------------------------------------- 1 | All sources here never came from musl so where either fully implemented 2 | on OSv side or are just stubs. 3 | -------------------------------------------------------------------------------- /libc/process/execve.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../libc.hh" 4 | 5 | int execve(const char *path, char *const argv[], char *const envp[]) 6 | { 7 | WARN_STUBBED(); 8 | return libc_error(ENOEXEC); 9 | } 10 | -------------------------------------------------------------------------------- /libc/process/waitpid.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | pid_t waitpid(pid_t pid, int *status, int options) 5 | { 6 | errno = ECHILD; 7 | return -1; 8 | } 9 | -------------------------------------------------------------------------------- /libc/pthread.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef PTHREAD_HH_ 9 | #define PTHREAD_HH_ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifdef __cplusplus 16 | } 17 | 18 | namespace pthread_private { 19 | void run_tsd_dtors(); 20 | } 21 | #endif 22 | 23 | #endif /* PTHREAD_HH_ */ 24 | -------------------------------------------------------------------------------- /libc/signal/README.md: -------------------------------------------------------------------------------- 1 | Both `block.c` and `siglongjmp.c` come from musl#81e18eb3cd61f7b68a8f99b3e6c728f2a4d79221 src/signal. 2 | The `block.c` has been modified to replace system calls (`syscall`) with direct `sigprocmask()` invocation. 3 | 4 | None of these should need to be updated when upgrading musl. 5 | -------------------------------------------------------------------------------- /libc/signal/siglongjmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void __restore_sigs(void *set); 4 | 5 | _Noreturn void siglongjmp(sigjmp_buf buf, int ret) 6 | { 7 | if (buf->__fl) __restore_sigs(buf->__ss); 8 | longjmp(buf, ret); 9 | } 10 | -------------------------------------------------------------------------------- /libc/stdio/__fopen_rb_ca.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | #include 3 | #include 4 | 5 | FILE *__fopen_rb_ca(const char *filename, FILE *f, unsigned char *buf, size_t len) 6 | { 7 | memset(f, 0, sizeof *f); 8 | 9 | f->fd = open(filename, O_RDONLY|O_LARGEFILE|O_CLOEXEC, 0); 10 | if (f->fd < 0) return 0; 11 | 12 | f->flags = F_NOWR | F_PERM; 13 | f->buf = buf + UNGET; 14 | f->buf_size = len - UNGET; 15 | f->read = __stdio_read; 16 | f->seek = __stdio_seek; 17 | f->close = __stdio_close; 18 | 19 | return f; 20 | } 21 | -------------------------------------------------------------------------------- /libc/stdio/__fprintf_chk.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "libc.h" 5 | 6 | int 7 | __fprintf_chk(FILE *fp, int flag, const char *format, ...) 8 | { 9 | va_list ap; 10 | int ret; 11 | 12 | va_start(ap, format); 13 | ret = vfprintf(fp, format, ap); 14 | va_end(ap); 15 | 16 | return ret; 17 | } 18 | -------------------------------------------------------------------------------- /libc/stdio/__fread_chk.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | #include 3 | 4 | size_t __fread_chk (void *restrict destv, size_t dest_size, size_t size, size_t nmemb, FILE *restrict f) 5 | { 6 | if (size > dest_size) { 7 | _chk_fail(__FUNCTION__); 8 | } 9 | return fread(destv, size, nmemb, f); 10 | } 11 | -------------------------------------------------------------------------------- /libc/stdio/__lockfile.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "stdio_impl.h" 4 | 5 | int __lockfile(FILE *f) 6 | { 7 | if (mutex_owned(&f->mutex)) 8 | return 0; 9 | 10 | mutex_lock(&f->mutex); 11 | return 1; 12 | } 13 | 14 | void __unlockfile(FILE *f) 15 | { 16 | assert(mutex_owned(&f->mutex)); 17 | mutex_unlock(&f->mutex); 18 | } 19 | -------------------------------------------------------------------------------- /libc/stdio/fgetc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int fgetc(FILE *f) 4 | { 5 | int c; 6 | if (f->no_locking || !__lockfile(f)) 7 | return getc_unlocked(f); 8 | c = getc_unlocked(f); 9 | __unlockfile(f); 10 | return c; 11 | } 12 | -------------------------------------------------------------------------------- /libc/stdio/flockfile.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "stdio_impl.h" 4 | 5 | void flockfile(FILE *f) 6 | { 7 | if (mutex_owned(&f->mutex)) { 8 | if (f->lockcount < LONG_MAX) { 9 | f->lockcount++; 10 | return; 11 | } 12 | 13 | /* 14 | * Hack: just waits until all references are gone, 15 | * instead of waiting for the count to go below 16 | * LONG_MAX. 17 | */ 18 | } 19 | 20 | mutex_lock(&f->mutex); 21 | f->lockcount = 1; 22 | } 23 | -------------------------------------------------------------------------------- /libc/stdio/fputc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int fputc(int c, FILE *f) 4 | { 5 | if (f->no_locking || !__lockfile(f)) 6 | return putc_unlocked(c, f); 7 | c = putc_unlocked(c, f); 8 | __unlockfile(f); 9 | return c; 10 | } 11 | -------------------------------------------------------------------------------- /libc/stdio/ftrylockfile.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | #include 3 | #include 4 | 5 | int ftrylockfile(FILE *f) 6 | { 7 | if (mutex_owned(&f->mutex)) { 8 | if (f->lockcount == LONG_MAX) 9 | return -1; 10 | f->lockcount++; 11 | return 0; 12 | } 13 | 14 | if (!mutex_trylock(&f->mutex)) 15 | return -1; 16 | f->lockcount = 1; 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /libc/stdio/funlockfile.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | void funlockfile(FILE *f) 4 | { 5 | if (!--f->lockcount) __unlockfile(f); 6 | } 7 | -------------------------------------------------------------------------------- /libc/stdio/getc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int getc(FILE *f) 4 | { 5 | int c; 6 | if (f->no_locking || !__lockfile(f)) 7 | return getc_unlocked(f); 8 | c = getc_unlocked(f); 9 | __unlockfile(f); 10 | return c; 11 | } 12 | 13 | weak_alias(getc, _IO_getc); 14 | -------------------------------------------------------------------------------- /libc/stdio/getchar.c: -------------------------------------------------------------------------------- 1 | ../../musl_0.9.12/src/stdio/getchar.c -------------------------------------------------------------------------------- /libc/stdio/ofl.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | #include "lock.h" 3 | 4 | static FILE *ofl_head; 5 | static mutex_t ofl_lock; 6 | 7 | FILE **__ofl_lock() 8 | { 9 | LOCK(ofl_lock); 10 | return &ofl_head; 11 | } 12 | 13 | void __ofl_unlock() 14 | { 15 | UNLOCK(ofl_lock); 16 | } 17 | -------------------------------------------------------------------------------- /libc/stdio/putc.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | int putc(int c, FILE *f) 4 | { 5 | if (f->no_locking || !__lockfile(f)) 6 | return putc_unlocked(c, f); 7 | c = putc_unlocked(c, f); 8 | __unlockfile(f); 9 | return c; 10 | } 11 | 12 | weak_alias(putc, _IO_putc); 13 | -------------------------------------------------------------------------------- /libc/stdio/putchar.c: -------------------------------------------------------------------------------- 1 | ../../musl_0.9.12/src/stdio/putchar.c -------------------------------------------------------------------------------- /libc/stdio/remove.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int remove(const char *path) 6 | { 7 | int r = unlink(path); 8 | // According to Posix, unlink() of a directory should return EPERM. 9 | // On Linux, it actually returns EISDIR. Let's check for both. 10 | return (r && (errno == EISDIR || errno == EPERM)) ? rmdir(path) : r; 11 | } 12 | -------------------------------------------------------------------------------- /libc/stdio/shgetc.h: -------------------------------------------------------------------------------- 1 | ../../musl/src/internal/shgetc.h -------------------------------------------------------------------------------- /libc/stdio/sscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "libc.h" 4 | 5 | int sscanf(const char *restrict s, const char *restrict fmt, ...) 6 | { 7 | int ret; 8 | va_list ap; 9 | va_start(ap, fmt); 10 | ret = vsscanf(s, fmt, ap); 11 | va_end(ap); 12 | return ret; 13 | } 14 | 15 | #if __GNUC__ >= 9 16 | weak_alias(sscanf,__isoc99_sscanf) __attribute__((nothrow)); 17 | #else 18 | weak_alias(sscanf,__isoc99_sscanf); 19 | #endif 20 | -------------------------------------------------------------------------------- /libc/stdio/stderr.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | static unsigned char buf[UNGET]; 4 | static FILE f = { 5 | .buf = buf+UNGET, 6 | .buf_size = 0, 7 | .fd = 2, 8 | .flags = F_PERM | F_NORD, 9 | .lbf = -1, 10 | .write = __stdio_write, 11 | .seek = __stdio_seek, 12 | .close = __stdio_close, 13 | }; 14 | FILE *const stderr = &f; 15 | hidden FILE *const __stderr_used = &f; 16 | -------------------------------------------------------------------------------- /libc/stdio/stdout.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | static unsigned char buf[BUFSIZ+UNGET]; 4 | static FILE f = { 5 | .buf = buf+UNGET, 6 | .buf_size = sizeof buf-UNGET, 7 | .fd = 1, 8 | .flags = F_PERM | F_NORD, 9 | .lbf = '\n', 10 | .write = __stdout_write, 11 | .seek = __stdio_seek, 12 | .close = __stdio_close, 13 | }; 14 | FILE *const stdout = &f; 15 | hidden FILE *const __stdout_used = &f; 16 | -------------------------------------------------------------------------------- /libc/stdio/vdprintf.c: -------------------------------------------------------------------------------- 1 | #include "stdio_impl.h" 2 | 3 | static size_t wrap_write(FILE *f, const unsigned char *buf, size_t len) 4 | { 5 | return __stdio_write(f, buf, len); 6 | } 7 | 8 | int vdprintf(int fd, const char *restrict fmt, va_list ap) 9 | { 10 | FILE f = { 11 | .fd = fd, .lbf = EOF, .write = wrap_write, 12 | .buf = (void *)fmt, .buf_size = 0, 13 | .no_locking = true, 14 | }; 15 | return vfprintf(&f, fmt, ap); 16 | } 17 | -------------------------------------------------------------------------------- /libc/stdlib/README.md: -------------------------------------------------------------------------------- 1 | `qsort_r.c` - never implemented on musl side, should stay as is 2 | 3 | ## 3 others left to upgrade 4 | * strtod.c 5 | * strtol.c 6 | * wcstol.c 7 | 8 | `f.lock = -1;` replaced with `f.no_locking = true;` in respect to older musl 0.9.12 9 | -------------------------------------------------------------------------------- /libc/string/README.md: -------------------------------------------------------------------------------- 1 | None of the files but `strerror_r.c `came from musl. 2 | 3 | **TODO**: The `strerror_r.c` might need to be updated to latest musl. 4 | -------------------------------------------------------------------------------- /libc/string/__explicit_bzero_chk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void __explicit_bzero_chk(void *dest, size_t len, size_t destlen) 5 | { 6 | if (len > destlen) { 7 | abort(); 8 | } 9 | memset(dest, 0, len); 10 | return; 11 | } 12 | -------------------------------------------------------------------------------- /libc/string/__memcpy_chk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void *__memcpy_chk(void *dest, const void *src, size_t len, size_t destlen) 5 | { 6 | if (len > destlen) { 7 | abort(); 8 | } 9 | return memcpy(dest, src, len); 10 | } 11 | -------------------------------------------------------------------------------- /libc/string/__memmove_chk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void * __memmove_chk(void * dest, const void * src, size_t len, size_t destlen) 5 | { 6 | if (len > destlen) { 7 | _chk_fail("memmove"); 8 | } 9 | return memmove(dest, src, len); 10 | } 11 | -------------------------------------------------------------------------------- /libc/string/__memset_chk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void *__memset_chk(void *dest, int c, size_t n, size_t destlen) 5 | { 6 | if (n > destlen) { 7 | _chk_fail("memset"); 8 | } 9 | return memset(dest, c, n); 10 | } 11 | -------------------------------------------------------------------------------- /libc/string/__stpcpy_chk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* Used by code compiled on Linux with -D_FORTIFY_SOURCE */ 5 | char *__stpcpy_chk (char *dest, const char *src, size_t destlen) 6 | { 7 | // TODO: This repeats some of stpcpy's work. Make it more efficent. 8 | assert(strlen(src) < destlen); 9 | return stpcpy(dest, src); 10 | } 11 | -------------------------------------------------------------------------------- /libc/string/__strcat_chk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char *__strcat_chk(char *d, const char *s, size_t s1len) 5 | { 6 | // TODO: This repeats some of strcat's work. Make it more efficent. 7 | size_t n = strlen(s); 8 | size_t space = s1len; 9 | for (const char *tmp = d; *tmp; tmp++) { 10 | --space; 11 | assert (space >= 0); 12 | } 13 | // Need space for strlen(s) and the null 14 | assert (space > n); 15 | return strcat(d, s); 16 | } 17 | -------------------------------------------------------------------------------- /libc/string/__strcpy_chk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* Used by code compiled on Linux with -D_FORTIFY_SOURCE */ 5 | char *__strcpy_chk (char *dest, const char *src, size_t destlen) 6 | { 7 | // TODO: This repeats some of strcpy's work. Make it more efficent. 8 | assert(strlen(src) < destlen); 9 | return strcpy(dest, src); 10 | } 11 | -------------------------------------------------------------------------------- /libc/string/__strncpy_chk.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* Used by code compiled on Linux with -D_FORTIFY_SOURCE */ 5 | char *__strncpy_chk (char *__restrict d, const char *__restrict s, 6 | size_t n, size_t len) 7 | { 8 | assert(len >= n); 9 | return strncpy(d, s, n); 10 | } 11 | -------------------------------------------------------------------------------- /libc/string/__wcscpy_chk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Waldemar Kozaczuk 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | wchar_t *__wcscpy_chk(wchar_t *__restrict dest, const wchar_t *__restrict src, size_t destlen) 12 | { 13 | assert(wcslen(src) + sizeof(L'\0') <= destlen); 14 | return wcscpy(dest, src); 15 | } 16 | -------------------------------------------------------------------------------- /libc/string/__wcsncpy_chk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Waldemar Kozaczuk 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | wchar_t *__wcsncpy_chk(wchar_t * dest, const wchar_t * src, size_t n, size_t destlen) 12 | { 13 | assert(wcslen(src) + sizeof(L'\0') <= destlen); 14 | return wcsncpy(dest, src, n); 15 | } 16 | -------------------------------------------------------------------------------- /libc/string/__wmemcpy_chk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Waldemar Kozaczuk 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | wchar_t * __wmemcpy_chk(wchar_t *restrict dest, const wchar_t *restrict src, size_t len, size_t destlen) 12 | { 13 | if (len > destlen) { 14 | _chk_fail("wmemcpy"); 15 | } 16 | return wmemcpy(dest, src, len); 17 | } 18 | -------------------------------------------------------------------------------- /libc/string/__wmemmove_chk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Waldemar Kozaczuk 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | wchar_t * __wmemmove_chk(wchar_t *restrict dest, const wchar_t *restrict src, size_t len, size_t destlen) 12 | { 13 | if (len > destlen) { 14 | _chk_fail("wmemmove"); 15 | } 16 | return wmemmove(dest, src, len); 17 | } 18 | -------------------------------------------------------------------------------- /libc/string/__wmemset_chk.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Waldemar Kozaczuk 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | wchar_t *__wmemset_chk(wchar_t *dest, wchar_t c, size_t n, size_t destlen) 12 | { 13 | if (n > destlen) { 14 | _chk_fail("wmemset"); 15 | } 16 | return wmemset(dest, c, n); 17 | } 18 | -------------------------------------------------------------------------------- /libc/string/explicit_bzero.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void explicit_bzero(void *dest, size_t len) 5 | { 6 | memset(dest, 0, len); 7 | return; 8 | } 9 | -------------------------------------------------------------------------------- /libc/string/memmove.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void *memmove(void *dest, const void *src, size_t n) 7 | { 8 | char *d = dest; 9 | const char *s = src; 10 | 11 | if (d==s) return d; 12 | if (s+n <= d || d+n <= s) return memcpy(d, s, n); 13 | 14 | if (d 2 | 3 | pid_t getpgid(pid_t pid) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /libc/unistd/getpgrp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | pid_t getpgrp(void) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /libc/unistd/getppid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | pid_t getppid(void) 5 | { 6 | return OSV_PID; 7 | } 8 | -------------------------------------------------------------------------------- /libc/unistd/getsid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | pid_t getsid(pid_t pid) 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /libc/unistd/sethostname.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | extern struct utsname utsname; 6 | 7 | int sethostname(const char *name, size_t len) 8 | { 9 | if (len < 0 || len > sizeof utsname.nodename) { 10 | errno = EINVAL; 11 | return -1; 12 | } 13 | strncpy(utsname.nodename, name, len); 14 | if (len < sizeof utsname.nodename) { 15 | utsname.nodename[len] = 0; 16 | } 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /libc/unistd/setpgid.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../libc.hh" 4 | 5 | int setpgid(pid_t pid, pid_t pgid) 6 | { 7 | WARN_STUBBED(); 8 | return libc_error(EINVAL); 9 | } 10 | -------------------------------------------------------------------------------- /libc/unistd/sync.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | #include 11 | 12 | void sync() 13 | { 14 | sys_sync(); 15 | } 16 | -------------------------------------------------------------------------------- /libc/vdso/aarch64/vdso.version: -------------------------------------------------------------------------------- 1 | /* Pretend like we are Linux 2.6.39 */ 2 | LINUX_2.6.39 { 3 | global: 4 | __kernel_gettimeofday; 5 | __kernel_clock_gettime; 6 | __kernel_clock_getres; 7 | local: 8 | *; 9 | }; 10 | -------------------------------------------------------------------------------- /libc/vdso/x64/vdso.version: -------------------------------------------------------------------------------- 1 | /* Pretend like we are Linux 2.6 */ 2 | LINUX_2.6 { 3 | global: 4 | __vdso_clock_gettime; 5 | __vdso_gettimeofday; 6 | __vdso_time; 7 | local: 8 | *; 9 | }; 10 | -------------------------------------------------------------------------------- /libvdso-content.S: -------------------------------------------------------------------------------- 1 | .pushsection .data 2 | #ifdef __x86_64__ 3 | .align 4096 4 | #endif 5 | #ifdef __aarch64__ 6 | .align 16 7 | #endif 8 | .global libvdso_start 9 | .hidden libvdso_start 10 | libvdso_start: 11 | .incbin "libvdso-stripped.so" 12 | .popsection 13 | -------------------------------------------------------------------------------- /modules/ca-certificates/usr.manifest: -------------------------------------------------------------------------------- 1 | /**: ${MODULE_DIR}/build/** 2 | /etc/pki/tls/certs/ca-bundle.trust.crt: ->/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt 3 | /etc/pki/tls/certs/ca-bundle.crt: ->/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem 4 | /etc/pki/tls/cert.pem: ->/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem 5 | /etc/pki/java/cacerts: ->/etc/pki/ca-trust/extracted/java/cacerts 6 | -------------------------------------------------------------------------------- /modules/certs/ca.info: -------------------------------------------------------------------------------- 1 | cn=osv-certs 2 | ca 3 | cert_signing_key 4 | -------------------------------------------------------------------------------- /modules/certs/client.info: -------------------------------------------------------------------------------- 1 | cn=osv-client 2 | tls_www_client 3 | encryption_key 4 | signing_key 5 | -------------------------------------------------------------------------------- /modules/certs/server.info: -------------------------------------------------------------------------------- 1 | cn=osv 2 | ip_address=192.168.122.89 3 | ip_address=172.16.0.2 4 | dns_name=localhost 5 | dns_name=osv 6 | tls_www_server 7 | encryption_key 8 | -------------------------------------------------------------------------------- /modules/certs/usr.manifest: -------------------------------------------------------------------------------- 1 | /etc/pki/server.pem: ${MODULE_DIR}/build/server.pem 2 | /etc/pki/private/server.key: ${MODULE_DIR}/build/server.key 3 | /etc/pki/CA/cacert.pem: ${MODULE_DIR}/build/cacert.pem 4 | /client/client.pem: ${MODULE_DIR}/build/client.pem 5 | /client/client.key: ${MODULE_DIR}/build/client.key 6 | -------------------------------------------------------------------------------- /modules/cli/.gitignore: -------------------------------------------------------------------------------- 1 | cli 2 | usr.manifest 3 | -------------------------------------------------------------------------------- /modules/cli/commands/date.lua: -------------------------------------------------------------------------------- 1 | local cmd = {} 2 | 3 | cmd.desc = [[print the system date and time]] 4 | cmd.help = [[Usage: date 5 | 6 | Print OSv reported date.]] 7 | 8 | cmd.main = function() 9 | local content, status = osv_request({"os", "date"}, "GET") 10 | osv_resp_assert(status, 200) 11 | io.write(content, '\n') 12 | end 13 | 14 | return cmd 15 | -------------------------------------------------------------------------------- /modules/cli/commands/dmesg.lua: -------------------------------------------------------------------------------- 1 | local cmd = {} 2 | 3 | cmd.desc = [[print operating system boot log]] 4 | cmd.help = [[Usage: dmesg 5 | 6 | Print operating system boot log.]] 7 | 8 | cmd.main = function() 9 | local content, status = osv_request({"os", "dmesg"}, "GET") 10 | osv_resp_assert(status, 200) 11 | io.write(content, "\n") 12 | end 13 | 14 | return cmd 15 | -------------------------------------------------------------------------------- /modules/cli/commands/exit.lua: -------------------------------------------------------------------------------- 1 | local cmd = {} 2 | 3 | cmd.desc = [[close shell and exit]] 4 | cmd.help = [[Usage: exit 5 | 6 | Exit the shell.]] 7 | 8 | cmd.main = function() 9 | print("Goodbye") 10 | os.exit() 11 | end 12 | 13 | return cmd 14 | -------------------------------------------------------------------------------- /modules/cli/commands/hello.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Commands are expected to be Lua modules. 3 | This file is an example of such a module. 4 | For more on Lua modules, see: http://lua-users.org/wiki/ModulesTutorial 5 | ]]-- 6 | 7 | local cmd = {} 8 | 9 | cmd.desc = [[a command example]] 10 | cmd.hello = [[Usage: hello 11 | 12 | A command example.]] 13 | 14 | --- Called when the command is executed 15 | -- @param args List of arguments from the command line 16 | cmd.main = function(args) 17 | print("Hello, OSv!") 18 | end 19 | 20 | return cmd 21 | -------------------------------------------------------------------------------- /modules/cli/commands/poweroff.lua: -------------------------------------------------------------------------------- 1 | local cmd = {} 2 | 3 | cmd.desc = [[poweroff an OSv instance]] 4 | cmd.help = [[Usage: poweroff 5 | 6 | Poweroff the instance.]] 7 | 8 | cmd.main = function() 9 | local total, status = osv_request({"os", "poweroff"}, "POST") 10 | osv_resp_assert(status, 200) 11 | end 12 | 13 | return cmd 14 | -------------------------------------------------------------------------------- /modules/cli/commands/reboot.lua: -------------------------------------------------------------------------------- 1 | local cmd = {} 2 | 3 | cmd.desc = [[reboot an OSv instance]] 4 | cmd.help = [[Usage: reboot 5 | 6 | Reboot the instance.]] 7 | 8 | cmd.main = function() 9 | local total, status = osv_request({"os", "reboot"}, "POST") 10 | osv_resp_assert(status, 200) 11 | end 12 | 13 | return cmd 14 | -------------------------------------------------------------------------------- /modules/cli/lib/context.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.commands_path = "commands" 4 | M.commands_test_path = "test" 5 | M.api = "http://127.0.0.1:8000" 6 | 7 | M.ssl_key = nil 8 | M.ssl_cert = nil 9 | M.ssl_cacert = nil 10 | M.ssl_verify = "peer" 11 | 12 | return M 13 | -------------------------------------------------------------------------------- /modules/cli/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules.api import * 2 | from osv.modules.filemap import FileMap 3 | from osv.modules import api 4 | 5 | require('lua') 6 | require('terminfo') 7 | require_running('httpserver') 8 | 9 | usr_files = FileMap() 10 | usr_files.add('${OSV_BASE}/modules/cli').to('/cli-app') \ 11 | .include('cli.lua') \ 12 | .include('lib/**') \ 13 | .include('commands/**') 14 | 15 | full = api.run('/cli') 16 | default = full 17 | -------------------------------------------------------------------------------- /modules/cli/mpm/package.yaml: -------------------------------------------------------------------------------- 1 | title: OSv Command Line 2 | require: 3 | - osv.httpserver-api 4 | -------------------------------------------------------------------------------- /modules/cli/rpmbuild/.gitignore: -------------------------------------------------------------------------------- 1 | BUILD/* 2 | BUILDROOT/* 3 | osv-cli-1.0/* 4 | RPMS/* 5 | SOURCES/* 6 | SRPMS/* 7 | -------------------------------------------------------------------------------- /modules/cli/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | THIS_DIR=$(readlink -f $(dirname $0)) 4 | CMDLINE=$($THIS_DIR/../../apps/cmdline.sh $THIS_DIR) 5 | 6 | $THIS_DIR/../../scripts/tests/test_app.py -e "$CMDLINE" \ 7 | --line "Rest API server running" \ 8 | --input_line "ls -l /" \ 9 | --input_line "exit" 10 | -------------------------------------------------------------------------------- /modules/cli/test/cat_test.lua: -------------------------------------------------------------------------------- 1 | local t = {} 2 | 3 | t.run = function() 4 | osv_request_mock("foohost", {"file", "/etc/hosts"}, "GET", {op = "GET"}) 5 | assert(t_main({"/etc/hosts"}) == "foohost\n") 6 | 7 | osv_request_mock({response="none", status=404}, {"file", "/no/file"}, "GET", {op = "GET"}) 8 | local out, err = t_main({"/no/file"}) 9 | assert(err == "/no/file: File not found\n") 10 | end 11 | 12 | return t 13 | -------------------------------------------------------------------------------- /modules/cli/test/date_test.lua: -------------------------------------------------------------------------------- 1 | local t = {} 2 | 3 | t.run = function() 4 | osv_request_mock('"Thu Sep 11 10:24:47 2014"', {"os", "date"}, "GET") 5 | assert(t_main() == "Thu Sep 11 10:24:47 2014\n") 6 | end 7 | 8 | return t 9 | -------------------------------------------------------------------------------- /modules/cli/test/dmesg_test.lua: -------------------------------------------------------------------------------- 1 | local t = {} 2 | 3 | t.run = function() 4 | osv_request_mock("foobar", "/os/dmesg") 5 | assert(t_main() == "foobar\n") 6 | end 7 | 8 | return t 9 | -------------------------------------------------------------------------------- /modules/cli/test/echo_test.lua: -------------------------------------------------------------------------------- 1 | local t = {} 2 | 3 | t.run = function() 4 | local out, err 5 | 6 | out, err = t_main({"foo", "bar"}) 7 | assert(out == "foo bar\n") 8 | 9 | out, err = t_main({"-n", "foo"}) 10 | assert(out == "foo") 11 | end 12 | 13 | return t 14 | -------------------------------------------------------------------------------- /modules/cli/test/free_test.lua: -------------------------------------------------------------------------------- 1 | local t = {} 2 | 3 | t.run = function() 4 | osv_request_mock(2132283392, {"os", "memory", "total"}, "GET") 5 | osv_request_mock(1726300160, {"os", "memory", "free"}, "GET") 6 | 7 | assert(t_main() == (' total used free \n' .. 8 | 'Mem: 2132283392 405983232 1726300160 \n')) 9 | 10 | end 11 | 12 | return t 13 | -------------------------------------------------------------------------------- /modules/cli/test/mkdir_test.lua: -------------------------------------------------------------------------------- 1 | local t = {} 2 | 3 | t.run = function() 4 | osv_request_mock("mock", {"file", "/foo"}, "PUT", { 5 | op = "MKDIRS", permission = "0755", createParent = "false"}) 6 | osv_request_mock("mock", {"file", "/foo/parent"}, "PUT", { 7 | op = "MKDIRS", permission = "0755", createParent = "true"}) 8 | 9 | -- Failing to find a mocked response will raise and error 10 | t_main({"/foo"}) 11 | t_main({"-p", "/foo/parent"}) 12 | end 13 | 14 | return t 15 | -------------------------------------------------------------------------------- /modules/cloud-init/.gitignore: -------------------------------------------------------------------------------- 1 | /tst-template 2 | -------------------------------------------------------------------------------- /modules/cloud-init/cloud-init.yaml: -------------------------------------------------------------------------------- 1 | #open httpserver for input 2 | run: 3 | - GET: /os/version 4 | 5 | # mount NFS export example 6 | #mounts: 7 | # - [ "192.168.122.1:/ggg", /ggg, "nfs", "uid=1000,gid=1000", "0", "0" ] 8 | 9 | # set hostname example 10 | #hostname: uber-vm 11 | -------------------------------------------------------------------------------- /modules/cloud-init/cmdline: -------------------------------------------------------------------------------- 1 | /usr/mgmt/cloud-init.so; 2 | -------------------------------------------------------------------------------- /modules/dl_tests/bionic/tests/libs/empty.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/modules/dl_tests/bionic/tests/libs/empty.cpp -------------------------------------------------------------------------------- /modules/empty/module.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/modules/empty/module.py -------------------------------------------------------------------------------- /modules/empty/mpm/package.yaml: -------------------------------------------------------------------------------- 1 | name: osv.bootstrap 2 | title: OSv Bootstrap 3 | -------------------------------------------------------------------------------- /modules/golang/.gitignore: -------------------------------------------------------------------------------- 1 | *.so 2 | obj/* 3 | *.manifest 4 | -------------------------------------------------------------------------------- /modules/golang/mpm/package.yaml: -------------------------------------------------------------------------------- 1 | name: osv.run-go 2 | title: Run Golang wrapper 3 | -------------------------------------------------------------------------------- /modules/httpserver-api-https-tests/init/30-auto-00: -------------------------------------------------------------------------------- 1 | /libhttpserver-api.so --ssl &! 2 | -------------------------------------------------------------------------------- /modules/httpserver-api-https-tests/usr.manifest: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /init/30-auto-00: ${MODULE_DIR}/init/30-auto-00 3 | -------------------------------------------------------------------------------- /modules/httpserver-api-tests/init/30-auto-00: -------------------------------------------------------------------------------- 1 | /libhttpserver-api.so &! -------------------------------------------------------------------------------- /modules/httpserver-api-tests/mpm/package.yaml: -------------------------------------------------------------------------------- 1 | title: OSv httpserver API tests 2 | require: 3 | - osv.openjdk8-zulu-compact3-with-java-beans 4 | #- osv.openjdk11-zulu 5 | - osv.run-java 6 | - osv.httpserver-api 7 | - osv.libz 8 | - osv.jetty 9 | -------------------------------------------------------------------------------- /modules/httpserver-api-tests/usr.manifest: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /init/30-auto-00: ${MODULE_DIR}/init/30-auto-00 3 | -------------------------------------------------------------------------------- /modules/httpserver-api/.gitignore: -------------------------------------------------------------------------------- 1 | autogen/* 2 | *.manifest 3 | -------------------------------------------------------------------------------- /modules/httpserver-api/mpm/package.yaml: -------------------------------------------------------------------------------- 1 | title: OSv httpserver with APIs (backend) 2 | -------------------------------------------------------------------------------- /modules/httpserver-api/openssl-init.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef _HTTPSERVER_OPENSSL_INIT_HH 9 | #define _HTTPSERVER_OPENSSL_INIT_HH 10 | 11 | void ensure_openssl_initialized(); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /modules/httpserver-api/stub/debug.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | 9 | #include 10 | 11 | char debug_buffer[DEBUG_BUFFER_SIZE] = {0}; 12 | -------------------------------------------------------------------------------- /modules/httpserver-html5-gui/mpm/package.yaml: -------------------------------------------------------------------------------- 1 | title: OSv HTML5 GUI (frontend) 2 | require: 3 | - osv.httpserver-api 4 | -------------------------------------------------------------------------------- /modules/httpserver-jolokia-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | usr.manifest 2 | -------------------------------------------------------------------------------- /modules/httpserver-jolokia-plugin/module.py: -------------------------------------------------------------------------------- 1 | import os 2 | from osv.modules.api import * 3 | from osv.modules.filemap import FileMap 4 | from osv.modules import api 5 | 6 | _module = '${OSV_BASE}/modules/httpserver-jolokia-plugin' 7 | 8 | usr_files = FileMap() 9 | usr_files.add(os.path.join(_module, 'api-doc/listings/jolokia.json')).to('/usr/mgmt/api/listings/jolokia.json') 10 | usr_files.add(os.path.join(_module, 'jolokia-agent/target/jolokia-agent.jar')).to('/usr/mgmt/jolokia-agent.jar') 11 | -------------------------------------------------------------------------------- /modules/httpserver-jvm-plugin/module.py: -------------------------------------------------------------------------------- 1 | import os 2 | from osv.modules.api import * 3 | from osv.modules.filemap import FileMap 4 | from osv.modules import api 5 | 6 | _module = '${OSV_BASE}/modules/httpserver-jvm-plugin' 7 | 8 | usr_files = FileMap() 9 | usr_files.add(os.path.join(_module, 'jvm.so')).to('/usr/mgmt/plugins/jvm.so') 10 | usr_files.add(os.path.join(_module, 'api-doc/listings/jvm.json')).to('/usr/mgmt/api/listings/jvm.json') 11 | 12 | api.require('libtools') 13 | -------------------------------------------------------------------------------- /modules/httpserver-monitoring-api/.gitignore: -------------------------------------------------------------------------------- 1 | autogen/* 2 | *.manifest 3 | -------------------------------------------------------------------------------- /modules/httpserver-monitoring-api/add_aarch64_libraries.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | OSV_BASE=$1 3 | 4 | BOOST_BASE=$OSV_BASE/build/downloaded_packages/aarch64/boost/install 5 | BOOST_LIB_DIR=$(readlink -f $(dirname $(find $BOOST_BASE/ -name libboost_system.so))) 6 | 7 | echo "/usr/lib/$(basename $(readlink -f $BOOST_LIB_DIR/libboost_system.so)): $BOOST_LIB_DIR/libboost_system.so" 8 | echo "/usr/lib/$(basename $(readlink -f $BOOST_LIB_DIR/libboost_filesystem.so)): $BOOST_LIB_DIR/libboost_filesystem.so" 9 | -------------------------------------------------------------------------------- /modules/httpserver-monitoring-api/mpm/package.yaml: -------------------------------------------------------------------------------- 1 | title: OSv httpserver monitoring APIs 2 | -------------------------------------------------------------------------------- /modules/httpserver/Makefile: -------------------------------------------------------------------------------- 1 | # This "make clean" should not be needed because we no longer build anything 2 | # in this directory, but prior to commit c446634 we did create things here, 3 | # and if we forget to delete them, especially usr.manifest, future builds 4 | # may fail (see issue #931). 5 | clean: 6 | -rm -rf autogen obj 7 | -rm -f libhttpserver*.so usr.manifest 8 | module: 9 | .PHONY: clean module 10 | -------------------------------------------------------------------------------- /modules/httpserver/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | 3 | api.require('httpserver-html5-gui') 4 | 5 | fg = api.run('/libhttpserver-api.so') 6 | 7 | # httpserver will run regardless of an explicit command line 8 | # passed with "run.py -e". 9 | daemon = api.run_on_init('/libhttpserver-api.so &!') 10 | default = daemon 11 | -------------------------------------------------------------------------------- /modules/java-base/balloon/balloon_api.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #ifndef BALLOON_API_HH_ 9 | #define BALLOON_API_HH_ 10 | 11 | namespace memory { 12 | ssize_t get_balloon_size(); 13 | }; 14 | 15 | 16 | 17 | #endif /* BALLOON_API_HH_ */ 18 | -------------------------------------------------------------------------------- /modules/java-base/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | 3 | api.require('ca-certificates') 4 | api.require('libz') 5 | -------------------------------------------------------------------------------- /modules/java-base/runjava-common/src/main/java/io/osv/AppThreadTerminatedWithUncaughtException.java: -------------------------------------------------------------------------------- 1 | package io.osv; 2 | 3 | /* 4 | * Copyright (C) 2016 Waldemar Kozaczuk 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | public class AppThreadTerminatedWithUncaughtException extends Exception { 10 | public AppThreadTerminatedWithUncaughtException(Throwable cause) { 11 | super(cause); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /modules/java-base/runjava-common/src/main/java/io/osv/GCInfo.java: -------------------------------------------------------------------------------- 1 | package io.osv; 2 | /* 3 | * Copyright (C) 2013-2014 Cloudius Systems, Ltd. 4 | * 5 | * This work is open source software, licensed under the terms of the 6 | * BSD license as described in the LICENSE file in the top-level directory. 7 | */ 8 | 9 | 10 | /** 11 | * A helper class that holds Garbage collection information 12 | */ 13 | public class GCInfo { 14 | long count; 15 | long time; 16 | String name; 17 | String[] pools; 18 | } 19 | -------------------------------------------------------------------------------- /modules/java-base/runjava-isolated/src/main/java/io/osv/jul/DefaultLogManager.java: -------------------------------------------------------------------------------- 1 | package io.osv.jul; 2 | 3 | import java.util.logging.LogManager; 4 | 5 | /* 6 | * Copyright (C) 2014 Cloudius Systems, Ltd. 7 | * 8 | * This work is open source software, licensed under the terms of the 9 | * BSD license as described in the LICENSE file in the top-level directory. 10 | */ 11 | public class DefaultLogManager extends LogManager { 12 | } 13 | -------------------------------------------------------------------------------- /modules/java-base/runjava-isolated/src/main/java/io/osv/util/InitializationException.java: -------------------------------------------------------------------------------- 1 | package io.osv.util; 2 | 3 | public class InitializationException extends RuntimeException { 4 | public InitializationException(Throwable cause) { 5 | super(cause); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /modules/java-base/usr.manifest: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013-2014 Cloudius Systems, Ltd. 3 | # 4 | # This work is open source software, licensed under the terms of the 5 | # BSD license as described in the LICENSE file in the top-level directory. 6 | # 7 | 8 | [manifest] 9 | /usr/lib/jni/monitor.so: ./modules/java-base/jni/monitor.so 10 | -------------------------------------------------------------------------------- /modules/java-cmd/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | 3 | api.require('java-non-isolated') 4 | -------------------------------------------------------------------------------- /modules/java-isolated/.java.policy: -------------------------------------------------------------------------------- 1 | grant codeBase "file:/java/runjava-isolated.jar" { 2 | permission java.security.AllPermission; 3 | }; 4 | grant codeBase "file:/usr/mgmt/jolokia-agent.jar" { 5 | permission java.security.AllPermission; 6 | }; 7 | -------------------------------------------------------------------------------- /modules/java-isolated/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | 3 | api.require('java-base') 4 | provides = ['java-cmd'] 5 | -------------------------------------------------------------------------------- /modules/java-isolated/usr.manifest: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013-2014 Cloudius Systems, Ltd. 3 | # 4 | # This work is open source software, licensed under the terms of the 5 | # BSD license as described in the LICENSE file in the top-level directory. 6 | # 7 | 8 | [manifest] 9 | /java.so: ./modules/java-isolated/java.so 10 | /java/runjava-isolated.jar: ${OSV_BASE}/modules/java-base/runjava-isolated/target/runjava-isolated.jar 11 | /.java.policy: ${MODULE_DIR}/.java.policy 12 | -------------------------------------------------------------------------------- /modules/java-mgmt/cloudius/src/main/java/com/cloudius/cli/tests/Test.java: -------------------------------------------------------------------------------- 1 | package com.cloudius.cli.tests; 2 | 3 | public interface Test { 4 | boolean run(); 5 | } 6 | -------------------------------------------------------------------------------- /modules/java-mgmt/cloudius/src/main/java/com/cloudius/net/Arp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | package com.cloudius.net; 9 | 10 | import com.cloudius.Config; 11 | 12 | public class Arp { 13 | static { 14 | Config.loadJNI("networking.so"); 15 | } 16 | 17 | public native static void add(String ifname, String macaddr, String ip); 18 | } 19 | -------------------------------------------------------------------------------- /modules/java-mgmt/cloudius/src/main/java/com/cloudius/net/DHCP.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | package com.cloudius.net; 9 | 10 | import com.cloudius.Config; 11 | 12 | public class DHCP { 13 | static { 14 | Config.loadJNI("networking.so"); 15 | } 16 | 17 | public native static void dhcp_start(); 18 | } 19 | -------------------------------------------------------------------------------- /modules/java-mgmt/cloudius/src/main/java/com/cloudius/net/Route.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | package com.cloudius.net; 9 | 10 | import com.cloudius.Config; 11 | 12 | public class Route { 13 | static { 14 | Config.loadJNI("networking.so"); 15 | } 16 | 17 | public native static void add_default(String gw); 18 | } 19 | -------------------------------------------------------------------------------- /modules/java-mgmt/cloudius/src/main/java/com/cloudius/util/IStty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | package com.cloudius.util; 9 | 10 | public interface IStty { 11 | public void raw(); 12 | public void reset(); 13 | public void close() throws Exception; 14 | } 15 | -------------------------------------------------------------------------------- /modules/java-mgmt/jni/power.cc: -------------------------------------------------------------------------------- 1 | /* To compile this into a shared object: 2 | * cc -s -fPIC -shared -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux -o stty.so stty.c 3 | */ 4 | 5 | #include 6 | 7 | #include 8 | 9 | extern "C" { 10 | JNIEXPORT void JNICALL 11 | Java_com_cloudius_util_Power_reboot 12 | (JNIEnv *env, jobject self) 13 | { 14 | osv::reboot(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /modules/java-mgmt/usr.manifest: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /usr/lib/jni/balloon.so: ${MODULE_DIR}/obj/jni/balloon.so 3 | /usr/lib/jni/elf-loader.so: ${MODULE_DIR}/obj/jni/elf-loader.so 4 | /usr/lib/jni/networking.so: ${MODULE_DIR}/obj/jni/networking.so 5 | /usr/lib/jni/stty.so: ${MODULE_DIR}/obj/jni/stty.so 6 | /usr/lib/jni/tracepoint.so: ${MODULE_DIR}/obj/jni/stty.so 7 | /usr/lib/jni/power.so: ${MODULE_DIR}/obj/jni/power.so 8 | /java/cloudius.jar: ${MODULE_DIR}/cloudius/target/cloudius.jar 9 | -------------------------------------------------------------------------------- /modules/java-non-isolated/.java.policy: -------------------------------------------------------------------------------- 1 | grant codeBase "file:/java/runjava-non-isolated.jar" { 2 | permission java.security.AllPermission; 3 | }; 4 | grant codeBase "file:/usr/mgmt/jolokia-agent.jar" { 5 | permission java.security.AllPermission; 6 | }; 7 | -------------------------------------------------------------------------------- /modules/java-non-isolated/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | 3 | java_base = api.require('java-base') 4 | java_base.non_isolated_jvm = True 5 | provides = ['java-cmd'] 6 | -------------------------------------------------------------------------------- /modules/java-non-isolated/mpm/package.yaml: -------------------------------------------------------------------------------- 1 | name: osv.run-java 2 | title: Run Java wrapper 3 | -------------------------------------------------------------------------------- /modules/java-non-isolated/usr.manifest: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013-2014 Cloudius Systems, Ltd. 3 | # 4 | # This work is open source software, licensed under the terms of the 5 | # BSD license as described in the LICENSE file in the top-level directory. 6 | # 7 | 8 | [manifest] 9 | /java.so: ./modules/java-non-isolated/java_non_isolated.so 10 | /java/runjava-non-isolated.jar: ${OSV_BASE}/modules/java-base/runjava-non-isolated/target/runjava-non-isolated.jar 11 | /.java.policy: ${MODULE_DIR}/.java.policy 12 | -------------------------------------------------------------------------------- /modules/java-tests/.gitignore: -------------------------------------------------------------------------------- 1 | test_commands 2 | -------------------------------------------------------------------------------- /modules/java-tests/.java.policy: -------------------------------------------------------------------------------- 1 | grant codeBase "file:/java/runjava-non-isolated.jar" { 2 | permission java.security.AllPermission; 3 | }; 4 | grant codeBase "file:/java/runjava-isolated.jar" { 5 | permission java.security.AllPermission; 6 | }; -------------------------------------------------------------------------------- /modules/java-tests/tests-for-java9_1x/src/main/java/io/osv/BasicTest.java: -------------------------------------------------------------------------------- 1 | ../../../../../../tests/src/main/java/io/osv/BasicTest.java -------------------------------------------------------------------------------- /modules/java-tests/tests-for-java9_1x/src/main/java/io/osv/BasicTests.java: -------------------------------------------------------------------------------- 1 | ../../../../../../tests/src/main/java/io/osv/BasicTests.java -------------------------------------------------------------------------------- /modules/java-tests/tests-for-java9_1x/src/main/java/io/osv/LoggingTest.java: -------------------------------------------------------------------------------- 1 | ../../../../../../tests/src/main/java/io/osv/LoggingTest.java -------------------------------------------------------------------------------- /modules/java-tests/tests-for-java9_1x/src/main/java/io/osv/TemporarySecurityManager.java: -------------------------------------------------------------------------------- 1 | ../../../../../../tests/src/main/java/io/osv/TemporarySecurityManager.java -------------------------------------------------------------------------------- /modules/java-tests/tests-for-java9_1x/src/main/java/io/osv/TestDomainPermissions.java: -------------------------------------------------------------------------------- 1 | ../../../../../../tests/src/main/java/io/osv/TestDomainPermissions.java -------------------------------------------------------------------------------- /modules/java-tests/tests-isolates/src/main/java/tests/ClassFinder.java: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | /* 4 | * Copyright (C) 2014 Cloudius Systems, Ltd. 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | public class ClassFinder { 10 | public static void main(String[] args) throws ClassNotFoundException { 11 | String className = args[0]; 12 | Class.forName(className); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /modules/java-tests/tests-isolates/src/main/java/tests/ClassPresentInBothContexts.java: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | /* 4 | * Copyright (C) 2014 Cloudius Systems, Ltd. 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | public class ClassPresentInBothContexts { 10 | @SuppressWarnings("UnusedDeclaration") 11 | public static boolean field_existing_only_in_isolate_context; 12 | } 13 | -------------------------------------------------------------------------------- /modules/java-tests/tests-jre-extension/src/main/java/tests/SomeExtensionClass.java: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | /* 4 | * Copyright (C) 2014 Cloudius Systems, Ltd. 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | public class SomeExtensionClass { 10 | } 11 | -------------------------------------------------------------------------------- /modules/java-tests/tests/src/main/java/io/osv/BasicTest.java: -------------------------------------------------------------------------------- 1 | package io.osv; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /* 8 | * Copyright (C) 2019 Waldemar Kozaczuk. 9 | * 10 | * This work is open source software, licensed under the terms of the 11 | * BSD license as described in the LICENSE file in the top-level directory. 12 | */ 13 | public class BasicTest { 14 | @Test 15 | public void testBasic() { 16 | assertEquals(Boolean.TRUE,Boolean.TRUE); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /modules/java-tests/tests/src/main/java/io/osv/BasicTests.java: -------------------------------------------------------------------------------- 1 | package io.osv; 2 | 3 | /* 4 | * Copyright (C) 2019 Waldemar Kozaczuk 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | 10 | import org.junit.runner.RunWith; 11 | import org.junit.runners.Suite; 12 | 13 | @RunWith(Suite.class) 14 | @Suite.SuiteClasses({ 15 | BasicTest.class, 16 | LoggingTest.class 17 | }) 18 | public class BasicTests { 19 | } 20 | -------------------------------------------------------------------------------- /modules/java-tests/tests/src/main/java/tests/ClassPresentInBothContexts.java: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | /* 4 | * Copyright (C) 2014 Cloudius Systems, Ltd. 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | public class ClassPresentInBothContexts { 10 | } 11 | -------------------------------------------------------------------------------- /modules/java-tests/tests/src/main/java/tests/ClassPresentOnlyInParentContext.java: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | /* 4 | * Copyright (C) 2014 Cloudius Systems, Ltd. 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | public class ClassPresentOnlyInParentContext { 10 | } 11 | -------------------------------------------------------------------------------- /modules/java-tests/tests/src/main/java/tests/ClassPutInRoot.java: -------------------------------------------------------------------------------- 1 | package tests; 2 | 3 | /* 4 | * Copyright (C) 2014 Cloudius Systems, Ltd. 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | 10 | public class ClassPutInRoot extends ClassPresentOnlyInParentContext { 11 | } 12 | -------------------------------------------------------------------------------- /modules/java/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | import subprocess 3 | 4 | javac_with_version = subprocess.check_output(['javac', '-version'], stderr=subprocess.STDOUT).decode('utf-8') 5 | 6 | if javac_with_version.startswith('javac 1.8'): 7 | api.require('java-non-isolated') 8 | api.require('openjdk8-from-host') 9 | else: 10 | api.require('openjdk9_1x-from-host') 11 | -------------------------------------------------------------------------------- /modules/josvsym/usr.manifest: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013-2014 Cloudius Systems, Ltd. 3 | # 4 | # This work is open source software, licensed under the terms of the 5 | # BSD license as described in the LICENSE file in the top-level directory. 6 | # 7 | 8 | [manifest] 9 | /usr/lib/jvm/agents/autoload/libjosvsym.so: modules/josvsym/libjosvsym.so 10 | -------------------------------------------------------------------------------- /modules/libcdio/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | download 3 | -------------------------------------------------------------------------------- /modules/libcdio/relink-binary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ev 4 | 5 | BIN=$1 6 | SRC_DIR=$(dirname "$BIN")/.. 7 | SRC_FILE_BASE=$(basename "$BIN" | sed 's/\.so$//') 8 | SRC_FILE=$SRC_FILE_BASE.c 9 | 10 | cd $SRC_DIR 11 | touch $SRC_FILE 12 | CMD1=$(make V=1 | grep "\-o .libs/$SRC_FILE_BASE") 13 | CMD2=$(echo $CMD1 | sed -e "s|^libtool: link: ||" -e "s| -o .libs/$SRC_FILE_BASE | -shared -o .libs/$SRC_FILE_BASE.so |") 14 | $CMD2 15 | -------------------------------------------------------------------------------- /modules/libedit/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | download 3 | -------------------------------------------------------------------------------- /modules/libedit/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules.filemap import FileMap 2 | 3 | VERSION = '20140620-3.1' 4 | 5 | usr_files = FileMap() 6 | usr_files.add('${OSV_BASE}/modules/libedit/build/libedit-%s/src/.libs' % VERSION).to('/usr/lib') \ 7 | .include('lib*.so.?') 8 | -------------------------------------------------------------------------------- /modules/libext/.gitignore: -------------------------------------------------------------------------------- 1 | usr.manifest 2 | -------------------------------------------------------------------------------- /modules/libext/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | 3 | api.require('lwext4') 4 | -------------------------------------------------------------------------------- /modules/libnfs/.gitignore: -------------------------------------------------------------------------------- 1 | upstream 2 | -------------------------------------------------------------------------------- /modules/libnfs/usr.manifest: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2018 Waldemar Kozaczuk 3 | # 4 | # This work is open source software, licensed under the terms of the 5 | # BSD license as described in the LICENSE file in the top-level directory. 6 | # 7 | 8 | [manifest] 9 | /usr/lib/libnfs.so.11.0.0: ${MODULE_DIR}/upstream/libnfs/lib/libnfs.so.4.0.0 10 | -------------------------------------------------------------------------------- /modules/libtools/.gitignore: -------------------------------------------------------------------------------- 1 | usr.manifest 2 | -------------------------------------------------------------------------------- /modules/libyaml/Makefile: -------------------------------------------------------------------------------- 1 | # Take libyaml-cpp.so from the build machine and put it in the image. 2 | libyaml = $(shell $(CC) -print-file-name=libyaml-cpp.so) 3 | module: 4 | echo /usr/lib/`readlink $(libyaml)`: $(libyaml) > usr.manifest 5 | -------------------------------------------------------------------------------- /modules/libz/.gitignore: -------------------------------------------------------------------------------- 1 | usr.manifest 2 | -------------------------------------------------------------------------------- /modules/libz/Makefile: -------------------------------------------------------------------------------- 1 | # Take libz.so from the build machine and put it in the image. 2 | very-quiet = $(if $V, $1, @$1) 3 | libz = $(shell $(CC) -print-file-name=libz.so.1) 4 | module: 5 | $(call very-quiet, echo /usr/lib/libz.so.1: $(libz) > usr.manifest) 6 | -------------------------------------------------------------------------------- /modules/lua/.gitignore: -------------------------------------------------------------------------------- 1 | install 2 | upstream 3 | usr.manifest 4 | -------------------------------------------------------------------------------- /modules/lua/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules.filemap import FileMap 2 | 3 | usr_files = FileMap() 4 | usr_files.add('${OSV_BASE}/modules/lua/install/lua_modules/').to('/usr') \ 5 | .exclude('lib/luarocks/**') \ 6 | .exclude('share/lua/*/luarocks/**') 7 | -------------------------------------------------------------------------------- /modules/lwext4/.gitignore: -------------------------------------------------------------------------------- 1 | upstream 2 | -------------------------------------------------------------------------------- /modules/lwext4/usr.manifest: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2024 Waldemar Kozaczuk 3 | # 4 | # This work is open source software, licensed under the terms of the 5 | # BSD license as described in the LICENSE file in the top-level directory. 6 | # 7 | 8 | [manifest] 9 | /usr/lib/liblwext4.so: ${MODULE_DIR}/upstream/lwext4/build_lib_only/src/liblwext4.so 10 | -------------------------------------------------------------------------------- /modules/monitoring-agent/.gitignore: -------------------------------------------------------------------------------- 1 | monitoring-agent.so 2 | monitoring-agent 3 | obj/* 4 | -------------------------------------------------------------------------------- /modules/monitoring-agent/cmdline: -------------------------------------------------------------------------------- 1 | /usr/mgmt/monitoring-agent.so &; 2 | -------------------------------------------------------------------------------- /modules/monitoring-agent/module.py: -------------------------------------------------------------------------------- 1 | import os 2 | from osv.modules.api import * 3 | from osv.modules.filemap import FileMap 4 | from osv.modules import api 5 | 6 | _module = '${OSV_BASE}/modules/monitoring-agent' 7 | 8 | usr_files = FileMap() 9 | usr_files.add(os.path.join(_module, 'monitoring-agent.so')).to('/usr/mgmt/monitoring-agent.so') 10 | usr_files.add(os.path.join(_module, 'cmdline')).to('/init/01-cmdline') 11 | 12 | default = "" 13 | -------------------------------------------------------------------------------- /modules/ncurses/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | download 3 | out 4 | -------------------------------------------------------------------------------- /modules/ncurses/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules.filemap import FileMap 2 | 3 | VERSION = '5.9' 4 | 5 | usr_files = FileMap() 6 | usr_files.add('${OSV_BASE}/modules/ncurses/build/ncurses-%s/lib' % VERSION).to('/usr/lib') \ 7 | .include('lib*.so.?') 8 | 9 | usr_files.add('${OSV_BASE}/modules/ncurses/out/terminfo').to('/usr/share/terminfo') 10 | -------------------------------------------------------------------------------- /modules/nfs-tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.so 2 | *.d 3 | unfsd.bin 4 | upstream 5 | -------------------------------------------------------------------------------- /modules/nfs-tests/module.py: -------------------------------------------------------------------------------- 1 | import os 2 | from osv.modules.filemap import FileMap 3 | from osv.modules import api 4 | 5 | _module = '${OSV_BASE}/modules/nfs-tests' 6 | 7 | usr_files = FileMap() 8 | usr_files.add(os.path.join(_module, 'tst-nfs.so')).to('/tst-nfs.so') 9 | usr_files.add(os.path.join(_module, 'fsx-linux.so')).to('/fsx-linux.so') 10 | -------------------------------------------------------------------------------- /modules/nfs/.gitignore: -------------------------------------------------------------------------------- 1 | obj 2 | *.so 3 | usr.manifest 4 | -------------------------------------------------------------------------------- /modules/nfs/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | 3 | api.require('libnfs') 4 | -------------------------------------------------------------------------------- /modules/openjdk8-from-host/.gitignore: -------------------------------------------------------------------------------- 1 | usr.manifest 2 | -------------------------------------------------------------------------------- /modules/openjdk9_1x-from-host/.gitignore: -------------------------------------------------------------------------------- 1 | usr.manifest 2 | -------------------------------------------------------------------------------- /modules/openssl/.gitignore: -------------------------------------------------------------------------------- 1 | usr.manifest 2 | -------------------------------------------------------------------------------- /modules/openssl/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | 3 | api.require('libz') 4 | -------------------------------------------------------------------------------- /modules/sysinfo/.gitignore: -------------------------------------------------------------------------------- 1 | sysinfo*.so 2 | -------------------------------------------------------------------------------- /modules/sysinfo/Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES = -I../../include 2 | COMMON_FLAGS = -g -Wall -fPIC $(INCLUDES) -O2 3 | CXXFLAGS = -std=$(conf_cxx_level) $(COMMON_FLAGS) 4 | 5 | .PHONY: module 6 | module: sysinfo.so 7 | 8 | quiet = $(if $V, $1, @echo " $2"; $1) 9 | 10 | sysinfo.so: sysinfo.cc 11 | $(call quiet, $(CXX) $(CXXFLAGS) -shared -o $@ sysinfo.cc, LINK $@) 12 | 13 | clean: 14 | rm -f sysinfo.so sysinfo.d 15 | -------------------------------------------------------------------------------- /modules/sysinfo/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | 3 | daemon = api.run_on_init('/sysinfo.so --interval 1000000 &!') 4 | default = daemon 5 | -------------------------------------------------------------------------------- /modules/sysinfo/usr.manifest: -------------------------------------------------------------------------------- 1 | /sysinfo.so: ${MODULE_DIR}/sysinfo.so 2 | -------------------------------------------------------------------------------- /modules/terminfo/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | -------------------------------------------------------------------------------- /modules/terminfo/Makefile: -------------------------------------------------------------------------------- 1 | OUT=out 2 | TI_VT100=$(OUT)/terminfo/v/vt100-qemu 3 | 4 | module: $(TI_VT100) 5 | 6 | $(TI_VT100): $(MAIN) 7 | @mkdir -p $(OUT)/terminfo 8 | infocmp vt100 | sed 's/cud1=\(^J\|\\n\),/cud1=\\E[B,/; s/ind=\(^J\|\\n\),/ind=\\E[S,/; s/vt100/vt100-qemu/' \ 9 | > $(OUT)/terminfo.tmp 10 | tic -o $(OUT)/terminfo $(OUT)/terminfo.tmp 11 | rm -f $(OUT)/terminfo.tmp 12 | 13 | clean: 14 | rm -rf $(OUT) 15 | 16 | .PHONY: module clean 17 | -------------------------------------------------------------------------------- /modules/terminfo/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules.filemap import FileMap 2 | 3 | usr_files = FileMap() 4 | usr_files.add('${OSV_BASE}/modules/terminfo/out/terminfo').to('/usr/share/terminfo') 5 | -------------------------------------------------------------------------------- /modules/tests-with-linux-ld/.gitignore: -------------------------------------------------------------------------------- 1 | usr.manifest 2 | fs.manifest 3 | common.manifest 4 | -------------------------------------------------------------------------------- /modules/tests-with-linux-ld/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | import os 3 | 4 | _modules_base = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') 5 | _java_test_commands_file = _modules_base + '/java-tests/test_commands' 6 | 7 | host_arch = os.uname().machine 8 | if host_arch == 'x86_64' and os.getenv('ARCH') == 'aarch64': 9 | if os.path.exists(_java_test_commands_file): 10 | os.remove(_java_test_commands_file) 11 | else: 12 | api.require('java-tests') 13 | 14 | api.require('dl_tests') 15 | -------------------------------------------------------------------------------- /modules/tests-with-linux-ld/usr.manifest.skel: -------------------------------------------------------------------------------- 1 | /usr/share/zoneinfo/America/**: /usr/share/zoneinfo/America/** 2 | /usr/share/zoneinfo/Europe/**: /usr/share/zoneinfo/Europe/** 3 | /usr/share/zoneinfo/Pacific/**: /usr/share/zoneinfo/Pacific/** 4 | /usr/share/zoneinfo/Asia/**: /usr/share/zoneinfo/Asia/** 5 | /usr/lib/locale/C.utf8/**: /usr/lib/locale/C.utf8/** 6 | -------------------------------------------------------------------------------- /modules/tests/.gitignore: -------------------------------------------------------------------------------- 1 | usr.manifest 2 | fs.manifest 3 | common.manifest 4 | -------------------------------------------------------------------------------- /modules/tests/module.py: -------------------------------------------------------------------------------- 1 | from osv.modules import api 2 | import os 3 | 4 | _modules_base = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') 5 | _java_test_commands_file = _modules_base + '/java-tests/test_commands' 6 | 7 | host_arch = os.uname().machine 8 | if host_arch == 'x86_64' and os.getenv('ARCH') == 'aarch64': 9 | if os.path.exists(_java_test_commands_file): 10 | os.remove(_java_test_commands_file) 11 | else: 12 | api.require('java-tests') 13 | 14 | api.require('dl_tests') 15 | -------------------------------------------------------------------------------- /modules/tests/mpm/package.yaml: -------------------------------------------------------------------------------- 1 | name: osv.unit-tests 2 | title: OSv Unit Tests 3 | require: 4 | - osv.openjdk8-from-host 5 | - osv.common-tests 6 | -------------------------------------------------------------------------------- /modules/tests/usr.manifest.skel: -------------------------------------------------------------------------------- 1 | /testrunner.so: ./tests/testrunner.so 2 | /usr/share/zoneinfo/America/**: /usr/share/zoneinfo/America/** 3 | /usr/share/zoneinfo/Europe/**: /usr/share/zoneinfo/Europe/** 4 | /usr/share/zoneinfo/Pacific/**: /usr/share/zoneinfo/Pacific/** 5 | /usr/share/zoneinfo/Asia/**: /usr/share/zoneinfo/Asia/** 6 | -------------------------------------------------------------------------------- /modules/uush/bootfs.manifest: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /tools/uush.so: tools/uush/uush.so 3 | /ls.so: tools/uush/ls.so 4 | /mkdir.so: tools/uush/mkdir.so 5 | /tools/tst-hello.so: tests/tst-hello.so 6 | -------------------------------------------------------------------------------- /modules/uush/module.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2014 Huawei Technologies Duesseldorf GmbH 3 | # 4 | # This work is open source software, licensed under the terms of the 5 | # BSD license as described in the LICENSE file in the top-level directory. 6 | # 7 | 8 | from osv.modules import api 9 | 10 | default = api.run('/tools/uush.so') 11 | -------------------------------------------------------------------------------- /modules/zfs-tools/usr.manifest: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /zpool.so: zpool.so 3 | /zfs.so: zfs.so 4 | /libzfs.so: libzfs.so 5 | /libuutil.so: libuutil.so 6 | -------------------------------------------------------------------------------- /modules/zfs/usr.manifest: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /usr/lib/fs/libsolaris.so: libsolaris.so 3 | -------------------------------------------------------------------------------- /musl: -------------------------------------------------------------------------------- 1 | musl_1.1.24/ -------------------------------------------------------------------------------- /scripts/aws/instance-parameters.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ParameterKey": "pVpcId", 4 | "ParameterValue": "VPC_ID" 5 | }, 6 | { 7 | "ParameterKey": "pSubnetId", 8 | "ParameterValue": "SUBNET_ID" 9 | }, 10 | { 11 | "ParameterKey": "pInstanceName", 12 | "ParameterValue": "INSTANCE_NAME" 13 | }, 14 | { 15 | "ParameterKey": "pInstanceType", 16 | "ParameterValue": "INSTANCE_TYPE" 17 | }, 18 | { 19 | "ParameterKey": "pImageId", 20 | "ParameterValue": "AMI_ID" 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /scripts/disk.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/scripts/disk.bin -------------------------------------------------------------------------------- /scripts/gen-gce-tarball.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | origin_img=usr.img 4 | gce_img=disk.raw 5 | gce_tarball=osv.tar.gz 6 | dir=build/release 7 | cd $dir 8 | rm -f $gce_img $gce_tarball 9 | qemu-img convert $origin_img -O raw $gce_img 10 | tar -Szcf $gce_tarball $gce_img 11 | cd ../.. 12 | 13 | echo "$PWD/$dir/$gce_tarball is created" 14 | -------------------------------------------------------------------------------- /scripts/mkromfs.sh: -------------------------------------------------------------------------------- 1 | 2 | set +x 3 | 4 | if [ ! -n "`which genromfs`" ]; then 5 | echo "genromfs binary not found." >&2 6 | exit 1 7 | fi 8 | 9 | rm -rf ${BUILDDIR} 10 | mkdir -p ${BUILDDIR} 11 | 12 | sed \ 13 | -e "s#GCCBASE#${GCCBASE}#" \ 14 | -e "s#JDKBASE#${JDKBASE}#" \ 15 | -e "s#MISCBASE#${MISCBASE}#" \ 16 | < ../../usr.manifest | \ 17 | while read to from; do 18 | mkdir -p ${BUILDDIR}/`dirname ${to}` 19 | cp ${from} ${BUILDDIR}/${to} 20 | done 21 | 22 | genromfs -f ${IMAGE} -d ${BUILDDIR} 23 | -------------------------------------------------------------------------------- /scripts/osv-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | GITDIR=$(dirname $0)/../.git 4 | git --git-dir $GITDIR describe --tags --match 'v[0-9]*' 5 | -------------------------------------------------------------------------------- /scripts/osv/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/scripts/osv/__init__.py -------------------------------------------------------------------------------- /scripts/osv/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/scripts/osv/modules/__init__.py -------------------------------------------------------------------------------- /scripts/post-processing/scheduler/histo.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import numpy as np 3 | import matplotlib.pyplot as plt 4 | 5 | lines = file(sys.argv[1], "rt").readlines() 6 | s = map(lambda x: int(x.strip("\n")), lines) 7 | 8 | avg = np.mean(s) 9 | cnt = len(s) 10 | 11 | print "%s avg=%d(us) cnt=%d" % (sys.argv[1], avg, cnt) 12 | 13 | plt.hist(s, bins=60) 14 | plt.show() 15 | -------------------------------------------------------------------------------- /scripts/prof.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/scripts/prof.py -------------------------------------------------------------------------------- /scripts/qemu-ifup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | brctl stp $OSV_BRIDGE off 4 | brctl addif $OSV_BRIDGE $1 5 | ifconfig $1 up 6 | -------------------------------------------------------------------------------- /scripts/release-s3: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | version=$(`dirname $0`/osv-version.sh) 6 | 7 | make -j8 clean 8 | make -j8 external 9 | make -j8 all 10 | 11 | image=build/release/usr.img 12 | 13 | url=s3://downloads.osv.io/qemu/osv-$version.qcow2 14 | 15 | s3cmd put $image $url 16 | 17 | s3cmd setacl $url --acl-public 18 | 19 | echo "OSv $version is now available for download at:" 20 | echo "" 21 | echo "http://downloads.osv.io.s3-website-us-east-1.amazonaws.com/qemu/osv-$version.qcow2" 22 | -------------------------------------------------------------------------------- /scripts/remove_dnsmasq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -ne 1 ]; then 4 | echo "Usage: $0 " 5 | echo "Deletes DNSmasq configuration file" 6 | exit 1 7 | fi 8 | 9 | DEV=$1 10 | sudo rm -rf /var/lib/dnsmasq/$DEV 11 | sudo rm -rf /etc/dnsmasq.d/$DEV.conf 12 | -------------------------------------------------------------------------------- /scripts/restore_iptables.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FILE="/tmp/osv_iptables.rules.old" 4 | 5 | if [ -f "$FILE" ]; then 6 | sudo iptables-restore < "$FILE" 7 | sudo rm "$FILE" 8 | fi 9 | sudo sh -c "echo 0 > /proc/sys/net/ipv4/ip_forward" 10 | -------------------------------------------------------------------------------- /scripts/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/scripts/tests/__init__.py -------------------------------------------------------------------------------- /scripts/upload-capstan-release: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | s3cmd sync -P build/capstan/ s3://osv.capstan/ 4 | -------------------------------------------------------------------------------- /scripts/upload-cli: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd modules/cli/ && make rpm 3 | cd ../../ 4 | s3cmd put modules/cli/rpmbuild/RPMS/x86_64/osv-cli-1.0-1.fc20.x86_64.rpm s3://downloads.osv.io/osv-cli/ 5 | -------------------------------------------------------------------------------- /scripts/upload-gce-release: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | version=$(scripts/osv-version.sh) 4 | 5 | function upload { 6 | module=$1 7 | gsutil cp -a public-read build/capstan/cloudius/$module/$module.gce.tar.gz gs://osv/$version/$module.gce.tar.gz 8 | } 9 | 10 | upload "osv" 11 | upload "osv-base" 12 | upload "osv-cassandra" 13 | upload "osv-iperf" 14 | upload "osv-memcached-opt" 15 | upload "osv-openjdk" 16 | upload "osv-openjdk8" 17 | upload "osv-tomcat" 18 | -------------------------------------------------------------------------------- /scripts/upload-standalone-release: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | images=build/standalone/ 4 | 5 | if [ ! -d "$images" ]; then 6 | echo "error: $images directory does not exist." 7 | exit 1 8 | fi 9 | 10 | s3cmd sync -P $images s3://downloads.osv.io 11 | -------------------------------------------------------------------------------- /static/etc/fstab: -------------------------------------------------------------------------------- 1 | /dev/vblk0.1 / zfs defaults 0 0 2 | none /dev devfs defaults 0 0 3 | none /proc procfs defaults 0 0 4 | none /sys sysfs defaults 0 0 5 | -------------------------------------------------------------------------------- /static/etc/fstab_rofs: -------------------------------------------------------------------------------- 1 | /dev/vblk0.1 / rofs defaults 0 0 2 | none /dev devfs defaults 0 0 3 | none /proc procfs defaults 0 0 4 | none /sys sysfs defaults 0 0 5 | none /tmp ramfs defaults 0 0 6 | -------------------------------------------------------------------------------- /static/etc/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost osv.local 2 | -------------------------------------------------------------------------------- /tests/bench/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/bench/com/cloudiussystems/bench/Benchmark.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | package com.cloudiussystems.bench; 9 | 10 | interface Benchmark { 11 | 12 | String getName(); 13 | void run(int iterations) throws Exception; 14 | 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/bench/com/cloudiussystems/test/ClassWithAssertion.java: -------------------------------------------------------------------------------- 1 | package com.cloudiussystems.test; 2 | 3 | /* 4 | * Copyright (C) 2013 Cloudius Systems, Ltd. 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | class ClassWithAssertion { 10 | static boolean assertExecuted; 11 | 12 | static { 13 | //noinspection AssertWithSideEffects,ConstantConditions 14 | assert assertExecuted = true; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/bench/com/cloudiussystems/test/ClassWithAssertion2.java: -------------------------------------------------------------------------------- 1 | package com.cloudiussystems.test; 2 | 3 | /* 4 | * Copyright (C) 2013 Cloudius Systems, Ltd. 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | public class ClassWithAssertion2 { 10 | static boolean assertExecuted; 11 | 12 | static { 13 | //noinspection AssertWithSideEffects,ConstantConditions 14 | assert assertExecuted = true; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tests/bench/com/cloudiussystems/test/ClassWithAssertion3.java: -------------------------------------------------------------------------------- 1 | package com.cloudiussystems.test; 2 | 3 | /* 4 | * Copyright (C) 2013 Cloudius Systems, Ltd. 5 | * 6 | * This work is open source software, licensed under the terms of the 7 | * BSD license as described in the LICENSE file in the top-level directory. 8 | */ 9 | public class ClassWithAssertion3 { 10 | static boolean assertExecuted; 11 | 12 | static { 13 | //noinspection AssertWithSideEffects,ConstantConditions 14 | assert assertExecuted = true; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tests/bench/test.txt: -------------------------------------------------------------------------------- 1 | abc -------------------------------------------------------------------------------- /tests/hello/Hello.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | 9 | public class Hello { 10 | 11 | public static void main(String[] args) { 12 | System.out.println("Hello, world."); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /tests/lib-circular-reloc1.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Reliable System Software, Technische Universität Braunschweig. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | extern void called_from_a(void); 11 | 12 | void 13 | called_from_b(void) 14 | { 15 | puts(__func__); 16 | } 17 | 18 | void 19 | func_a(void) 20 | { 21 | printf("%p\n", &called_from_a); 22 | called_from_a(); 23 | } 24 | -------------------------------------------------------------------------------- /tests/lib-circular-reloc2.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Reliable System Software, Technische Universität Braunschweig. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | extern void called_from_b(void); 11 | 12 | void 13 | called_from_a(void) 14 | { 15 | puts(__func__); 16 | } 17 | 18 | void 19 | func_b(void) 20 | { 21 | printf("%p\n", &called_from_b); 22 | called_from_b(); 23 | } 24 | -------------------------------------------------------------------------------- /tests/lib-misc-tls.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Waldemar Kozaczuk 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | __thread int var_lib_tls; 9 | 10 | extern "C" 11 | void external_library(int N) 12 | { 13 | for (register int i = 0; i < N; i++) { 14 | // To force gcc to not optimize this loop away 15 | asm volatile("" : : : "memory"); 16 | ++var_lib_tls; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/misc-panic.cc: -------------------------------------------------------------------------------- 1 | /* Make OSv crash to test the panic drivers 2 | * 3 | * Copyright (C) 2013 Nodalink, SARL. 4 | * 5 | * This work is open source software, licensed under the terms of the 6 | * BSD license as described in the LICENSE file in the top-level directory. 7 | */ 8 | int main(int argc, char *argv[]) 9 | { 10 | char *ptr = nullptr; 11 | *ptr = 'A'; 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /tests/misc-printf.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | for (int y = 0; y < 1000; y++) { 13 | for (int x = 0; x < 60; x++) { 14 | printf("%c", '0' + x + y % 20); 15 | } 16 | printf("\n"); 17 | } 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /tests/payload-env.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | setenv("FOO", "BAR", 1); 6 | 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /tests/payload-merge-env.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int main(int argc, char **argv) 6 | { 7 | char *first = getenv("FIRST"); 8 | char *second = getenv("SECOND"); 9 | char *third = getenv("THIRD"); 10 | 11 | if (std::string(first) != "LIBELLULE") { 12 | return 1; 13 | } 14 | 15 | if (std::string(second) != "MOUCHE") { 16 | return 1; 17 | } 18 | 19 | if (std::string(third) != "COCCINELLE") { 20 | return 1; 21 | } 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /tests/payload-namespace.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static int global = 0; 5 | 6 | int main(int argc, char **argv) 7 | { 8 | if (global) { 9 | return 1; 10 | } 11 | 12 | global = 1; 13 | 14 | std::this_thread::sleep_for(std::chrono::seconds(2)); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /tests/tst-dns-resolver.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudius-systems/osv/d86de93202fa58e9b99a228f901ef7b7fc17aba1/tests/tst-dns-resolver.cc -------------------------------------------------------------------------------- /tests/tst-elf-circular-reloc.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 Reliable System Software, Technische Universität Braunschweig. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | extern void func_a(); 9 | extern void func_b(); 10 | 11 | int 12 | main(void) 13 | { 14 | func_a(); 15 | func_b(); 16 | } 17 | -------------------------------------------------------------------------------- /tests/tst-hello.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Cloudius Systems, Ltd. 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | 8 | #include 9 | 10 | int main(int ac, char** av) 11 | { 12 | std::cout << "Hello World\n"; 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /tests/tst-non-fpic.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Waldemar Kozaczuk 3 | * 4 | * This work is open source software, licensed under the terms of the 5 | * BSD license as described in the LICENSE file in the top-level directory. 6 | */ 7 | #include 8 | 9 | int main() { 10 | printf("Hello\n"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/tst-non-pie.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(){ 4 | printf("Hello from C code\n"); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /usr.manifest.skel: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /libenviron.so: libenviron.so 3 | /tools/mount-fs.so: tools/mount/mount-fs.so 4 | /tools/umount.so: tools/mount/umount.so 5 | /usr/lib/libgcc_s.so.1: %(libgcc_s_dir)s/libgcc_s.so.1 6 | /&/etc/hosts: ../../static/& 7 | /etc/mnttab: ->/proc/mounts 8 | /etc/fstab: fstab 9 | /dev: ../../static 10 | /proc: ../../static 11 | /sys: ../../static 12 | /tmp: ../../static 13 | -------------------------------------------------------------------------------- /usr_ramfs.manifest.skel: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /libenviron.so: libenviron.so 3 | /tools/mount-fs.so: tools/mount/mount-fs.so 4 | /tools/umount.so: tools/mount/umount.so 5 | /usr/lib/libgcc_s.so.1: %(libgcc_s_dir)s/libgcc_s.so.1 6 | /&/etc/hosts: ../../static/& 7 | /etc/mnttab: ->/proc/mounts 8 | /etc/fstab: fstab 9 | /dev: ../../static 10 | /proc: ../../static 11 | /sys: ../../static 12 | /tmp: ../../static 13 | -------------------------------------------------------------------------------- /usr_rofs.manifest.skel: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /libenviron.so: libenviron.so 3 | /tools/mount-fs.so: tools/mount/mount-fs.so 4 | /tools/umount.so: tools/mount/umount.so 5 | /usr/lib/libgcc_s.so.1: %(libgcc_s_dir)s/libgcc_s.so.1 6 | /&/etc/hosts: ../../static/& 7 | /etc/mnttab: ->/proc/mounts 8 | /etc/fstab: fstab 9 | /dev: ../../static 10 | /proc: ../../static 11 | /sys: ../../static 12 | /tmp: ../../static 13 | /data: ../../static 14 | -------------------------------------------------------------------------------- /zfs_builder_bootfs.S: -------------------------------------------------------------------------------- 1 | .pushsection .data 2 | .global bootfs_start 3 | .hidden bootfs_start 4 | bootfs_start: 5 | .incbin "zfs_builder_bootfs.bin" 6 | .popsection 7 | -------------------------------------------------------------------------------- /zfs_builder_bootfs.manifest.skel: -------------------------------------------------------------------------------- 1 | [manifest] 2 | /libuutil.so: libuutil.so 3 | /zpool.so: zpool.so 4 | /usr/lib/fs/libsolaris.so: libsolaris.so 5 | /libzfs.so: libzfs.so 6 | /zfs.so: zfs.so 7 | /tools/mkfs.so: tools/mkfs/mkfs.so 8 | /tools/cpiod.so: tools/cpiod/cpiod.so 9 | /usr/lib/libgcc_s.so.1: %(libgcc_s_dir)s/libgcc_s.so.1 10 | --------------------------------------------------------------------------------