Changeset 42791 in vbox
- Timestamp:
- Aug 13, 2012 12:38:33 PM (12 years ago)
- Location:
- trunk/src/VBox/Devices/PC/BIOS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/apm.c
r42770 r42791 165 165 // @todo: change connection state 166 166 break; 167 case APM_PM_CONN: 168 // @todo: validate device ID 169 // @todo: validate current connection state 170 // @todo: change connection state 171 AX = APM_BIOS_SEG; /* 16-bit PM code segment (RM segment base). */ 172 BX = (uint16_t)apm_pm16_entry; /* 16-bit PM entry point offset. */ 173 CX = APM_BIOS_SEG; /* 16-bit data segment. */ 174 SI = APM_BIOS_SEG_LEN; /* 16-bit PM code segment length. */ 175 DI = APM_BIOS_SEG_LEN; /* Data segment length. */ 176 break; 167 177 case APM_32_CONN: 168 178 // @todo: validate device ID -
trunk/src/VBox/Devices/PC/BIOS/apm_pm.asm
r42770 r42791 124 124 125 125 126 ;; 16-bit protected mode APM entry point 127 128 ;; According to the APM spec, only CS (16-bit code selector) is defined. 129 ;; The data selector can be derived from it. 126 130 127 131 apm_pm16_entry: 128 stc 129 retf ; return to 16-bit caller 132 133 mov ah, 2 ; mark as originating in 16-bit PM 134 135 ; fall through 130 136 131 137 apm_pm16_entry_from_32: … … 144 150 pop ds ; restore registers 145 151 146 .386 147 retfd ; return to 32-bit code152 retf ; return to caller - 16-bit return 153 ; even to 32-bit thunk! 148 154 149 155 _TEXT ends … … 161 167 ;; selector and the data selector can be derived from it. 162 168 169 ;; WARNING: To simplify matters, we use 16-bit far return to go from 32-bit 170 ;; code to 16-bit and back. As a consequence, the 32-bit APM code must lie 171 ;; below 64K boundary in the 32-bit APM code segment. 172 163 173 apm_pm32_entry: 164 174 165 ; cli166 ; hlt167 168 175 push ebp ; ebp is not used by APM 169 176 170 push cs ; return address for 16-bit code 171 push apm_pm32_back 177 mov bp, cs ; return address for 16-bit code 178 push bp 179 mov ebp, apm_pm32_back 180 push bp ; Note: 16:16 address! 172 181 173 182 push cs 174 183 pop ebp 175 184 add ebp, 8 ; calculate 16-bit code selector 176 push ebp ; push 16-bit code selector 177 178 xor ebp, ebp ; manually pad 16-bit offset 179 push bp ; to a 32-bit value 180 push apm_pm16_entry_from_32 185 push bp ; push 16-bit code selector 186 187 mov ebp, apm_pm16_entry_from_32 188 push bp ; push 16-bit offset 181 189 182 190 mov ah, 3 ; mark as originating in 32-bit PM 191 192 db 66h ; force a 16-bit return 183 193 retf ; off to 16-bit code... 184 194 -
trunk/src/VBox/Devices/PC/BIOS/notes.txt
r42770 r42791 45 45 46 46 - PC DOS 6.x/7.x QCONFIG is a rare user of INT 16h fn 0Ah (read keyboard ID). 47 48 - DOS POWER.EXE uses the real mode APM interface, OS/2 APM.SYS uses the 16-bit 49 protected mode APM interface, and Windows 9x uses the 32-bit protected mode 50 APM interface. 47 51 48 52 - Windows 98 is one of the few APM 1.2 users; Windows 95 uses APM 1.1, while
Note:
See TracChangeset
for help on using the changeset viewer.