Subversion Repositories Kolibri OS

Rev

Rev 110 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
110 heavyiron 1
--------p-155300-----------------------------
2
INT 15 - Advanced Power Management v1.0+ - INSTALLATION CHECK
3
	AX = 5300h
4
	BX = device ID of system BIOS (0000h)
5
Return: CF clear if successful
6
	    AH = major version (BCD)
7
	    AL = minor version (BCD)
8
	    BX = 504Dh ("PM")
9
	    CX = flags (see #00472)
10
	CF set on error
11
	    AH = error code (06h,09h,86h) (see #00473)
12
BUG:	early versions of the Award Modular BIOS with built-in APM support
13
	  reportedly do not set BX on return
14
 
15
Bitfields for APM flags:
16
Bit(s)	Description	(Table 00472)
17
 
18
 1	32-bit protected mode interface supported
19
 2	CPU idle call reduces processor speed
20
 3	BIOS power management disabled
21
 4	BIOS power management disengaged (APM v1.1)
22
 5-7	reserved
23
 
24
(Table 00473)
25
Values for APM error code:
26
 01h	power management functionality disabled
27
 02h	interface connection already in effect
28
 03h	interface not connected
29
 04h	real-mode interface not connected
30
 05h	16-bit protected-mode interface already connected
31
 06h	16-bit protected-mode interface not supported
32
 07h	32-bit protected-mode interface already connected
33
 08h	32-bit protected-mode interface not supported
34
 09h	unrecognized device ID
35
 0Ah	invalid parameter value in CX
36
 0Bh	(APM v1.1) interface not engaged
37
 0Ch	(APM v1.2) function not supported
38
 0Dh	(APM v1.2) Resume Timer disabled
39
 0Eh-1Fh reserved for other interface and general errors
40
 20h-3Fh reserved for CPU errors
41
 40h-5Fh reserved for device errors
42
 60h	can't enter requested state
43
 61h-7Fh reserved for other system errors
44
 80h	no power management events pending
45
 81h-85h reserved for other power management event errors
46
 86h	APM not present
47
 87h-9Fh reserved for other power management event errors
48
 A0h-FEh reserved
49
 FFh	undefined
50
--------p-155301-----------------------------
51
INT 15 - Advanced Power Management v1.0+ - CONNECT REAL-MODE INTERFACE
52
	AX = 5301h
53
	BX = device ID of system BIOS (0000h)
54
Return: CF clear if successful
55
	CF set on error
56
	    AH = error code (02h,05h,07h,09h) (see #00473)
57
Note:	on connection, an APM v1.1 or v1.2 BIOS switches to APM v1.0
58
	  compatibility mode until it is informed that the user supports a
59
	  newer version of APM (see AX=530Eh)
60
SeeAlso: AX=5302h,AX=5303h,AX=5304h
61
--------p-155302-----------------------------
62
INT 15 R - Advanced Power Management v1.0+ - CONNECT 16-BIT PROTMODE INTERFACE
63
	AX = 5302h
64
	BX = device ID of system BIOS (0000h)
65
Return: CF clear if successful
66
	    AX = real-mode segment base address of protected-mode 16-bit code
67
		segment
68
	    BX = offset of entry point
69
	    CX = real-mode segment base address of protected-mode 16-bit data
70
		segment
71
	    ---APM v1.1---
72
	    SI = APM BIOS code segment length
73
	    DI = APM BIOS data segment length
74
	CF set on error
75
	    AH = error code (02h,05h,06h,07h,09h) (see #00473)
76
Notes:	the caller must initialize two consecutive descriptors with the
77
	  returned segment base addresses; these descriptors must be valid
78
	  whenever the protected-mode interface is called, and will have
79
	  their limits arbitrarily set to 64K.
80
	the protected mode interface is invoked by making a far call with the
81
	  same register values as for INT 15; it must be invoked while CPL=0,
82
	  the code segment descriptor must have a DPL of 0, the stack must be
83
	  in a 16-bit segment and have enough room for BIOS use and possible
84
	  interrupts, and the current I/O permission bit map must allow access
85
	  to the I/O ports used for power management.
86
	functions 00h-03h are not available from protected mode
87
	on connection, an APM v1.1 or v1.2 BIOS switches to APM v1.0
88
	  compatibility mode until it is informed that the user supports a
89
	  newer version of APM (see AX=530Eh)
90
SeeAlso: AX=5301h,AX=5303h,AX=5304h
91
--------p-155303-----------------------------
92
INT 15 - Advanced Power Management v1.0+ - CONNECT 32-BIT PROTMODE INTERFACE
93
	AX = 5303h
94
	BX = device ID of system BIOS (0000h)
95
Return: CF clear if successful
96
	    AX = real-mode segment base address of protected-mode 32-bit code
97
		segment
98
	    EBX = offset of entry point
99
	    CX = real-mode segment base address of protected-mode 16-bit code
100
		segment
101
	    DX = real-mode segment base address of protected-mode 16-bit data
102
		segment
103
	    ---APM v1.1---
104
	    SI = APM BIOS code segment length
105
	    DI = APM BIOS data segment length
106
	CF set on error
107
	    AH = error code (02h,05h,07h,08h,09h) (see #00473)
108
Notes:	the caller must initialize three consecutive descriptors with the
109
	  returned segment base addresses for 32-bit code, 16-bit code, and
110
	  16-bit data, respectively; these descriptors must be valid whenever
111
	  the protected-mode interface is called, and will have their limits
112
	  arbitrarily set to 64K.
113
	the protected mode interface is invoked by making a far call to the
114
	  32-bit code segment with the same register values as for INT 15; it
115
	  must be invoked while CPL=0, the code segment descriptor must have a
116
	  DPL of 0, the stack must be in a 32-bit segment and have enough room
117
	  for BIOS use and possible interrupts, and the current I/O permission
118
	  bit map must allow access to the I/O ports used for power management.
119
	functions 00h-03h are not available from protected mode
120
	on connection, an APM v1.1 or v1.2 BIOS switches to APM v1.0
121
	  compatibility mode until it is informed that the user supports a
122
	  newer version of APM (see AX=530Eh)
123
SeeAlso: AX=5301h,AX=5302h,AX=5304h
124
--------p-155304-----------------------------
125
INT 15 - Advanced Power Management v1.0+ - DISCONNECT INTERFACE
126
	AX = 5304h
127
	BX = device ID of system BIOS (0000h)
128
Return: CF clear if successful
129
	CF set on error
130
	    AH = error code (03h,09h) (see #00473)
131
SeeAlso: AX=5301h,AX=5302h,AX=5303h
132
--------p-155305-----------------------------
133
INT 15 - Advanced Power Management v1.0+ - CPU IDLE
134
	AX = 5305h
135
Return: CF clear if successful (after system leaves idle state)
136
	CF set on error
137
	    AH = error code (03h,0Bh) (see #00473)
138
Notes:	call when the system is idle and should be suspended until the next
139
	  system event or interrupt
140
	should not be called from within a hardware interrupt handler to avoid
141
	  reentrance problems
142
	if an interrupt causes the system to resume normal processing, the
143
	  interrupt may or may not have been handled when the BIOS returns
144
	  from this call; thus, the caller should allow interrupts on return
145
	interrupt handlers may not retain control if the BIOS allows
146
	  interrupts while in idle mode even if they are able to determine
147
	  that they were called from idle mode
148
	the caller should issue this call continuously in a loop until it needs
149
	  to perform some processing of its own
150
SeeAlso: AX=1000h,AX=5306h,INT 2F/AX=1680h
151
--------p-155306-----------------------------
152
INT 15 - Advanced Power Management v1.0+ - CPU BUSY
153
	AX = 5306h
154
Return: CF clear if successful
155
	CF set on error
156
	    AH = error code (03h,0Bh) (see #00473)
157
Notes:	called to ensure that the system runs at full speed even on systems
158
	  where the BIOS is unable to recognize increased activity (especially
159
	  if interrupts are hooked by other programs and not chained to the
160
	  BIOS)
161
	this call may be made even when the system is already running at full
162
	  speed, but it will create unnecessary overhead
163
	should not be called from within a hardware interrupt handler to avoid
164
	  reentrance problems
165
SeeAlso: AX=5305h
166
--------p-155307-----------------------------
167
INT 15 - Advanced Power Management v1.0+ - SET POWER STATE
168
	AX = 5307h
169
	BX = device ID (see #00474)
170
	CX = system state ID (see #00475)
171
Return: CF clear if successful
172
	CF set on error
173
	    AH = error code (01h,03h,09h,0Ah,0Bh,60h) (see #00473)
174
Note:	should not be called from within a hardware interrupt handler to avoid
175
	  reentrance problems
176
SeeAlso: AX=530Ch
177
 
178
(Table 00474)
179
Values for APM device IDs:
180
 0000h	system BIOS
181
 0001h	all devices for which the system BIOS manages power
182
 01xxh	display (01FFh for all attached display devices)
183
 02xxh	secondary storage (02FFh for all attached secondary storage devices)
184
 03xxh	parallel ports (03FFh for all attached parallel ports)
185
 04xxh	serial ports (04FFh for all attached serial ports)
186
---APM v1.1+ ---
187
 05xxh	network adapters (05FFh for all attached network adapters)
188
 06xxh	PCMCIA sockets (06FFh for all)
189
 0700h-7FFFh reserved
190
 80xxh	system battery devices (APM v1.2)
191
 8100h-DFFFh reserved
192
 Exxxh	OEM-defined power device IDs
193
 F000h-FFFFh reserved
194
 
195
(Table 00475)
196
Values for system state ID:
197
 0000h	ready (not supported for device ID 0001h)
198
 0001h	stand-by
199
 0002h	suspend
200
 0003h	off (not supported for device ID 0001h in APM v1.0)
201
---APM v1.1---
202
 0004h	last request processing notification (only for device ID 0001h)
203
 0005h	last request rejected (only for device ID 0001h)
204
 0006h-001Fh reserved system states
205
 0020h-003Fh OEM-defined system states
206
 0040h-007Fh OEM-defined device states
207
 0080h-FFFFh reserved device states
208
--------p-155307CX0001-----------------------
209
INT 15 - Advanced Power Management v1.0+ - SYSTEM STAND-BY
210
	AX = 5307h
211
	CX = 0001h
212
	BX = 0001h (device ID for all power-managed devices)
213
Return: CF clear
214
Notes:	puts the entire system into stand-by mode; normally called in response
215
	  to a System Stand-by Request notification after any necessary
216
	  processing, but may also be invoked at the caller's discretion
217
	should not be called from within a hardware interrupt handler to avoid
218
	  reentrance problems
219
	the stand-by state is typically exited on an interrupt
220
SeeAlso: AX=4280h,AX=5307h/CX=0002h"SUSPEND",AX=5307h/CX=0003h,AX=530Bh
221
--------p-155307CX0002-----------------------
222
INT 15 - Advanced Power Management v1.0+ - SUSPEND SYSTEM
223
	AX = 5307h
224
	CX = 0002h
225
	BX = 0001h (device ID for all power-managed devices)
226
Return: after system is resumed
227
	CF clear
228
Notes:	puts the entire system into a low-power suspended state; normally
229
	  called in response to a Suspend System Request notification after
230
	  any necessary processing, but may also be invoked at the caller's
231
	  discretion
232
	should not be called from within a hardware interrupt handler to avoid
233
	  reentrance problems
234
	the caller may need to update its date and time values because the
235
	  system could have been suspended for a long period of time
236
SeeAlso: AX=5307h/CX=0001h"STAND-BY",AX=530Bh
237
--------p-155307CX0003-----------------------
238
INT 15 - Advanced Power Management v1.2 - TURN OFF SYSTEM
239
	AX = 5307h
240
	CX = 0003h
241
	BX = 0001h (device ID for all power-managed devices)
242
Return: after system is resumed
243
	CF clear
244
Notes:	if supported by the system's power supply, turns off the system power
245
SeeAlso: AX=5307h/CX=0001h"STAND-BY",AX=530Bh
246
--------p-155308-----------------------------
247
INT 15 - Advanced Power Management v1.0+ - ENABLE/DISABLE POWER MANAGEMENT
248
	AX = 5308h
249
	BX = device ID for all devices power-managed by APM
250
	    0001h (APM v1.1+)
251
	    FFFFh (APM v1.0)
252
	CX = new state
253
	    0000h disabled
254
	    0001h enabled
255
Return: CF clear if successful
256
	CF set on error
257
	    AH = error code (01h,03h,09h,0Ah,0Bh) (see #00473)
258
Notes:	when power management is disabled, the system BIOS will not
259
	  automatically power down devices, enter stand-by or suspended mode,
260
	  or perform any power-saving actions in response to AX=5305h calls
261
	should not be called from within a hardware interrupt handler to avoid
262
	  reentrance problems
263
	the APM BIOS should never be both disabled and disengaged at the same
264
	  time
265
SeeAlso: AX=5309h,AX=530Dh,AX=530Fh
266
--------p-155309-----------------------------
267
INT 15 - Advanced Power Management v1.0+ - RESTORE POWER-ON DEFAULTS
268
	AX = 5309h
269
	BX = device ID for all devices power-managed by APM
270
	    0001h (APM v1.1)
271
	    FFFFh (APM v1.0)
272
Return: CF clear if successful
273
	CF set on error
274
	    AH = error code (03h,09h,0Bh) (see #00473)
275
Note:	should not be called from within a hardware interrupt handler to avoid
276
	  reentrance problems
277
SeeAlso: AX=5308h
278
--------p-15530A-----------------------------
279
INT 15 - Advanced Power Management v1.0+ - GET POWER STATUS
280
	AX = 530Ah
281
	BX = device ID
282
	    0001h all devices power-managed by APM
283
	    80xxh specific battery unit number XXh (01h-FFh) (APM v1.2)
284
Return: CF clear if successful
285
	    BH = AC line status
286
		00h off-line
287
		01h on-line
288
		02h on backup power (APM v1.1)
289
		FFh unknown
290
		other reserved
291
	    BL = battery status (see #00476)
292
	    CH = battery flag (APM v1.1+) (see #00477)
293
	    CL = remaining battery life, percentage
294
		00h-64h (0-100) percentage of full charge
295
		FFh unknown
296
	    DX = remaining battery life, time (APM v1.1) (see #00478)
297
	    ---if specific battery unit specified---
298
	    SI = number of battery units currently installed
299
	CF set on error
300
	    AH = error code (09h,0Ah) (see #00473)
301
Notes:	should not be called from within a hardware interrupt handler to avoid
302
	  reentrance problems
303
	supported in real mode (INT 15) and both 16-bit and 32-bit protected
304
	  mode
305
 
306
(Table 00476)
307
Values for APM v1.0+ battery status:
308
 00h	high
309
 01h	low
310
 02h	critical
311
 03h	charging
312
 FFh	unknown
313
 other	reserved
314
SeeAlso: #00477,#00478
315
 
316
Bitfields for APM v1.1+ battery flag:
317
Bit(s)	Description	(Table 00477)
318
 
319
 1	low
320
 2	critical
321
 3	charging
322
 4	selected battery not present (APM v1.2)
323
 5-6	reserved (0)
324
 7	no system battery
325
Note:	all bits set (FFh) if unknown
326
SeeAlso: #00476,#00478
327
 
328
Bitfields for APM v1.1+ remaining battery life:
329
Bit(s)	Description	(Table 00478)
330
 15	time units: 0=seconds, 1=minutes
331
 14-0	battery life in minutes or seconds
332
Note:	all bits set (FFFFh) if unknown
333
SeeAlso: #00476,#00477
334
--------p-15530B-----------------------------
335
INT 15 - Advanced Power Management v1.0+ - GET POWER MANAGEMENT EVENT
336
	AX = 530Bh
337
Return: CF clear if successful
338
	    BX = event code (see #00479)
339
	    CX = event information (APM v1.2) if BX=0003h or BX=0004h
340
		bit 0: PCMCIA socket was powered down in suspend state
341
	CF set on error
342
	    AH = error code (03h,0Bh,80h) (see #00473)
343
Notes:	although power management events are often asynchronous, notification
344
	  will not be made until polled via this call to permit software to
345
	  only receive event notification when it is prepared to process
346
	  power management events; since these events are not very time-
347
	  critical, it should be sufficient to poll once or twice per second
348
	the critical resume notification is made after the system resumes
349
	  from an emergency suspension; normally, the system BIOS only notifies
350
	  its partner that it wishes to suspend and relies on the partner to
351
	  actually request the suspension, but no notification is made on an
352
	  emergency suspension
353
	should not be called from within a hardware interrupt handler to avoid
354
	  reentrance problems
355
SeeAlso: AX=5307h,AX=5307h/CX=0001h"STAND-BY",AX=5307h/CX=0002h"SUSPEND"
356
 
357
(Table 00479)
358
Values for APM event code:
359
 0001h	system stand-by request
360
 0002h	system suspend request
361
 0003h	normal resume system notification
362
 0004h	critical resume system notification
363
 0005h	battery low notification
364
---APM v1.1---
365
 0006h	power status change notification
366
 0007h	update time notification
367
 0008h	critical system suspend notification
368
 0009h	user system standby request notification
369
 000Ah	user system suspend request notification
370
 000Bh	system standby resume notification
371
---APM v1.2---
372
 000Ch	capabilities change notification (see AX=5310h)
373
------
374
 000Dh-00FFh reserved system events
375
 01xxh	reserved device events
376
 02xxh	OEM-defined APM events
377
 0300h-FFFFh reserved
378
--------p-15530C-----------------------------
379
INT 15 - Advanced Power Management v1.1+ - GET POWER STATE
380
	AX = 530Ch
381
	BX = device ID (see #00474)
382
Return: CF clear if successful
383
	    CX = system state ID (see #00475)
384
	CF set on error
385
	    AH = error code (01h,09h) (see #00473)
386
SeeAlso: AX=5307h
387
--------p-15530D-----------------------------
388
INT 15 - Advanced Power Management v1.1+ - EN/DISABLE DEVICE POWER MANAGEMENT
389
	AX = 530Dh
390
	BX = device ID (see #00474)
391
	CX = function
392
	    0000h disable power management
393
	    0001h enable power management
394
Return: CF clear if successful
395
	CF set on error
396
	    AH = error code (01h,03h,09h,0Ah,0Bh) (see #00473)
397
Desc:	specify whether automatic power management should be active for a
398
	  given device
399
SeeAlso: AX=5308h,AX=530Fh
400
--------p-15530E-----------------------------
401
INT 15 - Advanced Power Management v1.1+ - DRIVER VERSION
402
	AX = 530Eh
403
	BX = device ID of system BIOS (0000h)
404
	CH = APM driver major version (BCD)
405
	CL = APM driver minor version (BCD) (02h for APM v1.2)
406
Return: CF clear if successful
407
	    AH = APM connection major version (BCD)
408
	    AL = APM connection minor version (BCD)
409
	CF set on error
410
	    AH = error code (03h,09h,0Bh) (see #00473)
411
SeeAlso: AX=5300h,AX=5303h
412
--------p-15530F-----------------------------
413
INT 15 - Advanced Power Management v1.1+ - ENGAGE/DISENGAGE POWER MANAGEMENT
414
	AX = 530Fh
415
	BX = device ID (see #00474)
416
	CX = function
417
	    0000h disengage power management
418
	    0001h engage power management
419
Return: CF clear if successful
420
	CF set on error
421
	    AH = error code (01h,09h) (see #00473)
422
Notes:	unlike AX=5308h, this call does not affect the functioning of the APM
423
	  BIOS
424
	when cooperative power management is disengaged, the APM BIOS performs
425
	  automatic power management of the system or device
426
SeeAlso: AX=5308h,AX=530Dh
427
--------p-155310-----------------------------
428
INT 15 - Advanced Power Management v1.2 - GET CAPABILITIES
429
	AX = 5310h
430
	BX = device ID (see #00474)
431
	    0000h (APM BIOS)
432
	    other reserved
433
Return: CF clear if successful
434
	    BL = number of battery units supported (00h if no system batteries)
435
	    CX = capabilities flags (see #00480)
436
	CF set on error
437
	    AH = error code (01h,09h,86h) (see #00473)
438
Notes:	this function is supported via the INT 15, 16-bit protected mode, and
439
	  32-bit protected mode interfaces; it does not require that a
440
	  connection be established prior to use
441
	this function will return the capabilities currently in effect, not
442
	  any new settings which have been made but do not take effect until
443
	  a system restart
444
SeeAlso: AX=5300h,AX=530Fh,AX=5311h,AX=5312h,AX=5313h
445
 
446
Bitfields for APM v1.2 capabilities flags:
447
Bit(s)	Description	(Table 00480)
448
 15-8	reserved
449
 7	PCMCIA Ring Indicator will wake up system from suspend mode
450
 6	PCMCIA Ring Indicator will wake up system from standby mode
451
 5	Resume on Ring Indicator will wake up system from suspend mode
452
 4	Resume on Ring Indicator will wake up system from standby mode
453
 3	resume timer will wake up system from suspend mode
454
 2	resume timer will wake up system from standby mode
455
 1	can enter global suspend state
456
 
457
--------p-155311-----------------------------
458
INT 15 - Advanced Power Management v1.2 - GET/SET/DISABLE RESUME TIMER
459
	AX = 5311h
460
	BX = device ID (see #00474)
461
	    0000h (APM BIOS)
462
	    other reserved
463
	CL = function
464
	    00h disable Resume Timer
465
	    01h get Resume Timer
466
	    02h set Resume Timer
467
		CH = resume time, seconds (BCD)
468
		DL = resume time, minutes (BCD)
469
		DH = resume time, hours (BCD)
470
		SI = resume date (BCD), high byte = month, low byte = day
471
		DI = resume date, year (BCD)
472
Return: CF clear if successful
473
	    ---if getting timer---
474
	    CH = resume time, seconds (BCD)
475
	    DL = resume time, minutes (BCD)
476
	    DH = resume time, hours (BCD)
477
	    SI = resume date (BCD), high byte = month, low byte = day
478
	    DI = resume date, year (BCD)
479
	CF set on error
480
	    AH = error code (03h,09h,0Ah,0Bh,0Ch,0Dh,86h) (see #00473)
481
Notes:	this function is supported via the INT 15, 16-bit protected mode, and
482
	  32-bit protected mode interfaces
483
SeeAlso: AX=5300h,AX=5310h,AX=5312h,AX=5313h
484
--------p-155312-----------------------------
485
INT 15 - Advanced Power Management v1.2 - ENABLE/DISABLE RESUME ON RING
486
	AX = 5312h
487
	BX = device ID (see #00474)
488
	    0000h (APM BIOS)
489
	    other reserved
490
	CL = function
491
	    00h disable Resume on Ring Indicator
492
	    01h enable Resume on Ring Indicator
493
	    02h get Resume on Ring Indicator status
494
Return: CF clear if successful
495
	    CX = resume status (0000h disabled, 0001h enabled)
496
	CF set on error
497
	    AH = error code (03h,09h,0Ah,0Bh,0Ch,86h) (see #00473)
498
Notes:	this function is supported via the INT 15, 16-bit protected mode, and
499
	  32-bit protected mode interfaces
500
SeeAlso: AX=5300h,AX=5310h,AX=5311h,AX=5313h
501
--------p-155313-----------------------------
502
INT 15 - Advanced Power Management v1.2 - ENABLE/DISABLE TIMER-BASED REQUESTS
503
	AX = 5313h
504
	BX = device ID (see #00474)
505
	    0000h (APM BIOS)
506
	    other reserved
507
	CL = function
508
	    00h disable timer-based requests
509
	    01h enable timer-based requests
510
	    02h get timer-based requests status
511
Return: CF clear if successful
512
	    CX = timer-based requests status (0000h disabled, 0001h enabled)
513
	CF set on error
514
	    AH = error code (03h,09h,0Ah,0Bh,86h) (see #00473)
515
Notes:	this function is supported via the INT 15, 16-bit protected mode, and
516
	  32-bit protected mode interfaces
517
	some BIOSes set AH on return even when successful
518
SeeAlso: AX=5300h,AX=5310h,AX=5311h,AX=5312h