Rev 1329 | Rev 1334 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1329 | Rev 1330 | ||
---|---|---|---|
Line 55... | Line 55... | ||
55 | ;; |
55 | ;; |
56 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
56 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 57... | Line 57... | ||
57 | 57 | ||
Line 58... | Line 58... | ||
58 | include 'macros.inc' |
58 | include 'macros.inc' |
Line 59... | Line 59... | ||
59 | 59 | ||
Line 60... | Line 60... | ||
60 | $Revision: 1329 $ |
60 | $Revision: 1330 $ |
Line 5476... | Line 5476... | ||
5476 | 5476 | ||
5477 | .epic_fail: |
5477 | .epic_fail: |
Line 5478... | Line 5478... | ||
5478 | hlt ; Houston, we've had a problem |
5478 | hlt ; Houston, we've had a problem |
- | 5479 | ||
5479 | 5480 | ; --------------- APM --------------------- |
|
5480 | ; --------------- APM --------------------- |
5481 | uglobal |
- | 5482 | apm_entry dp 0 |
|
- | 5483 | apm_vf dd 0 |
|
5481 | apm_entry dp 0 |
5484 | endg |
5482 | apm_vf dd 0 |
5485 | |
- | 5486 | align 4 |
|
5483 | align 4 |
5487 | sys_apm: |
5484 | sys_apm: |
5488 | xor eax,eax |
- | 5489 | cmp word [apm_vf], ax ; Check APM BIOS enable |
|
5485 | cmp word [apm_vf], 0 ; Check APM BIOS enable |
5490 | jne @f |
- | 5491 | inc eax |
|
5486 | jne @f |
5492 | or dword [esp + 44], eax ; error |
5487 | or [esp + 48], byte 1 ; error |
5493 | add eax,7 |
Line 5488... | Line 5494... | ||
5488 | mov [esp + 36], dword 8 ; 32-bit protected-mode interface not supported |
5494 | mov dword [esp + 32], eax ; 32-bit protected-mode interface not supported |
5489 | ret |
5495 | ret |
5490 | 5496 | ||
Line 5491... | Line 5497... | ||
5491 | @@: |
5497 | @@: |
5492 | xchg eax, ecx |
5498 | ; xchg eax, ecx |
5493 | xchg ebx, ecx |
5499 | ; xchg ebx, ecx |
5494 | 5500 | ||
5495 | cmp al, 3 |
- | |
5496 | ja @f |
- | |
5497 | and [esp + 48], byte 0xfe ; emulate func 0..3 as func 0 |
5501 | cmp dx, 3 |
- | 5502 | ja @f |
|
- | 5503 | and [esp + 44], byte 0xfe ; emulate func 0..3 as func 0 |
|
5498 | mov eax, [apm_vf] |
5504 | mov eax,[apm_vf] |
Line 5499... | Line 5505... | ||
5499 | mov [esp + 36], eax |
5505 | mov [esp + 32], eax |
Line 5500... | Line 5506... | ||
5500 | shr eax, 16 |
5506 | shr eax, 16 |
Line 5515... | Line 5521... | ||
5515 | mov [master_tab], eax |
5521 | mov [master_tab], eax |
5516 | mov eax, cr3 |
5522 | mov eax, cr3 |
5517 | mov cr3, eax |
5523 | mov cr3, eax |
5518 | pop eax |
5524 | pop eax |
Line 5519... | Line 5525... | ||
5519 | 5525 | ||
5520 | mov [esp + 8 ], edi |
5526 | mov [esp + 4 ], edi |
5521 | mov [esp + 12], esi |
5527 | mov [esp + 8], esi |
5522 | mov [esp + 24], ebx |
5528 | mov [esp + 20], ebx |
5523 | mov [esp + 28], edx |
5529 | mov [esp + 24], edx |
5524 | mov [esp + 32], ecx |
5530 | mov [esp + 28], ecx |
5525 | mov [esp + 36], eax |
5531 | mov [esp + 32], eax |
5526 | setc al |
5532 | setc al |
5527 | and [esp + 48], byte 0xfe |
5533 | and [esp + 44], byte 0xfe |
5528 | or [esp + 48], al |
- | |
5529 | - | ||
5530 | 5534 | or [esp + 44], al |
|
5531 | ret |
5535 | ret |
Line 5532... | Line 5536... | ||
5532 | ; ----------------------------------------- |
5536 | ; ----------------------------------------- |