[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: next power up time, scheduled startup?, pmacpow does not work, nvram-wakeup?


On Wed, May 07, 2003 at 08:45:26AM +0200, Christoph Ewering wrote:
> Hello Oliver!
> So how about doing it together to get pmacpow working with the current
> kernel?

nice intention!

> But as I said I am not a programer, long time ago I wrote a little
> program (ANSI-C), I wrote little tools with AppleScript or Perl, but
> that?s it.

> I looked into pmacpow.c and I can not find the exact line where the
> writing to the cuda-chip really happens. :-(

Ok, here is a interpretation of mine:

/* Here are the variables which will be written to cuda*/
unsigned char reqt[2] =
unsigned char reqp[6] =
        { CUDA_PACKET, CUDA_POWERUP_TIME, 0, 0, 0, 0};

/*...then comes a lot stuff dealing with the date, I assume this works.

The main() functions does some stuff, too. But the point where it gets
interesting is when it comes to open the /dev/adb which will be assigned
to "fd ( fd = open("/dev/adb",  O_RDRW))...".
If this is a success the programm tries to get the date out of the cuda
using the function "get_current_time(fd);"
Then the function calc_powerup_time is called, which should not be a problem
because it does not do reading/writing.

So we end up in the function "set_powerup_time(fd, uptime);"
Here is the "fd" again and looking in the function there is the line
n = write(fd, reqp, sizeof(reqp);
This will write the date of the next startup to the cuda.
And there is also the error message which I do get running
the programm "-1".
So I think to make this code working one must have a look at the libraries
before one can fix this. Maybe pmacpow gives its data in a wrong format
to cuda.
Its really strange because the global varis in cuda/adb should be the same
on every mac, shouldn't they? (just thinking about that, because the author
says explicitly that this code will not work ob pb/ibooks)
I will look at these files, next time ;-)
(this may be in some weeks because I will have some exams soon).

> Did you try to contact the original author?
No, but, well, why not.



Reply to: