Giter Club home page Giter Club logo

Comments (6)

ptitSeb avatar ptitSeb commented on July 24, 2024

Thanks,

Yeah, sure (you should have received the address in your email notifications).

Emulation is still a bit slow, I hope your project does not require too much horsepower.

from box86.

AndreRH avatar AndreRH commented on July 24, 2024

Hangover Developer Here, reusing the thread. As we implemented your initial idea we could at least share some implementation details as we have similar proplems like emulation,varargs, wrapping. On Android we could also use gl4es, that would be one thing I'd like to look at. Note that we are arm64 only right now, working on ppc64le at the moment

from box86.

ptitSeb avatar ptitSeb commented on July 24, 2024

Hi @AndreRH .
Yes Box86 and Hangover seems to share a lot of the base ideas.
I'm stuck on 32 bits for now (that the hardware I have the most, and the ARM architecture I know best). I wanted to start on Wine, but ... wine is quite huge and the learning curve to stat messing with such low level stuff is steep. But yeah, I guess we have similar issues with the wrappers (and the varargs!).
Varargs in particular are tricky when wrapping from x86 to ARM 32bits because double needs alignments to a 64bits address, where x86 does not, So I needed to write some re-alignement function for printf and friends.
Not sure what if ARM64 has such constraints (or if the constraint is different on x86_64).

About emulation, I use my own emulator (still buggy for now). It's only an interpretor for now, no JIT, but that will come later. I didn't wanted to use QEMU to keep things simple, but the JIT will complicate everything anyway, so not sure that was the good choice.

How is the compatibility for now with Hangover? (and you know were are the sources of incompatibilities?)

from box86.

AndreRH avatar AndreRH commented on July 24, 2024

You can see Anno 1602 running on my smartphone here: https://peertube.mastodon.host/videos/watch/8d498f3c-407b-4344-84d7-b9f37c0087d7
Functions sometimes only access memory in certain conditions, so the passed pointer doesn't need to be valid, so you have to duplicate some logic which makes it hard to automate wrapper generation

from box86.

ptitSeb avatar ptitSeb commented on July 24, 2024

Nice video. Difficult to compare performances, I don't have Anno 1602, and Notepad++ doesn't run natively on Linux.
I'm not sure I understand your point about passed pointer and automatic wrapper generation.
My understanding was that Wine had all windows api functions described in IDL, to translate Windows Function Call convention to Linux Function Call? Or is it not working like that (I never took the time to investigate)? I thought that using that IDL description to generate wrapper (putting asside functions that used Callback or strange arguments / return values) would help.
On the linux side, I don't have IDL or anything that describe the functions arguments, so I'm writing the Wrappers by hand (hopefully with used of Macros and a Python script, it's a short process).

from box86.

AndreRH avatar AndreRH commented on July 24, 2024

AFAICT IDLs are only used for COM interfaces, so it's not that easy. Lot's of hand writing involved here, too. Regrading the passed pointer problem: If you need to convert a struct because of differences between host and guest (we also support x86_32 on arm64, but x86_64 also has some cases) and a function parameter points to that struct, the pointer might be invalid if the caller knows the function won't use it, so we need to duplicate logic to know if the pointer gets used. consider a function like this:

void foo(struct convertme *bar, uint8_t flags)
{
if (flags | 0x4000) {printf("done already\n"); return;}
if (bar) printf("some value from the converted struct: %u\n", bar->differentaligned);
}

An applications can call foo(0xdeadbeef, 0x4000); but we must not convert the struct in that case, so we need to check the flags...

Another issue we have is bad qemu performance, it mostly generates bad native code, I have some ideas, but no time to investigate.

from box86.

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.