-
Notifications
You must be signed in to change notification settings - Fork 716
A set of various fixes and additions #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| msg(usprintf("%s: invalid descriptor master base %02Xh", __FUNCTION__, descriptorMap->MasterBase)); | ||
| UINT32 masterBase = descriptorMap->MasterBase; | ||
| if (masterBase > FLASH_DESCRIPTOR_MAX_BASE) | ||
| masterBase = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a test file and making the 8 into non-magical value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not remember in details, what this about for, but I remember I've experimented with FF-ing maximum in Flash Descriptor, and when masterBase FF-ed, hardware continues to startup normally.
|
Let's discuss the changes 1 by 1. CC @vit9696 for his input. |
NACK, unclear what problem is getting fixed here, other than "I copy some values from UEFITool and can't paste it into other tools because they don't start with |
Alternative solution to this is adoption of the upcoming QHexView 5.1 that uses direct render. Please open a separate issue with screenshots showing the mentioned misalignment and the fact that your changes fixes it. Notionally ACK when screenshots are provided. UPD: fixed by f64ba09 |
NACK as not needed at the current stage of development. |
NACK for now. The need of this is debatable. coreboot images do not confirm to UEFI PI specification, and UEFITool is a tool to parse and edit images confirming to UEFI PI specification. However, we already moved away from the spec by adding support for Intel descriptor (editing of which had not been supported nor planned though, same is true for ME and NVRAM that are getting parsed in NE), there's currently work on adding AMD descriptor support, and an issue regarding Qualcomm images. |
Also debatable, but OK, I buy it, ACK. UPD: done. |
Sample image(s) or did not happen. Also, this needs a separate issue. TBH, I've seen this bug already, once, and planned to fix it, but haven't found an image and forgot about it. Glad it resurfaced. Notionally ACK if test images are provided. |
NACK, the input of UEFITool is a binary confirming with UEFI PI specification, or a wrapper around such an image. If the input doesn't have FFS volumes - it's invalid, no need to parse anything in it further, files or not. |
NACK for now, as Free Space is an item deliberately made uneditable and guaranteed to be free, otherwise it would be called Padding and has a type. There's no need to view any of it (as it's empty) and no need to save it (obtaining an empty file of a given size is a trivial one-liner). We can return to this when we move Hex Preview Window into the main UI, then viewing Free Space item will become necessary. |
ACK, UPD: done. |
ACK if it passively saves the paths without adding anything to the UI, NACK otherwise. |
Considered implementing that way back in 2014, bailed because the list was ugly on macOS back then. Maybe it's less ugly now, will check. Notionally ACK. |
NACK, unclear what problem this resolves right now. UEFITool is currently not something that support editing an image on the fly, it's a batch processor that takes a file and outputs a file (0.2x that is, NE doesn't output anything yet). We can return to adding that when we add the new builder. |
NACK, Abso-FUCKING-lutely not, excuse me my expression here. We will start doing memory optimization when we are pressed by it, and having copies of all objects handy and separated from one another is an actual design decision way back in UEFITool 0.3.1 times, that I'm not ready to negotiate. We are trading memory consumption (memory is super-cheap and is always a plenty) with simplicity and security (both are super-expensive in practice), and this tradeoff only needs to be made when an actual memory/performance pressure is observed. So far there were zero complaints. |
NACK, as icons in the tree are ugly in different OSes, and we don't need it without the previous change. |
ACK |
Yes, "I copy some values from UEFITool and can't paste it into other tools because they don't start with |
So, after all, it was not only about coreboot, it was only one example of several, why it was needed. Okay, I repeat. If I open Intel FSP (I have many variants of the latest platform FSP, and rebased too), I know for sure that all of its components of those TE/PE are agreed in advance, so that the base CPU address is unambiguously calculated. Similarly with other pieces of BIOS, where the code executed "in" the ROM. Forgot about coreboot. If I am (re)constructing (when write and editing will resurrected) some piece of BIOS and base CPU address is "not detected because we do not want do this in alternative ways", then any TE/PE moving will rebase it to 0 or not rebase at all.That's why I wanted to add cases when CPU address is normally detected. |
Yes, it saves the paths silently/transparently. |
|
Useful images for Birch Stream platform:
|
|
I generally agree with @NikolajSchlej on the decisions, but to review this we really need separate PRs. Good to have it all in one for reference, but to start merging this we would rather go on one-by-one basis.
My Hex Editor offers this: So I can copy and paste basically anything. I do not really have a problem with UEFITool copied contents, but perhaps we can indeed switch to
I think this is about editing image and making sure the changes are correct. I believe what we need here is CMD+R / F5 to work. I.e. a way to reload currently opened image. This is a rather natural thing in browsers / file editors. |
|
I do not intend to merge the whole thing, but I promised to @Ykidia via email to organize splitting this effort into smaller chunks myself, so we can continue discussion of everything that is currently NACK here for now. |
|
@Ykidia, it looks like several changes are not included in the pull request, i.e. everything regarding UI additions, settings and so on. Those should be in |
1) Added special subspecifier "h" for specifier "X" (hex values print), added corresponding menu option and application setting to UEFITool. 2) Added some more analysis to raw files and sections: raw files can (or can not) contain sections, raw sections can contain NVAR storage or PE/TE. 3) Improved CPU base address detection and propagation. 4) Improved FIT recognition. 5) Small changes to Flash Descriptor parsing to get more cases for valid "Intel image". To get rid of cases when "Intel image" is already in tree but with parse error because of which "UEFI image" appears. 6) Added parsing of individual UEFI-files (these can be trimmed from UEFI-volume), displaying it as "UEFI volume part". 7) Added possibility to view/save contents of elements "Free volume space", "Free space" and such, because these can be non-empty. 8) Added storage in settings of the following paths: open image file, save image file, open GUIDs file. 9) Added last opened files list. 10) Added permanent opened file name string to the end of the status bar. 11) Added opened file changes tracking: if the file was modified in other program while it is opened in UEFITool, there are 3 ways to act: a) ignore changes (but mark file path displayed in the status bar with italic font); b) ask user to reopen or ignore (if ignore, mark as in a); c) auto reopen changed file in UEFITool. If changes were in some way ignored, file path displayed in the right of the status bar will be marked with italic font and then become clickable: on click request to reopen appears again. 12) Switched to offset/size instead of byte array storing in each tree item. 13) For clarity - added icons to key tree items (compressed and with contents, contents now must be in root item only). 14) For usability - added expanding tree on open image (to depth level 1) and by menu command (expand all).
My bad. Fixed (PR). |
|
@Ykidia, everything @vit9696 and I agreed to take on had been taken, THANK YOU. Please continue working on your fork as you see fit, because you certainly have some interesting ideas on how to improve the tool, even if they aren't immediately useful to the mainline. I will close this PR because we will not be applying it as is, but I promise to think some more about the stuff we NACKed, and maybe bring those one by one, informing you every time it happens. Looking forward to your future contributions. |


Usability - added special subspecifier "h" for specifier "X" (hex values print), added corresponding menu option and application setting to UEFITool. After changing option "C-style hex values" user need to reload image file for now or restart the program to take effect.
NS: NACK pending further discussion.
Parser - added some more analysis to raw files and sections: raw files can (or can not) contain sections, raw sections can contain NVAR storage or PE/TE.
NS: NACK pending further discussion.
Parser - improved CPU base address detection and propagation. Now if we have a coreboot image with Intel FSP inside, or a FSP binary itself, or other part of UEFI BIOS, CPU base address more probably will be detected as for standard UEFI image.
NS: NACK pending further discussion.
Parser - improved FIT recognition. FIT does not rely only on VTF found in PEI phase volume, so if VTF was not found, this does not mean that FIT is absent. Now if we have a coreboot image with Intel FSP inside, or some end (higher) part of UEFI BIOS, FIT will be found as for standard Intel image.
NS: NACK pending further discussion.
Parser - small changes to Flash Descriptor parsing to get more cases for valid "Intel image". To get rid of cases when "Intel image" is already in tree but with parse error because of which "UEFI image" appears.
NS: ACK pending sample images.
Parser - added parsing of individual UEFI-files (these can be trimmed from UEFI-volume), displaying it as "UEFI volume part".
NS: NACK.
Usability - added possibility to view/save contents of elements "Free volume space", "Free space" and such, because these can be non-empty. Or they cannot, but now we can edit them, say, in hex (when editing and writing will be unlocked/refactored/restored).
NS: NACK.
Settings - added storage in settings of the following paths: open image file, save image file, open GUIDs file.
NS: Done in ebf4f83
Usability - added last opened files list.
NS: Done in ebf4f83
Usability - added permanent opened file name string to the end of the status bar.
NS: NACK.
Usability - added opened file changes tracking: if the file was modified in other program while it is opened in UEFITool, there are 3 ways to act: a) ignore changes (but mark file path displayed in the status bar with italic font); b) ask user to reopen or ignore (if ignore, mark as in a); c) auto reopen changed file in UEFITool. If changes were in some way ignored, file path displayed in the right of the status bar will be marked with italic font and then become clickable: on click request to reopen appears again.
NS: NACK.
Internals - switched to offset/size instead of byte array storing in each tree item, which results in significant reduction in memory consumption (espesially with latest large images).
NS: NACK.
Debug - added icons to key tree items (compressed and with contents, contents now must be in root item only).
NS: NACK.
Usability - added expanding tree on open image (to depth level 1) and by menu command (expand all).
NS: Done in ebf4f83 (only the level 1 part)