VirtualBox

Changeset 44107 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Dec 12, 2012 2:10:08 PM (12 years ago)
Author:
vboxsync
Message:

BIOS: Reset CPU if POST entered in V86 mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/orgs.asm

    r44058 r44107  
    215215                ret
    216216
     217                ;; routine to write the pointer in DX:AX to memory starting
     218                ;; at DS:BX (repeat CX times)
     219                ;; - modifies BX, CX
     220set_int_vects   proc    near
     221
     222                mov     [bx], ax
     223                mov     [bx+2], dx
     224                add     bx, 4
     225                loop    set_int_vects
     226                ret
     227
     228set_int_vects   endp
     229
    217230;; --------------------------------------------------------
    218231;; POST entry point
     
    220233                BIOSORG 0E05Bh
    221234post:
     235                cli
     236
     237                ;; Check if in protected (V86) mode. If so, the CPU needs
     238                ;; to be reset.
     239                smsw    ax
     240                test    ax, 1
     241                jz      in_real_mode
     242
     243                ;; Reset processor to get out of protected mode. Use system
     244                ;; port instead of KBC.
     245                ;; NB: We only need bit 0 to be set in AL, which we just
     246                ;; determined to be the case.
     247                out     92h, al
     248                jmp     $               ; not strictly necessary in a VM
     249               
     250               
     251in_real_mode:
     252                ;; TODO: This looks very iffy - we shouldn't mess with any
     253                ;; hardware until after we've established that cold boot
     254                ;; needs to be done.
     255               
    222256                xor     ax, ax
    223257
     
    263297                jmp     normal_post
    264298
    265 
    266                 ;; routine to write the pointer in DX:AX to memory starting
    267                 ;; at DS:BX (repeat CX times)
    268                 ;; - modifies BX, CX
    269 set_int_vects   proc    near
    270 
    271                 mov     [bx], ax
    272                 mov     [bx+2], dx
    273                 add     bx, 4
    274                 loop    set_int_vects
    275                 ret
    276 
    277 set_int_vects   endp
    278 
    279299normal_post:
    280300                ;; shutdown code 0: normal startup
    281                 cli
     301
    282302                ;; Set up the stack top at 0:7800h. The stack should not be
    283303                ;; located above 0:7C00h; that conflicts with PXE, which
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette