Jump to content

DSDT editor and patcher

DSDT editor patcher

  • Please log in to reply
991 replies to this topic

#1
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,858 posts
  • Gender:Male
  • Location:Brazil
El Coniglio released this DSDT editor with automated patching capabilities

Posted Image

The main editor windows allows the user to open a DSL file or extract the DSDT from IOReg. It has some useful resources, like syntax highlighting, navigation tree and some options that came with the text editor component it uses, like regex matching, auto completion, jump to pair, etc.

The patcher window parses a script-like language representing the patches. The user can preview the modifications before applying them. This "language" allows us to write dynamic patches that can be applied in various situations. More specific commands can be written as they become necessary.

For now these are the implemented commands (which can be stacked separated by ";")

syntax:

into <type> <property1> <property_argument1> [<property2> <property_argument2> ... <propertyN> <property_argumentN>] <action> begin [action_argument] end
(will be applied to the first occurrence)

into_all <type> <property1> <property_argument1> [<property2> <property_argument2> ... <propertyN> <property_argumentN>] <action> begin [action_argument] end
(will be applied to all occurrences)

where

type: DefinitionBlock, Scope, Method, Device, Processor, ThermalZone, All

property:
label -- first argument for the constructor of selected type
name_adr -- Name (_ADR) value
name_hid -- Name (_HID) value
code_regex -- regular expression to match the code of the selected type (not other types inside of it)
code_regex_not -- regular expression NOT to match the code of the selected type (not other types inside of it)
parent_label -- parent label
parent_type -- parent type
parent_adr -- parent _ADR value
parent_hid -- parent _HID value

action:
insert <code> -- inserts the provided code to the type
set_label <new_label> -- sets the label
replace_matched <code> -- replaces the matched code for the property with the provided code. Regex groups are inserted with %1, %2, ... up to %9
replaceall_matched <code> -- same as replace_matched but will affect all matches
remove_matched -- removes the matched code
removeall_matched -- removes all the ocurrencies of the matched code
remove_entry -- removes the entry and all children nodes
replace_content -- replaces the content of the object (everything inside its main brackets)
store_%8 -- stores the matched group 1 into %8
store_%9 -- stores the matched group 1 into %9

note: replacer will always consider the last provided value


Changes in latest release:
  • fixed bug which caused data loss if number of open and close brackets don't match
  • fixed compile window to work with new IASL versions
  • updated IASL to 20120420
Download: (last updated on 17/May/2012)

Mac OS: Attached File  DSDTEditor_Mac.zip   1.13MB   41075 downloads
Linux and Windows: Attached File  DSDTEditor_Linux_Windows.zip   1.6MB   17361 downloads

How to apply a patch:

http://www.youtube.com/watch?v=nZIHw-QYO64


Screenshots:

Linux
Posted Image

Windows
Posted Image


Credits:

Editor component: jsyntaxpane (http://code.google.com/p/jsyntaxpane/)
IASL Copyright © Intel Corporation
Written in Java

#2
valv

valv

    InsanelyMac Architect

  • Members
  • PipPipPipPipPipPipPip
  • 910 posts
  • Gender:Male
  • Location:Unrevealed Area
  • Interests:Operating Systems<br />Networking<br />Security
@oldnapalm,
Thank u dear.

#3
el coniglio

el coniglio

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 101 posts
Follows a generated list with available patches to use with DSDT Editor.

Last updated: Tue Oct 5 15:42:06 2010

  • Patches
  • AD1988B.txt
    Insert method _DSM into device with _ADR 0x001B0000
  • AD2000B.txt
    Insert method _DSM into device with _ADR 0x001B0000
  • AHCI SATA orange icon.txt
    Change ID of SATA device to fake ESB2 AHCI (silver icons for internal HDs instead of orange ones)
  • ALC662.txt
    Insert method _DSM into device with _ADR 0x001B0000
  • ALC883.txt
    Insert method _DSM into device with _ADR 0x001B0000
  • ALC888.txt
    Insert method _DSM into device with _ADR 0x001B0000
  • ALC889.txt
    Insert method _DSM into device with _ADR 0x001B0000
  • ALC889A.txt
    Insert method _DSM into device with _ADR 0x001B0000
  • Alias.txt
    Remove aliases from scope _PR (cpus=1 fix)
  • Aspire 3690.txt
    Aspire 3690
  • Aspire 5920.txt
    Acer Aspire 5920
  • ASUS P5E.txt
    All patches used in ASUS P5E (also tested on P5E Deluxe, P5K Premium and Maximus Formula)
  • AZAL to HDEF.txt
    Rename device AZAL to HDEF and change all references to it
  • Dell M1330.txt
    Dell M1330 (Intel X3100 video)
  • DTGP.txt
    Add method DTGP to the main block, it's used by other patches
  • EHCI sleep.txt
    Fix for "AppleUSBEHCI::CheckSleepCapability - controller will be unloaded across sleep"
  • GA P35-DS3.txt
    Add method DTGP to the main block, it's used by other patches
    Change ID of SATA device to fake ESB2 AHCI (silver icons for internal HDs instead of orange ones)
    Rename device AZAL to HDEF and change all references to it
    Insert method _DSM into device with _ADR 0x001B0000
    Insert device GIGE into device with _ADR 0x001C0004
    (for Gigabyte motherboards)
    Change methods _STA and _CRS into device HPET (to avoid AppleIntelCPUPowerManagement panic)
    EHCI fix
    Change ID of USB devices to fake ICH10-R (sleep fix for ICH9)
    Remove IRQs from devices PIC, RTC and TMR, and add IRQs to device HPET
    Change ID of device with _ADR 0x001F0000 (LPC)
    Insert device SBUS into device PCI0
    Change method _PTS where Arg0 is 0x05 (shutdown)
    Insert return into method _WAK to fix warning
    (for Gigabyte motherboards)
    Change the length of IO segment in device RTC to 0x02 (fix CMOS reset)
  • GIGE.txt
    Insert device GIGE into device with _ADR 0x001C0004
    (for Gigabyte motherboards)
  • GMA950 desktop.txt
    Insert device PEGP into device PCI0
  • GMA950 laptop.txt
    Insert method _DSM into device with _ADR 0x00020000
  • HDEF.txt
    Insert device HDEF into device with _HID PNP0A08 (PCI0)
  • HPET.txt
    Change methods _STA and _CRS into device HPET (to avoid AppleIntelCPUPowerManagement panic)
  • ICH9 USB sleep.txt
    Change ID of USB devices to fake ICH10-R (sleep fix for ICH9)
  • IOATAFamily.txt
    Fix IDE Timing Register to avoid IOATAFamily on 10.6.0-10.6.2
  • IRQs.txt
    Remove IRQ from device PIC and move IRQs from devices RTC and TMR to device HPET
  • LAN0.txt
    Insert device LAN0 into device with _ADR 0x001C0002
  • LPC.txt
    Change ID of device with _ADR 0x001F0000 (LPC)
  • Mac devices.txt
    Rename devices to Mac specific ones (by fbifido)
  • nVidia 9800 GTX 512 MB.txt
    Insert device GFX0 into device with _ADR 0x00010000
  • RTC.txt
    Change the length of IO segment in device RTC to 0x02 (fix CMOS reset)
  • SBUS.txt
    Insert device SBUS into device PCI0
  • Shutdown ASUS.txt
    Change method _PTS to do nothing if Arg0 is 0x05 (shutdown)
  • Shutdown Gigabyte.txt
    Change method _PTS where Arg0 is 0x05 (shutdown)
  • Shutdown Intel.txt
    Change method _PTS where Arg0 is 0x05 (shutdown)
  • WAK.txt
    Insert return into method _WAK to fix warning
    (for Gigabyte motherboards)


#4
valv

valv

    InsanelyMac Architect

  • Members
  • PipPipPipPipPipPipPip
  • 910 posts
  • Gender:Male
  • Location:Unrevealed Area
  • Interests:Operating Systems<br />Networking<br />Security
@el coniglio,
keep up the good work :P
One thing, how do I build it from src (got from svn)?

#5
el coniglio

el coniglio

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 101 posts

@el coniglio,
keep up the good work :)
One thing, how do I build it from src (got from svn)?


Hey valv, that link is just for the editor component I used in the project, you don't really need to get it as it is packed with the rest of the application. Oldnapalm posted the link just to give the proper credits. =D

We are sending a beta version for those who are interested and as soon as some hard testing is passed I'll post a public release.

#6
rednous

rednous

    InsanelyMac Sage

  • Members
  • PipPipPipPipPipPip
  • 388 posts
  • Gender:Male
  • Location:Galaxy: Milky Way
  • Interests:graphic design, mac, progressive and house
Nice :) love it. i'll go for it.

#7
anibalin

anibalin

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 278 posts
I like the simplicity and device-manager like interface. Very neat. Congrats.

#8
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,858 posts
  • Gender:Male
  • Location:Brazil
First public release attached to first post.

#9
Logicpro9_user

Logicpro9_user

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 193 posts
  • Gender:Male
This looks great! mayeb I can finlay patch my DSDT for my Bade 2! get some things working without kexts.
I hear that someone patched their DSDT for the Intel Bad Axe 2 mobo so well, they didnt need graphics,sound, nullcpu kexts.... Anyone else heard of this?

This DSDT editor looks amazing! very simple and easy to look at, hopefully easy to use!

#10
el coniglio

el coniglio

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 101 posts

This DSDT editor looks amazing! very simple and easy to look at, hopefully easy to use!


Yep it is really easy to use if you have the patches already coded. In the zip there is a folder with some working examples (ASUS P5 Patches), if all are applied to a original extracted dsdt it will fix a bunch of issues. It could be applied from a single file containing all patches, making even more simple to the user. The patches inside the pack were tested for P5E, P5E Deluxe, P5K Premium and Maximus Formula.

As you can see in the examples, patches can (and may) be coded to avoid being applied more than once, so you can use a pack even if you already have applied part of it.

#11
scrax

scrax

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,704 posts
  • Gender:Male
Nice!
I'll try it ASAP, looks very helpful

#12
valv

valv

    InsanelyMac Architect

  • Members
  • PipPipPipPipPipPipPip
  • 910 posts
  • Gender:Male
  • Location:Unrevealed Area
  • Interests:Operating Systems<br />Networking<br />Security
Really interesting!
One thought though, If when selecting a section it jumps to it by making the first line appear on the right pane as the first to show, it 'd ease its use. At first sight I didn't knew it did jump to the requested section, as it showed its first line at the bottom (last line to appear).
Greetz

#13
blackosx

blackosx

    InsanelyMacaholic

  • Coders
  • 3,170 posts
  • Gender:Male
  • Location:UK
This is a great idea with the automated patching and could prove to be very popular.
Thanks for the hard work in creating it El Coniglio. Well done :D

#14
jeffrey1790

jeffrey1790

    InsanelyMac Protégé

  • Members
  • PipPip
  • 61 posts
Is it possible to compile it for windows? :D
You'd think it would work by extracting the jar files in the Resources folder from the app.

#15
MaLd0n

MaLd0n

    ...filling veins with juice of chaos...

  • Moderators
  • 11,139 posts
  • Gender:Male
  • Location:Rio de Janeiro
Thanks

:D

#16
el coniglio

el coniglio

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 101 posts

Is it possible to compile it for windows? :D
You'd think it would work by extracting the jar files in the Resources folder from the app.


Yes I think it will work. It won't extract DSDT from IOReg or open an AML file instead of the DSL (it decompiles it if you select an AML file). The editor component support the Control + Something shortcuts by default, I just added the Meta (Command) + Something, so no problem with them. But try it, if it doesn't work I can check and build a version without the OS specific resources, so you can run it on Linux or Windows.

Edit: oldnapalm tested it on windows and worked. The simplest way is to create a ./lib with all jars but DSDTParser.jar and leave DSDTParser in ./ so you can run java -jar DSDTParser.jar (or double-click on the explorer) without any -cp parameters. I am going to check to make the dsdt extract work in linux and append iasl binaries for linux and windows, so most functions would work on all 3 OS.

Edit again: I tested and patches are not applying in windows cause of the \r windows uses in the line breaks. It will be fixed in the next release =)

#17
FKA

FKA

    are we there yet?

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,626 posts
  • Gender:Male
Looks fantastic - for a dyslexic like me it will be most useful to gain some order to pages of code.

Many Thanks -_-

#18
danielkza

danielkza

    InsanelyMac Protégé

  • Members
  • PipPip
  • 66 posts
  • Gender:Male
  • Location:São Paulo - Brasil
Looks WAY better than DSDTE, and both the automatic patching and device tree will be incredibly useful. Thanks for the great work!

EDIT: Spoke way too early. No system menu (tolerable) and no context menus (very f*cked up). Device tree is pretty much useless: the need to jump-unlock-edit-lock makes it nothing but a waste of time. I know these things seem small, but they're disproportionately annoying, even for a Java program. I hope they can be fixed somehow.

#19
el coniglio

el coniglio

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 101 posts

EDIT: Spoke way too early. No system menu (tolerable) and no context menus (very f*cked up). Device tree is pretty much useless: the need to jump-unlock-edit-lock makes it nothing but a waste of time. I know these things seem small, but they're disproportionately annoying, even for a Java program. I hope they can be fixed somehow.


I understand your point. I see two possible solutions for the issue:
1. Remove the "toggle editable", but the tree will only refresh when you trig a button or shortcut;
2. Make a "node editor window" in a context menu, that allows you to edit a tree node, once the editing is done, the code is reparsed and tree refreshed

The main focus was the automated patching to help users who doesn't know how to apply a patch. The application isn't ready (compiling error handling missing) so bring your suggestions.

#20
FKA

FKA

    are we there yet?

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,626 posts
  • Gender:Male

2. Make a "node editor window" in a context menu, that allows you to edit a tree node, once the editing is done, the code is reparsed and tree refreshed.


not tried the app yet but I like the sound of option 2.) :)





Also tagged with one or more of these keywords: DSDT, editor, patcher


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy