Newsgroup: it.comp.programmare
Titolo: POSSIBILE CHE NESSUNO LO SAPPIA??!?!

In riferimento al messaggio precedente Accensioe Computer:
Ormai da tempo nel bios di quasi tutte le schede madri e' presente un
opzione per far accendere il PC in un giorno e ad un ora prestabiliti. (RTC
Power On Alarm)
Qualcuno sa come impostare questi dati da programma sotto Windows??
Grazie

 wrote :
| Oltretutto sono certo che se fosse stato possibile Win avrebbe integrato
| questo tipo di utilità da tempo!!
<flame on>
E' risaputo che il numero di utility per windows e' inversamente
proporzionale alla loro utilita', cosi' come i bug risolti e le features
inserite nel kernel
(una per tutti: disk quota)
</flame off>

 Grazie
Al bios puoi accedere tramite degli interrupt. Farlo sotto dos è una cosa
banale, sotto windows invece è piuttosto difficile perché devi scriverti un
driver.
Ti allego la parte della "interrupt list" di Ralf Brown che riguarda il RTC
alarm.
--------B-1A00-------------------------------
INT 1A - TIME - GET SYSTEM TIME
 AH = 00h
Return: CX:DX = number of clock ticks since midnight
 AL = midnight flag, nonzero if midnight passed since time last read
Notes: there are approximately 18.2 clock ticks per second, 1800B0h per 24
hrs
   (except on Tandy 2000, where the clock runs at 20 ticks per second)
 IBM and many clone BIOSes set the flag for AL rather than incrementing
   it, leading to loss of a day if two consecutive midnights pass
   without a request for the time (e.g. if the system is on but idle)
 since the midnight flag is cleared, if an application calls this
   function after midnight before DOS does, DOS will not receive the
   midnight flag and will fail to advance the date
SeeAlso: AH=01h,AH=02h,INT 21/AH=2Ch,INT 55"Tandy 2000",INT 4E/AH=02h"TI"
SeeAlso: INT 62/AX=0099h,MEM 0040h:006Ch,MEM 0040h:0070h
--------B-1A01-------------------------------
INT 1A - TIME - SET SYSTEM TIME
 AH = 01h
 CX:DX = number of clock ticks since midnight
Return: nothing
Notes: there are approximately 18.2 clock ticks per second, 1800B0h per 24
hrs
   (except on Tandy 2000, where the clock runs at 20 ticks per second)
 this call resets the midnight-passed flag
SeeAlso: AH=00h,AH=03h,INT 21/AH=2Dh
--------B-1A02-------------------------------
INT 1A - TIME - GET REAL-TIME CLOCK TIME (AT,XT286,PS)
 AH = 02h
Return: CF clear if successful
     CH = hour (BCD)
     CL = minutes (BCD)
     DH = seconds (BCD)
     DL = daylight savings flag (00h standard time, 01h daylight time)
 CF set on error (i.e. clock not running or in middle of update)
Note: this function is also supported by the Sperry PC, which predates the
   IBM AT; the data is returned in binary rather than BCD on the Sperry,
   and DL is always 00h
SeeAlso: AH=00h,AH=03h,AH=04h,INT 21/AH=2Ch
--------b-1A02-------------------------------
INT 1A - Tandy 2000 - TIME - GET DATE AND TIME
 AH = 02h
Return: BX = number of days since January 1, 1980
 CH = hours
 CL = minutes
 DH = seconds
 DL = hundredths
SeeAlso: AH=03h"Tandy 2000",INT 55"Tandy 2000"
--------B-1A03-------------------------------
INT 1A - TIME - SET REAL-TIME CLOCK TIME (AT,XT286,PS)
 AH = 03h
 CH = hour (BCD)
 CL = minutes (BCD)
 DH = seconds (BCD)
 DL = daylight savings flag (00h standard time, 01h daylight time)
Return: nothing
Note: this function is also supported by the Sperry PC, which predates the
   IBM AT; the data is specified in binary rather than BCD on the
   Sperry, and the value of DL is ignored
SeeAlso: AH=01h,AH=03h,AH=05h,INT 21/AH=2Dh,INT 4B/AH=01h
--------b-1A03-------------------------------
INT 1A - Tandy 2000 - TIME - SET DATE AND TIME
 AH = 03h
 BX = number of days since January 1, 1980
 CH = hours
 CL = minutes
 DH = seconds
 DL = hundredths
Return: nothing
SeeAlso: AH=02h"Tandy 2000",INT 55"Tandy 2000"
--------B-1A04-------------------------------
INT 1A - TIME - GET REAL-TIME CLOCK DATE (AT,XT286,PS)
 AH = 04h
Return: CF clear if successful
     CH = century (BCD)
     CL = year (BCD)
     DH = month (BCD)
     DL = day (BCD)
 CF set on error
SeeAlso: AH=02h,AH=04h"Sperry",AH=05h,INT 21/AH=2Ah,INT 4B/AH=02h"TI"
--------b-1A04-------------------------------
INT 1A - Sperry PC - GET REAL-TIME CLOCK DATE
 AH = 04h
Return: CF clear if successful
     CL = year-1980
     DH = month (binary) (01h-0Ch)
     DL = day (binary) (01h-1Fh)
 CF set on error
SeeAlso: AH=02h,AH=04h,AH=05h"Sperry",INT 21/AH=2Ah,INT 4B/AH=02h"TI"
--------B-1A05-------------------------------
INT 1A - TIME - SET REAL-TIME CLOCK DATE (AT,XT286,PS)
 AH = 05h
 CH = century (BCD)
 CL = year (BCD)
 DH = month (BCD)
 DL = day (BCD)
Return: nothing
SeeAlso: AH=04h,INT 21/AH=2Bh"DATE",INT 4B/AH=00h"TI"
--------b-1A05-------------------------------
INT 1A - Sperry PC - SET REAL-TIME CLOCK DATE
 AH = 05h
 CL = year-1980
 CH = 00h (???)
 DH = month (binary) (01h-0Ch)
 DL = day (binary) (01h-1Fh)
Return: nothing
SeeAlso: AH=02h,AH=04h"Sperry",AH=05h,INT 21/AH=2Bh"DATE"
--------B-1A06-------------------------------
INT 1A - TIME - SET ALARM (AT,XT286,PS)
 AH = 06h
 CH = hour (BCD)
 CL = minutes (BCD)
 DH = seconds (BCD)
Return: CF set on error (alarm already set or clock stopped for update)
 CF clear if successful
Notes: the alarm occurs every 24 hours until turned off, invoking INT 4A
each
   time
 the BIOS does not check for invalid values for the time, so the CMOS
   clock chip's "don't care" setting (any values between C0h and FFh)
   may be used for any or all three parts.  For example, to create an
   alarm once a minute, every minute, call with CH=FFh, CL=FFh, and
   DH=00h.
SeeAlso: AH=07h,AH=0Ch,INT 4A"SYSTEM"
--------B-1A07-------------------------------
INT 1A - TIME - CANCEL ALARM (AT,XT286,PS)
 AH = 07h
Return: alarm disabled
Note: does not disable the real-time clock's IRQ
SeeAlso: AH=06h,AH=0Dh,INT 70
--------B-1A08-------------------------------
INT 1A - TIME - SET RTC ACTIVATED POWER ON MODE (CONVERTIBLE)
 AH = 08h
 CH = hours in BCD
 CL = minutes in BCD
 DH = seconds in BCD
SeeAlso: AH=09h
--------B-1A09-------------------------------
INT 1A - TIME - READ RTC ALARM TIME AND STATUS (CONV,PS30)
 AH = 09h
Return: CH = hours in BCD
 CL = minutes in BCD
 DH = seconds in BCD
 DL = alarm status
     00h alarm not enabled
     01h alarm enabled but will not power up system
     02h alarm will power up system
SeeAlso: AH=08h
--------B-1A0A-------------------------------
INT 1A - TIME - READ SYSTEM-TIMER DAY COUNTER (XT2,PS)
 AH = 0Ah
Return: CF set on error
 CF clear if successful
     CX = count of days since Jan 1,1980
SeeAlso: AH=04h,AH=0Bh
--------B-1A0B-------------------------------
INT 1A - TIME - SET SYSTEM-TIMER DAY COUNTER (XT2,PS)
 AH = 0Bh
 CX = count of days since Jan 1,1980
Return: CF set on error
 CF clear if successful
SeeAlso: AH=05h,AH=0Ah
--------B-1A0C-------------------------------
INT 1A - TIME - SET RTC DATE/TIME ACTIVATED POWER-ON MODE (IBM)
 AH = 0Ch
 CH = hours (BCD)
 CL = minutes (BCD)
 DH = seconds (BCD)
 DL = day of month (BCD)
Return: CF clear if successful
 CF set on error (alarm already set or clock nonfunctional)
Desc: set an automatic power-on for a given time in the future
Note: IBM classifies this function as optional
SeeAlso: AH=06h,AH=0Dh,AH=0Eh,INT 4A
--------B-1A0D-------------------------------
INT 1A - TIME - RESET RTC DATE/TIME ACTIVATED POWER-ON MODE (IBM)
 AH = 0Dh
Return: CF clear if successful
 CF set on error
Desc: cancel a previously-set power-on alarm
Note: IBM classifies this function as optional
SeeAlso: AH=07h,AH=0Ch,AH=0Eh
--------B-1A0E-------------------------------
INT 1A - TIME - GET RTC DATE/TIME ALARM AND STATUS (IBM)
 AH = 0Eh
Return: CF clear if successful
     BH = alarm status
  00h disabled
  01h enabled but will not power-up system
  02h enabled, system will power-up on activation
     CH = alarm time, hours (BCD)
     CL = alarm time, minutes (BCD)
     DH = seconds (BCD)
     DL = day of month (BCD)
 CF set on error
SeeAlso: AH=0Ch,AH=0Dh,AH=0Fh
--------B-1A0F-------------------------------
INT 1A - TIME - INITIALIZE REAL-TIME CLOCK
 AH = 0Fh
 AL = reserved (0)
Return: CF clear if successful
 CF set on error
SeeAlso: AH=0Ch,AH=0Dh,AH=0Eh