Jump to content

SMC Emulation in DSDT


  • Please log in to reply
44 replies to this topic

#41
cartri

cartri

    Just a Cone

  • Donators
  • 407 posts
  • Location:Brazil
Reviving this old post as it called my interest on some projects of mine.
Once we have the SMC dfu files, couldnt we just allocate their memory space by dsdt? The dfu seems like a simple software with information of what goes where clearly stated.

#42
Maroc-OS

Maroc-OS

    InsanelyMac Protégé

  • Members
  • Pip
  • 29 posts
  • Gender:Male
  • Location:Casablanca, Casablanca, Morocco
  • Interests:P5KPL-AM SE
				Device (SMC)
				{
					Name (_HID, EisaId ("APP0001"))
					Name (_CID, "smc-napa")
					Name (_STA, 0x0B)
					Name (_ADR, Zero)
					Method (_DSM, 4, NotSerialized)
					{
						Store (Package ()
							{
								"tjmax",
								Buffer ()
								{
									0x00, 0x00, 0x01, 0x00
								},
								"OSK0",
								Buffer (0x04)
								{
									"ourhardworkbythesewordsguardedpl"
								},
								"OSK1",
								Buffer (0x04)
								{
									"easedontsteal(c)AppleComputerInc"
								}
							}, Local0)
						DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
						Return (Local0)
					}
					Device (SMS0)
					{
						Name (_HID, EisaId ("APP0003"))
						Name (_CID, "smc-sms")
					}
					Device (ALS0)
					{
						Name (_HID, "ACPI0008")
						Name (_CID, "smc-als")
					}
				}

That can help :) if yes we need to add all the other values :) like

    <key>$Num</key>
    <data>
    AQ==
    </data>
    <key>ACID</key>
    <data>
    AAAAAAAA
    </data>
    <key>ALA0</key>
    <data>
    AAAAAAAAAAAAAAA=
    </data>
    <key>ALA1</key>
    <data>
    AAAAAAAAAAAAAAA=
    </data>
    <key>ALA2</key>
    <data>
    AAAA
    </data>
    <key>ALA4</key>
    <data>
    AAAA
    </data>

then we have it in dsdt :)

#43
Gringo Vermelho

Gringo Vermelho

    The Jan Bird fix

  • Supervisors
  • 6,111 posts
  • Gender:Male
  • Location:Brazil
It is not possible, DSDT is read-only. Apparently OS X needs to be able to write to the SMC device.

If you read the first post on page two of this thread hopefully you will understand:

You talked about the QEMU patch so i assume you have read the source. I did long time ago and if i understood and remember correctly: There are two SMC ports, the command and the data port. OSX reads from the SMC as following: write to the command port what value it wants to know and then the SMC device puts data to the data port byte wise like:
Command: read OSK0
SMC returns byte 0 of OSK0
Command: read next byte
SMC returns byte 1 of OSK0
....
until the SMC returns that end of data is reached.
and so on.

Note, that is just as i remember it, it's been a long time since i read through it. But what i can say for sure, we won't be able to do it in DSDT ;)



#44
Maroc-OS

Maroc-OS

    InsanelyMac Protégé

  • Members
  • Pip
  • 29 posts
  • Gender:Male
  • Location:Casablanca, Casablanca, Morocco
  • Interests:P5KPL-AM SE
If it real we can create the SMC in dsdt with all the fixed values. and then we can emulate it with a simple way in chameleon and now we can read data from the Fake Device in DSDT, and store the return's to an adresse in memory.

if adresse 0x00000000 bla bla = 0 or null

read from acpi

else

get from adresse

but if it not?? (not writable)

the device is not writable, the values comes from memory and not from the Device it self and we can do more than like my simple example with Fake DSDT Device.

correct me if am wrong. :)

sorry for my bad english.

#45
Gringo Vermelho

Gringo Vermelho

    The Jan Bird fix

  • Supervisors
  • 6,111 posts
  • Gender:Male
  • Location:Brazil
That's way out of scope for Chameleon.

For your idea to work you'd have to have something running all the time that intercepts all SMC reads/writes and redirects them.

We already have that, it's called fakesmc.kext.





0 user(s) are reading this topic

0 members, 0 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