Maxine-VM icon indicating copy to clipboard operation
Maxine-VM copied to clipboard

Added Windows support to the native part of MaxineVM

Open mihalis341 opened this issue 3 years ago • 4 comments

Added Windows code to com.oracle.max.vm.native while the already existing code for other OSes remains functional. You can check the description of my last commit for additional info. Also, all the additions made regard x86_64 (amd64) ISA only.

mihalis341 avatar Jul 08 '20 21:07 mihalis341

Hi Mihali, thanks for the PR. With this PR does MaxineVM work on Windows or just the native part is compiled?

kotselidis avatar Jul 09 '20 08:07 kotselidis

Hi. Unfortunately, I have still some issues with boot image creation on Windows so i cannot completely test Maxine VM. However, the code added is tested using my own tests and appears to work correctly. Also, maxvm.exe correctly loads maxine function from jvm.dll and attempts to find the boot image in the same directory. I was prompted by @zakkak to make this PR in case someone wants to continue the development for Windows.

mihalis341 avatar Jul 09 '20 09:07 mihalis341

Great, thanks Mihali. Could you please also add the README files with platform compatibility to reflect the state? Also, would it make sense to include your tests also?

kotselidis avatar Jul 09 '20 09:07 kotselidis

Hi. Sorry for the delay but I had some other responsibilities and eventually forgot about it. I added one more commit with updated Status.srt. I also attach an updated version of a report I wrote for @zakkak course 4 months ago. It includes all the steps one should follow in order to reproduce my work (ie. build Maxine VM + image in Windows and run what is runnable). In my last response I mentioned that an image cannot be created yet in Windows, however, this has been resolved in a July commit . I fixed some things in Java code and now a working image gets created successfully. In my report some things get explained regarding the native C code for Windows, however, it is in no way a complete documentation! I suggest someone who wants to continue developing for Windows better inspect my code and read my comments contained in it. The part of the report which describes the current stage is the last 3 pages which describe where a crash happens during the execution of the image file Java code from C (specifically, inside the VMRun() Entry Point) code with no apparent cause. I suspect that maybe some new interceptions are needed to prevent such crashes but I have no clue how to go about it. Regarding the tests I mentioned, I meant that I tested all the Win32 API code I used for the native code (ie. Mutexes, Critical Sections, Threads, Threads Local Storage, Conditions, Memory Mapping etc) completely using C Code. The reason I had to test them is that it was actually my very first time using Win32 API and I needed to know how things work. Unfortunately, I have no Java tests that use my native code.

Regards, Michael

report.pdf

mihalis341 avatar Nov 16 '20 00:11 mihalis341