Subversion Repositories Kolibri OS

Rev

Rev 750 | Rev 785 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 750 Rev 770
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2007-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2007-2008. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 750 $
8
$Revision: 770 $
9
 
9
 
Line 10... Line 10...
10
; Virtual-8086 mode manager
10
; Virtual-8086 mode manager
Line 214... Line 214...
214
        mov     byte [BOOT_VAR + 0x503], 0xCD
214
        mov     byte [BOOT_VAR + 0x503], 0xCD
215
        mov     byte [BOOT_VAR + 0x504], 0x10
215
        mov     byte [BOOT_VAR + 0x504], 0x10
216
        mov     byte [BOOT_VAR + 0x505], 0xF4
216
        mov     byte [BOOT_VAR + 0x505], 0xF4
217
        mov     esi, eax
217
        mov     esi, eax
218
        mov     ebx, [eax+V86_machine.pagedir]
218
        mov     ebx, [eax+V86_machine.pagedir]
-
 
219
        mov     dword [ebx+0x9B*4+0x1000], 0x9B000 or 111b
-
 
220
        mov     dword [ebx+0x9B*4+0x1800], OS_BASE + 0x9B000
219
        mov     dword [ebx+0x9C*4+0x1000], 0x9C000 or 111b
221
        mov     dword [ebx+0x9C*4+0x1000], 0x9C000 or 111b
220
        mov     dword [ebx+0x9C*4+0x1800], OS_BASE + 0x9C000
222
        mov     dword [ebx+0x9C*4+0x1800], OS_BASE + 0x9C000
221
        mov     dword [ebx+0x9D*4+0x1000], 0x9D000 or 111b
223
        mov     dword [ebx+0x9D*4+0x1000], 0x9D000 or 111b
222
        mov     dword [ebx+0x9D*4+0x1800], OS_BASE + 0x9D000
224
        mov     dword [ebx+0x9D*4+0x1800], OS_BASE + 0x9D000
223
if ~DEBUG_SHOW_IO
225
if ~DEBUG_SHOW_IO
Line 547... Line 549...
547
        mov     eax, [esp+v86_regs.eflags]
549
        mov     eax, [esp+v86_regs.eflags]
548
        mov     [edx], ax
550
        mov     [edx], ax
549
        inc     word [esp+v86_regs.eip]
551
        inc     word [esp+v86_regs.eip]
550
        popad
552
        popad
551
        iretd
553
        iretd
-
 
554
.handle_pushfd:
-
 
555
        cmp     word [esp+v86_regs.esp], 4
-
 
556
        jae     @f
-
 
557
        mov     bl, 12          ; #SS exception
-
 
558
        jmp     .nogp
-
 
559
@@:
-
 
560
        movzx   edx, word [esp+v86_regs.ss]
-
 
561
        shl     edx, 4
-
 
562
        movzx   eax, word [esp+v86_regs.esp]
-
 
563
        sub     eax, 4
-
 
564
        add     edx, eax
-
 
565
        mov     eax, edx
-
 
566
        mov     esi, [esp+v86_regs.size+10h+4]
-
 
567
        call    v86_get_lin_addr
-
 
568
        cmp     eax, 0x1000
-
 
569
        jae     @f
-
 
570
        mov     bl, 14          ; #PF exception
-
 
571
        jmp     .nogp
-
 
572
@@:
-
 
573
        lea     eax, [edx+3]
-
 
574
        call    v86_get_lin_addr
-
 
575
        cmp     eax, 0x1000
-
 
576
        jae     @f
-
 
577
        mov     bl, 14          ; #PF exception
-
 
578
        jmp     .nogp
-
 
579
@@:
-
 
580
        sub     word [esp+v86_regs.esp], 4
-
 
581
        movzx   eax, word [esp+v86_regs.eflags]
-
 
582
        mov     [edx], eax
-
 
583
        add     word [esp+v86_regs.eip], 2
-
 
584
        popad
-
 
585
        iretd
552
.handle_popf:
586
.handle_popf:
553
        cmp     word [esp+v86_regs.esp], 0xFFFF
587
        cmp     word [esp+v86_regs.esp], 0xFFFF
554
        jnz     @f
588
        jnz     @f
555
        mov     bl, 12
589
        mov     bl, 12
556
        jmp     .nogp
590
        jmp     .nogp
Line 578... Line 612...
578
        mov     word [esp+v86_regs.eflags], ax
612
        mov     word [esp+v86_regs.eflags], ax
579
        add     word [esp+v86_regs.esp], 2
613
        add     word [esp+v86_regs.esp], 2
580
        inc     word [esp+v86_regs.eip]
614
        inc     word [esp+v86_regs.eip]
581
        popad
615
        popad
582
        iretd
616
        iretd
-
 
617
.handle_popfd:
-
 
618
        cmp     word [esp+v86_regs.esp], 0x10000 - 4
-
 
619
        jbe     @f
-
 
620
        mov     bl, 12
-
 
621
        jmp     .nogp
-
 
622
@@:
-
 
623
        movzx   edx, word [esp+v86_regs.ss]
-
 
624
        shl     edx, 4
-
 
625
        movzx   eax, word [esp+v86_regs.esp]
-
 
626
        add     edx, eax
-
 
627
        mov     eax, edx
-
 
628
        mov     esi, [esp+v86_regs.size+10h+4]
-
 
629
        call    v86_get_lin_addr
-
 
630
        cmp     eax, 0x1000
-
 
631
        jae     @f
-
 
632
        mov     bl, 14
-
 
633
        jmp     .nogp
-
 
634
@@:
-
 
635
        lea     eax, [edx+3]
-
 
636
        call    v86_get_lin_addr
-
 
637
        cmp     eax, 0x1000
-
 
638
        jae     @f
-
 
639
        mov     bl, 14
-
 
640
        jmp     .nogp
-
 
641
@@:
-
 
642
        mov     eax, [edx]
-
 
643
        mov     word [esp+v86_regs.eflags], ax
-
 
644
        add     word [esp+v86_regs.esp], 4
-
 
645
        add     word [esp+v86_regs.eip], 2
-
 
646
        popad
-
 
647
        iretd
583
.handle_cli:
648
.handle_cli:
584
        and     byte [esp+v86_regs.eflags+1], not 2
649
        and     byte [esp+v86_regs.eflags+1], not 2
585
        inc     word [esp+v86_regs.eip]
650
        inc     word [esp+v86_regs.eip]
586
        popad
651
        popad
587
        iretd
652
        iretd
Line 614... Line 679...
614
        jmp     .invalid_io
679
        jmp     .invalid_io
615
.handle_66:
680
.handle_66:
616
        cmp     word [esp+v86_regs.eip], 0xFFFF
681
        cmp     word [esp+v86_regs.eip], 0xFFFF
617
        jae     .nogp
682
        jae     .nogp
618
        lodsb
683
        lodsb
-
 
684
        cmp     al, 0x9C
-
 
685
        jz      .handle_pushfd
-
 
686
        cmp     al, 0x9D
-
 
687
        jz      .handle_popfd
619
        cmp     al, 0xEF
688
        cmp     al, 0xEF
620
        jz      .handle_out_dword
689
        jz      .handle_out_dword
621
        cmp     al, 0xED
690
        cmp     al, 0xED
622
        jz      .handle_in_dword
691
        jz      .handle_in_dword
623
        jmp     .nogp
692
        jmp     .nogp