Rewrite instructions and Patch images #1

Merged
DataHoarder merged 14 commits from split-rewrite into master 2020-12-27 01:49:35 +00:00
Owner
  • Allow writing image modifications back onto binary representation.
  • WIP: Reverse-engineered locations of settings defined in header, see main.cpp L117-L187 for more information.
  • Add Configuration class to parse and handle ini-like key/value text strings found on headers or fm_platform_attributes.cfg.
    • Entries are returned ordered based on addition order.
    • Duplicate entries are not kept, this is different from existing Intel images that some contain duplicate entries.
  • Split each instruction into its own class with methods to read/write/debug/execute them, instead of being in a single god class.
  • Fixes several decoding / encoding mistakes or non-defined spec items.
    • Instructions have to be multiples of 4 bytes long, but not specifically aligned to 4 bytes offsets.
    • END has to be 4 bytes long. However, the last 3 bytes are not specified but can include unused data, currently either 0x000000 or 0xFFFFFF.
  • Output additional static library librrcimage for usage on other projects as needed.
* **Allow writing image modifications back onto binary representation.** * **WIP: Reverse-engineered locations of settings defined in header**, see [main.cpp L117-L187](https://git.gammaspectra.live/FM10K/rrcSmall/src/commit/3d44e39c3234b3c7dee963387e111565638b5146/src/main.cpp#L117-L187) for more information. * Add Configuration class to parse and handle ini-like key/value text strings found on headers or _fm_platform_attributes.cfg_. * Entries are returned ordered based on addition order. * Duplicate entries are not kept, this is different from existing Intel images that some contain duplicate entries. * **Split each instruction into its own class with methods to read/write/debug/execute** them, instead of being in a single god class. * Fixes several decoding / encoding mistakes or non-defined spec items. * Instructions have to be multiples of 4 bytes long, but not specifically _aligned to 4 bytes offsets_. * END has to be 4 bytes long. However, the last 3 bytes are not specified but can include unused data, currently either 0x000000 or 0xFFFFFF. * Output additional static library `librrcimage` for usage on other projects as needed.
DataHoarder added the
bug
enhancement
labels 2020-12-25 22:16:36 +00:00
DataHoarder added 10 commits 2020-12-25 22:16:37 +00:00
All checks were successful
continuous-integration/drone/push Build is passing
56bccd2168
Rewrite instructions to separate files, fix a few inconsistencies
All checks were successful
continuous-integration/drone/push Build is passing
fbc5c63a47
Added image & instruction writeback, Configuration parsing
All checks were successful
continuous-integration/drone/push Build is passing
38f0b983b6
WIP: Added Configuration, allow value modification and patching settings based on those
All checks were successful
continuous-integration/drone/push Build is passing
78fd5716b3
Return configuration nodes in entry order
All checks were successful
continuous-integration/drone/push Build is passing
a40bcbd559
WIP: Reversed addresses of config locations
All checks were successful
continuous-integration/drone/push Build is passing
9f71deeaf9
Mark location of PEP Vital Product Data in binary image
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
3d44e39c32
Added new patching entries for known key -> value mappings
Author
Owner

Currently supported config entries that can be altered and patched onto existing images:

  • api.platform.config.switch.0.bootCfg.systimeClockSource
  • api.platform.config.switch.0.bootCfg.spiTransferMode
  • api.platform.config.switch.0.bootCfg.spiTransferSpeed
  • api.platform.config.switch.0.bootCfg.mgmtPep
  • api.platform.config.switch.0.bootCfg.pep.[0-8].bar4Allowed
  • api.platform.config.switch.0.bootCfg.pep.[0-8].enable
  • api.platform.config.switch.0.bootCfg.pep.[0-8].ASPMEnable
  • api.platform.config.switch.0.bootCfg.pep.[0-8].numberOfLanes
  • api.platform.config.switch.0.bootCfg.pep.[0-8].gen
  • api.platform.config.switch.0.bootCfg.pep.[0-8].mode
  • api.platform.config.switch.0.bootCfg.pep.[0-8].vendorId
  • api.platform.config.switch.0.bootCfg.pep.[0-8].deviceId
  • api.platform.config.switch.0.bootCfg.pep.[0-8].subVendorId
  • api.platform.config.switch.0.bootCfg.pep.[0-8].subDeviceId
Currently supported config entries that can be altered and patched onto existing images: * `api.platform.config.switch.0.bootCfg.systimeClockSource` * `api.platform.config.switch.0.bootCfg.spiTransferMode` * `api.platform.config.switch.0.bootCfg.spiTransferSpeed` * `api.platform.config.switch.0.bootCfg.mgmtPep` * `api.platform.config.switch.0.bootCfg.pep.[0-8].bar4Allowed` * `api.platform.config.switch.0.bootCfg.pep.[0-8].enable` * `api.platform.config.switch.0.bootCfg.pep.[0-8].ASPMEnable` * `api.platform.config.switch.0.bootCfg.pep.[0-8].numberOfLanes` * `api.platform.config.switch.0.bootCfg.pep.[0-8].gen` * `api.platform.config.switch.0.bootCfg.pep.[0-8].mode` * `api.platform.config.switch.0.bootCfg.pep.[0-8].vendorId` * `api.platform.config.switch.0.bootCfg.pep.[0-8].deviceId` * `api.platform.config.switch.0.bootCfg.pep.[0-8].subVendorId` * `api.platform.config.switch.0.bootCfg.pep.[0-8].subDeviceId`
DataHoarder added 1 commit 2020-12-25 22:27:39 +00:00
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
d40724c096
Apply formatting rules.
DataHoarder added 1 commit 2020-12-26 23:10:48 +00:00
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2f81fe9539
Remove NOP, fix word aligned state.current mask, overwrite unused entries on Configuration writeback
DataHoarder force-pushed split-rewrite from 1d210d8b75 to 082ef5bdf3 2020-12-27 00:39:43 +00:00 Compare
DataHoarder force-pushed split-rewrite from b54c6becf3 to 92ffa24779 2020-12-27 01:44:13 +00:00 Compare
Author
Owner

Supported as well:

  • api.platform.config.switch.0.bootCfg.pep.[0-8].serialNumber
  • api.platform.config.switch.0.bootCfg.customMac.[0-3]
Supported as well: * `api.platform.config.switch.0.bootCfg.pep.[0-8].serialNumber` * `api.platform.config.switch.0.bootCfg.customMac.[0-3]`
DataHoarder changed title from WIP: Rewrite instructions and Patch images to Rewrite instructions and Patch images 2020-12-27 01:48:54 +00:00
DataHoarder merged commit 58b55c20ce into master 2020-12-27 01:49:35 +00:00
DataHoarder deleted branch split-rewrite 2020-12-28 21:15:43 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: FM10K/rrcSmall#1
No description provided.