Skip to content
Snippets Groups Projects
  1. Oct 24, 2013
  2. Oct 23, 2013
  3. Oct 22, 2013
  4. Oct 16, 2013
    • Avi Kivity's avatar
      paths.h: fix _PATH_MNTTAB · 4a487e2c
      Avi Kivity authored
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      4a487e2c
    • Avi Kivity's avatar
      libc: define mbstate_t as __mbstate_t · 7918cea9
      Avi Kivity authored
      
      std::streambuf<char> is defined as an "extern template", which means it is
      instantiated in the library, not at the point-of-use, in order to reduce
      object size and compilation time.
      
      One of its member functions, std::basic_streambuf::seekpos(...) has a
      parameter whose type depends on mbstate_t; this embeds the type name into
      the mangled function name.
      
      On Linux, mbstate_t is a typedef for __mbstate_t, so the latter type name
      is embedded into the mangled function name.  On osv, there is no such typedef,
      so mbstate_t is embedded.  This causes lookup to fail when loading a shared
      object that uses streambufs.
      
      Fix by defining mbstate_t in the same way as glibc.
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      7918cea9
  5. Oct 15, 2013
  6. Oct 14, 2013
    • Nadav Har'El's avatar
      Add osv::run function · e15b3322
      Nadav Har'El authored
      
      Add a convenience function, osv::run(), to run an ELF executable.
      
      The patch includes extensive Doxygen documentation for the new function,
      also detailing the how osv::run() differs from the familiar Linux
      functions like exec(2).
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      e15b3322
    • Pekka Enberg's avatar
      mmu: Fix mincore() for non-resident mmaps · 7d532448
      Pekka Enberg authored
      
      Fix mincore() to follow Linux ABI and return ENOMEM only if (part of
      the) memory range is unmapped even if it's not resident.  This is needed
      for mincore() to work with demand paged mmaps.
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      7d532448
    • Nadav Har'El's avatar
      Rework elf::program's API · ba3e3efa
      Nadav Har'El authored
      
      This is patch v2, incorporating most of the comments from the previous round.
      
      Solves issue #47:
      
      elf::program's API - add_object() and remove_object() was problematic in
      two respects:
      
      1. It did not do reference-counting on the loaded object, so if add_object()
         was done 5 times, a single remove_object() would unmap the object and
        its 4 other users will crash.
      
      2. It is un-C++-like.
      
      This patch replaces these two functions by a single function get_library():
      
        std::shared_ptr<elf::object>
         get_library(std::string lib, std::vector<std::string> extra_path = {});
      
      get_library() returns a shared_ptr, which is reference counting and does
      proper C++-style RAII. For example in the code:
      
      	auto lib = elf::get_program()->get_library(path);
      	auto main = lib->lookup<int (int, char**)>("main");
      	int rc = main(argc, argv);
      
      once lib out of scope, the reference count of the elf::object automatically
      goes down, and if nobody else holds another shared-pointer to the same
      library, the object is destroyed (causing the shared library to be unloaded).
      
      This patch also documents, with Doxygen, all the functions it touches.
      
      IMPORTANT NOTE: This reference count is completely unrelated to the issue
      of concurrent use of dlopen()/dlclose()/dl_iterate_phdr(), which is still
      buggy and we need to fix (I have a patch for that, but it's too long to fit
      in the margin).
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      ba3e3efa
  7. Oct 13, 2013
  8. Oct 10, 2013
  9. Oct 09, 2013
  10. Oct 08, 2013
    • Nadav Har'El's avatar
      Use same version in <linux/version.h> and uname() · e2554eaf
      Nadav Har'El authored
      
      We had a different Linux version compiled into uname() (3.7.0) than
      we had compiled into other code (via <linux/version.h>).
      
      This patch makes them both pretend to be 3.7.0 - arbitrarily chosen
      as the current Linux version at the time OSv was created. The new code
      verifies with a static assertion that both files contain the same version,
      so if they diverge, uname.c will fail compilation.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      e2554eaf
  11. Oct 07, 2013
    • Nadav Har'El's avatar
      Start using doxygen for OSv's API documention · bc420c7a
      Nadav Har'El authored
      This patch begins to document OSv's native (non-Linux-compatible) C++ APIs
      using Doxygen. With doxygen, functions, classes, and other APIs are
      documented using comments inside the source code, similarly to the way
      Javadoc is used in the Java world.
      
      After this patch, running "doxygen" generates the documentation in HTML
      form (and also ugly ones in LaTeX...) in the "doxyout" directory.
      After running "doxygen" in the OSv top-level directory, open your browser to
      file://.../doxyout/html/index.html
      
       to view this documentation.
      
      This patch adds a doxygen configuration file, "Doxyfile", and documents
      three functions in the osv namespace: osv::halt(), osv::poweroff(),
      osv::halt().
      
      The format of the resulting documentation is not perfect, but it's not
      as bad as I feared, and also the documentation doesn't uglify the code
      too much (it mainly impacts the header files), so I now believe it will
      better for us than writing man pages (an avenue which I explored
      previously).
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      bc420c7a
  12. Oct 05, 2013
  13. Oct 03, 2013
  14. Sep 30, 2013
Loading