Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 Let me fix it and commit. Link to comment Share on other sites More sharing options...
Slice Posted March 4, 2020 Share Posted March 4, 2020 3 minutes ago, Jief_Machak said: You just put back again the "AllocateZeroPool" for allocating objects !!! Please don't : it CAN'T work for objects with virtual method. Of course it crashed. Else memset is generated. 1 minute ago, Jief_Machak said: Let me fix it and commit. OK. But I want you to test the result. Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 Using VS2017 ? Link to comment Share on other sites More sharing options...
Slice Posted March 4, 2020 Share Posted March 4, 2020 6 minutes ago, Jief_Machak said: Using VS2017 ? or clang or gcc53. I got the crash with gcc53. Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 I was asking about the memset. Because at my last commit, it was compiling and running with GCC and CLang. Link to comment Share on other sites More sharing options...
Slice Posted March 4, 2020 Share Posted March 4, 2020 2 minutes ago, Jief_Machak said: I was asking about the memset. Because at my last commit, it was compiling and running with GCC and CLang. Running? I always have a hang at getLEGACY_ENTRY() or with getLOADER_ENTRY() My doubts: MainMenu.Entries[] allocated as REFIT_ABSTRACT_MENU_ENTRY with a sizeof(REFIT_ABSTRACT_MENU_ENTRY) even if operator new used. But LEGACY_ENTRY is larger. To make a superclass big enough there is a method to add empty slots to it. Really I don't know what to do if not revert classes to structures. If you can resolve it for gcc then I will not test with VS. Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 It was working ! Entry are allocate with new. NO SIZEOF. Wait a minute. 2 minutes ago, Slice said: MainMenu.Entries[] allocated as REFIT_ABSTRACT_MENU_ENTRY with a sizeof(REFIT_ABSTRACT_MENU_ENTRY) That is wrong. Must use new WITHOUT a sizeof parameter. Link to comment Share on other sites More sharing options...
apianti Posted March 4, 2020 Share Posted March 4, 2020 (edited) I assume he means that he is allocating an array but it is not allocated properly? I think he means, the size of the allocation is only one REFIT_ABSTRACT_MENU_ENTRY instead of the size for count the array elements. EDIT: In c++ a struct is a class where the scope is public by default, instead of private. Every class (and therefore every struct) is given a default no argument constructor, copy constructor, and assignment operator if they are not defined for the class. Edited March 4, 2020 by apianti Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 Sorry, but it's never the size of REFIT_ABSTRACT_MENU_ENTRY because we never do new REFIT_ABSTRACT_MENU_ENTRY(). Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 Ok, it's working. There is just a XPointer variable uninitialised. Fixing that and commit. Link to comment Share on other sites More sharing options...
apianti Posted March 4, 2020 Share Posted March 4, 2020 He says, even if new operator is used....? So he was trying, I'm guessing though now that he did exactly what you just did, he used new with parentheses instead of specifying the array size . Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 Menu works, except About menu. Debugging... Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 Ok, small confusion in REFIT_MENU_SCREEN ctors... Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 Ok, it's working. Compiling with DEBUG_XCODE5 (DEBUG_XCODE8 is the same). I can get the menus. I didn't try them all. With DEBUG_GCC53, I have an error in grub_fs module ???!! No idea. I'll check VS2017 Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 VS2017 seems to generate memset at new, as you said. I tried to define default ctor. If there is a default ctor, zeroing object memory is not needed. But VS seesm to still generate it... Providing an implementation for memset doesn't work if /GL is used for compilation. So far, I just remove the /GL. I didn't try to launch the efi made by VS... Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 I didn't commit the removal of /GL. Should I ? Link to comment Share on other sites More sharing options...
Slice Posted March 4, 2020 Share Posted March 4, 2020 3 minutes ago, Jief_Machak said: I didn't commit the removal of /GL. Should I ? If it helps... I will check VS tomorrow. Now I am in Mojave with Xcode. Testing... Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 I think I got it. Possible to keep /GL if we add /INCLUDE:memset as an option for the linker. I don't know how to do that from refit.inf I tried "MSFT:*_*_*_SLINK_FLAGS = /INCLUDE:memset". Link to comment Share on other sites More sharing options...
Slice Posted March 4, 2020 Share Posted March 4, 2020 Still not working debug.log finished at menu.run 28:417 0:001 Default boot entry not found 28:418 0:001 DefaultIndex=-1 and MainMenu.Entries.size()=8 I just wonder how can you say it works. Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 Well, I have the menu. I can open submenu with spacebar. Come back and go in about menu... I'll double check. Link to comment Share on other sites More sharing options...
Slice Posted March 4, 2020 Share Posted March 4, 2020 Do you have any legacy entry? Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 Not visible. How do I do that ? Link to comment Share on other sites More sharing options...
Slice Posted March 4, 2020 Share Posted March 4, 2020 Why you set #define CHAR8 unsigned char default in EDK2 is signed char. Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 4, 2020 Author Share Posted March 4, 2020 I have Legacy to true. But I guess no legacy boot. Must I make a MBR drive ? Link to comment Share on other sites More sharing options...
Slice Posted March 4, 2020 Share Posted March 4, 2020 1 minute ago, Jief_Machak said: I have Legacy to true. But I guess no legacy boot. Must I make a MBR drive ? I am testing in QEMU and I have MBR image. Link to comment Share on other sites More sharing options...
Recommended Posts