Rev 1161 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1161 | Rev 1198 | ||
---|---|---|---|
Line 349... | Line 349... | ||
349 | 349 | ||
350 | ; It is only possible to leave virtual-8086 mode by faulting to |
350 | ; It is only possible to leave virtual-8086 mode by faulting to |
351 | ; a protected-mode interrupt handler (typically the general-protection |
351 | ; a protected-mode interrupt handler (typically the general-protection |
Line 352... | Line -... | ||
352 | ; exception handler, which in turn calls the virtual 8086-mode monitor). |
- | |
353 | - | ||
354 | v86_debug_exc: |
- | |
355 | pushad |
- | |
356 | xor eax, eax |
- | |
357 | mov dr6, eax |
- | |
358 | mov bl, 1 |
- | |
359 | jmp v86_exc_c |
- | |
360 | - | ||
361 | v86_page_fault: |
- | |
362 | add esp, 4 |
- | |
363 | pushad |
- | |
364 | mov bl, 14 |
- | |
365 | jmp v86_exc_c |
- | |
366 | - | ||
367 | v86_except_16: |
- | |
368 | pushad |
- | |
369 | mov bl, 16 |
- | |
370 | jmp v86_exc_c |
- | |
371 | v86_except_19: |
- | |
372 | pushad |
- | |
373 | mov bl, 19 |
352 | ; exception handler, which in turn calls the virtual 8086-mode monitor). |
374 | 353 | ||
375 | iglobal |
354 | iglobal |
376 | v86_exc_str1 db 'V86 : unexpected exception ',0 |
355 | v86_exc_str1 db 'V86 : unexpected exception ',0 |
377 | v86_exc_str2 db ' at ',0 |
356 | v86_exc_str2 db ' at ',0 |
Line 385... | Line 364... | ||
385 | v86_io_dword db ' (dword)',13,10,0 |
364 | v86_io_dword db ' (dword)',13,10,0 |
386 | v86_irqerr db 'V86 : IRQ already hooked',13,10,0 |
365 | v86_irqerr db 'V86 : IRQ already hooked',13,10,0 |
387 | endg |
366 | endg |
Line 388... | Line 367... | ||
388 | 367 | ||
389 | v86_exc_c: |
- | |
390 | mov ax, app_data |
- | |
391 | mov ds, ax |
- | |
392 | mov es, ax |
368 | v86_exc_c: |
- | 369 | ; Did we all that we have wanted to do? |
|
- | 370 | cmp bl,1 |
|
- | 371 | jne @f |
|
- | 372 | xor eax, eax |
|
393 | ; Did we all that we have wanted to do? |
373 | mov dr6, eax |
394 | mov eax, [esp+v86_regs.size+10h+18h] |
374 | @@: mov eax, [esp+v86_regs.size+10h+18h] |
395 | cmp word [esp+v86_regs.eip], ax |
375 | cmp word [esp+v86_regs.eip], ax |
396 | jnz @f |
376 | jnz @f |
397 | shr eax, 16 |
377 | shr eax, 16 |
398 | cmp word [esp+v86_regs.cs], ax |
378 | cmp word [esp+v86_regs.cs], ax |
Line 943... | Line 923... | ||
943 | mov cx, [eax*4] |
923 | mov cx, [eax*4] |
944 | mov word [esi-v86_regs.size+v86_regs.eip], cx |
924 | mov word [esi-v86_regs.size+v86_regs.eip], cx |
945 | mov cx, [eax*4+2] |
925 | mov cx, [eax*4+2] |
946 | mov word [esi-v86_regs.size+v86_regs.cs], cx |
926 | mov word [esi-v86_regs.size+v86_regs.cs], cx |
947 | and byte [esi-v86_regs.size+v86_regs.eflags+1], not 3 |
927 | and byte [esi-v86_regs.size+v86_regs.eflags+1], not 3 |
948 | push ebx |
- | |
949 | call update_counters |
928 | call update_counters |
950 | pop ebx |
929 | lea edi, [ebx + 0x100000000 - SLOT_BASE] |
951 | sub ebx, SLOT_BASE |
930 | shr edi, 3 |
952 | shr ebx, 8 |
931 | add edi, TASK_DATA |
953 | mov esi, [CURRENT_TASK] |
932 | call find_next_task.found |
954 | call do_change_task |
933 | call do_change_task |
955 | popad |
934 | popad |
956 | iretd |
935 | iretd |