GithubHelp home page GithubHelp logo

Initial support of Embox OS about bdwgc HOT 8 CLOSED

ivmai avatar ivmai commented on June 10, 2024
Initial support of Embox OS

from bdwgc.

Comments (8)

ivmai avatar ivmai commented on June 10, 2024

The porting difficulties are:

  • how to get main stack base (bottom)
  • how to get main data root(s)

from bdwgc.

ivmai avatar ivmai commented on June 10, 2024

How to build embox/x86 with gctest in qemu (on Ubuntu/x64):

  1. prerequisites: https://github.com/embox/embox-docs/blob/master/ru/embox_quick_start_ru.md
  2. git clone https://github.com/embox/embox.git
  3. cd embox
  4. make confload-x86
  5. (cd download; wget https://mirror.iscas.ac.cn/yocto/mirror/sources/acpica-unix-20210331.tar.gz)
  6. mkdir src/cmds/gctest
  7. (cd src/cmds/gctest; git clone https://github.com/ivmai/bdwgc.git)
  8. vi src/cmds/gctest/Mybuild // see the content below
  9. vi conf/mods.conf // add line: include embox.cmd.gctest
  10. make -j
  11. ./scripts/qemu/auto_qemu

from bdwgc.

ivmai avatar ivmai commented on June 10, 2024

Sample "Mybuild" file for gctest:

package embox.cmd

@AutoCmd
@Cmd(name = "gctest", help="BDWGC tests")

module gctest {
    @IncludePath("$(SRC_DIR)/cmds/gctest/bdwgc/include")
    @Cflags("-D GC_GCJ_SUPPORT")
    @Cflags("-D ENABLE_DISCLAIM")
    source "bdwgc/tests/gctest.c"
    //source "bdwgc/tests/huge.c"
    //source "bdwgc/tests/leak.c"
    //source "bdwgc/tests/middle.c"
    //source "bdwgc/tests/realloc.c"
    //source "bdwgc/tests/smash.c"
    //source "bdwgc/tests/disclaim.c"
    //source "bdwgc/tests/disclaim_bench.c"
    //source "bdwgc/tests/weakmap.c"
    @IncludePath("$(SRC_DIR)/cmds/gctest/bdwgc/include")
    @Cflags("-D GC_GCJ_SUPPORT")
    @Cflags("-D ENABLE_DISCLAIM")
    @Cflags("-D GC_ASSERTIONS")
    source "bdwgc/extra/gc.c"
}

from bdwgc.

ivmai avatar ivmai commented on June 10, 2024

how to get main stack base (bottom)

The portable way is to use pthread_... primitives, but they are not supported in Embox yet, I've created an issue about it - embox/embox#2779

from bdwgc.

ivmai avatar ivmai commented on June 10, 2024

Current status:

  • pthread_attr_getstack() is missing
  • undefined reference to _end, __data_start

from bdwgc.

ivmai avatar ivmai commented on June 10, 2024

The portable way is to use pthread_... primitives, but they are not supported in Embox yet

Use instead, for now:

# include <kernel/thread/thread_stack.h>
...
    pthread_t self = pthread_self();
    void *stack_addr = thread_stack_get(self);
    sb -> mem_base = stack_addr + thread_stack_get_size(self);

from bdwgc.

ivmai avatar ivmai commented on June 10, 2024

undefined reference to __data_start, _end

Use _modules_data_start and _apps_bss_end instead.

Note: this includes data/bss for all compiled-in modules and apps, size >25MB.

from bdwgc.

ivmai avatar ivmai commented on June 10, 2024

Current limitations:

  • No support of ISAs other than x86
  • C++ support was not tested
  • No threads support
  • No memory unmaping to OS
  • No malloc redirection support
  • ALL_INTERIOR_POINTERS mode does not work (leads to out of memory (122MB) in gctest)
  • restart of gctest command (module) leads to crash (because data & bss are not cleared between runs)

from bdwgc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.