apianti Posted March 13, 2020 Share Posted March 13, 2020 Because conditional statements aren't allowed in .inf files and OpensslLib is used for secure boot. So if enabled then the .dsc picks the real library or the null one with nothing that will be stripped. Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 14 hours ago, Jief_Machak said: Looking at the display bug, I realise that DBG("%s\n", string) with string being a CHAR16* doesn't work. I traced into the edk sources and it's just can't. AsciiVSPrint output in utf8 and there is no conversion. To workaround that, I've committed a XString (no W). To convert a Lstring to utf8, Just do XString(Lstring).c ( .c is to get a pointer to give to DBG or other). I see a glitch with boot-args in Options menu. It is probably caused by AsciiSPrint(gSettings.BootArgs, 255, "%s ", InputItems.SValue); Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 13, 2020 Author Share Posted March 13, 2020 Just now, Slice said: I see a glitch with boot-args in Options menu. It is probably caused by AsciiSPrint(gSettings.BootArgs, 255, "%s ", InputItems.SValue); Yes, I've noticed Ascii...Print cannot convert UTF16 to UTF8. Quick fix : "AsciiSPrint(gSettings.BootArgs, 255, "%a ", XString(InputItems.SValue).c);" Link to comment Share on other sites More sharing options...
apianti Posted March 13, 2020 Share Posted March 13, 2020 43 minutes ago, Jief_Machak said: Yes, I've noticed Ascii...Print cannot convert UTF16 to UTF8. Quick fix : "AsciiSPrint(gSettings.BootArgs, 255, "%a ", XString(InputItems.SValue).c);" How could this be true? The EDK2 functions have distinct %s and %a and it worked previously when used in c, the line is exactly the same, the only thing that changed was the string type...? Also it converts to ASCII, not UTF-8... Which is what is needed there for the boot arguments. The UEFI specification only uses ASCII and UCS-2. I see some problems with code is more likely what is the issue.... Like why not just get the c string from the value, how are you ensuring it is coerced to the correct type when passed? Why are you using a public variable for your string storage? I can create this string, set the c member = nullptr and then you have memory leak, or I could possibly exploit your code to inject my own code... Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 13, 2020 Author Share Posted March 13, 2020 I maybe be wrong, but for what I saw, Ascii...Print function output Ascii, we agree. But %s format in Ascii...Print expect a Ascii string, not an UCS-2, like unicode...print function. We didn't touch anything in Print function. I may compiled on old version to check. Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 New hang with latest commit happens at the line 50:544 0:047 === [ StartLoader ] ======================================= 52:480 1:936 Finally: ExternalClock=212MHz BusSpeed=211353kHz CPUFreq=3593MHz PIS: hw.busfrequency=848000000Hz Those values wrong. DBG("Finally: ExternalClock=%ldMHz BusSpeed=%ldkHz CPUFreq=%ldMHz", DivU64x32(gCPUStructure.ExternalClock + kilo - 1, kilo), DivU64x32(gCPUStructure.FSBFrequency + kilo - 1, kilo), gCPUStructure.MaxSpeed); if (gSettings.QPI) { DBG(" QPI: hw.busfrequency=%ldHz\n", MultU64x32(gSettings.QPI, Mega)); } else { // to match the value of hw.busfrequency in the terminal DBG(" PIS: hw.busfrequency=%ldHz\n", MultU64x32(LShiftU64(DivU64x32(gCPUStructure.ExternalClock + kilo - 1, kilo), 2), Mega)); } We see no next DBG. It means hang at DivU64x32() or in the next MultU64x32() Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 13, 2020 Author Share Posted March 13, 2020 No crash here. I got : 171:773 0:001 === [ StartLoader ] ======================================= 171:779 0:005 Finally: ExternalClock=703MHz BusSpeed=702010kHz CPUFreq=2808MHz PIS: hw.busfrequency=2812000000Hz Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 Yes, I missed \n at the previous DBG. So my crash is later. I am searching... Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 13, 2020 Author Share Posted March 13, 2020 Just now, Slice said: I am searching... Have you tried my gdb_launch ? So much easier to catch a crash... Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 Hang at deleteFont. It is my mistake. 9 minutes ago, Jief_Machak said: Have you tried my gdb_launch ? So much easier to catch a crash... It is too hard to install. Anyway I am at windows now. Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 13, 2020 Author Share Posted March 13, 2020 What about NSVGfont become a class and NSVGfontChain become an XArrayObj ? Memory problem will solve themselves... Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 4 minutes ago, Jief_Machak said: What about NSVGfont become a class and NSVGfontChain become an XArrayObj ? Memory problem will solve themselves... Yes, but the whole nanosvg should be rewritten. Not now. Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 OK, resolved. Link to comment Share on other sites More sharing options...
apianti Posted March 13, 2020 Share Posted March 13, 2020 1 hour ago, Slice said: New hang with latest commit happens at the line 50:544 0:047 === [ StartLoader ] ======================================= 52:480 1:936 Finally: ExternalClock=212MHz BusSpeed=211353kHz CPUFreq=3593MHz PIS: hw.busfrequency=848000000Hz Those values wrong. 55 minutes ago, Jief_Machak said: No crash here. I got : 171:773 0:001 === [ StartLoader ] ======================================= 171:779 0:005 Finally: ExternalClock=703MHz BusSpeed=702010kHz CPUFreq=2808MHz PIS: hw.busfrequency=2812000000Hz Looks like something is wrong there though as that can't be correct unless you have some crazy machine that has 703MHz clock.... Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 13, 2020 Author Share Posted March 13, 2020 Just now, apianti said: 703MHz clock.... Is Qemu supposed to report the correct value ? Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 Yes, QEMU is crazy. Link to comment Share on other sites More sharing options...
apianti Posted March 13, 2020 Share Posted March 13, 2020 (edited) Mine does... but I use OVMF that I made myself........ EDIT: Also, didn't realize you were using qemu. Edited March 13, 2020 by apianti Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 At home I used QEMU 2 in macOS with SeaBios. At work I use QEMU 3 in Windows with my OVMF. Both reported strange frequencies, strange CPU multipliers. There is a setting in Clover "QEMU=true" but I can't change the value reported by MSR 0x198 - max CPU multiplier. Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 1 hour ago, Slice said: OK, resolved. Not resolved... Link to comment Share on other sites More sharing options...
mhaeuser Posted March 13, 2020 Share Posted March 13, 2020 2 hours ago, Jief_Machak said: I maybe be wrong, but for what I saw, Ascii...Print function output Ascii, we agree. But %s format in Ascii...Print expect a Ascii string, not an UCS-2, like unicode...print function. We didn't touch anything in Print function. I may compiled on old version to check. Print argument semantics are of course unaffected by the family of functions used. "%a" is ASCII, "%s" is UCS-2, always. It makes no sense to make argument interpretation different based on the destination type anyway. Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 2 hours ago, Slice said: Not resolved... Ok, finally resolved. It was an old bug with double fonts cause double freepool of same pointer. Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 And yes, now HelpMenu works with russian language in VS compilation. Thanks! Link to comment Share on other sites More sharing options...
Jief_Machak Posted March 13, 2020 Author Share Posted March 13, 2020 Noticing we were defining memcpy, memset, strcpy etc. in different files and sometimes headers, having some clash with "already defined" or "undefined", I've started a "posix" folder in Platform. That way, standard c function are available to all files. I took the occasion to supply new implementation I found that speeds up A LOT the loading time of an SVG theme. @Slice try it, there is a big difference. It went from 20 seconds to 2/3 ! Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 There is also my commit to not load and parse svg font DragonIsComing 4 times as before. Parse is heavy operation! Link to comment Share on other sites More sharing options...
Slice Posted March 13, 2020 Share Posted March 13, 2020 Did you forget something? d:\projects\cloverbootloader\refit_uefi\platform\posix\stddef.h(5): error C2371: size_t: Link to comment Share on other sites More sharing options...
Recommended Posts