VirtualBox

Changeset 59895 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Mar 2, 2016 12:40:59 PM (9 years ago)
Author:
vboxsync
Message:

bs3kit: Updates

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r59894 r59895  
    8282       bs3-cmn-PagingInitRootForPAE.c \
    8383       bs3-cmn-PagingInitRootForLM.c \
     84       bs3-cmn-SelProtFar32ToFlat32.c \
    8485       bs3-cmn-SlabInit.c \
    8586       bs3-cmn-SlabAlloc.c \
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SwitchTo16BitV86.asm

    r59894 r59895  
    3131BS3_EXTERN_DATA16   g_bBs3CurrentMode
    3232BS3_EXTERN_CMN      Bs3SwitchToRing0
     33BS3_EXTERN_CMN      Bs3SelProtFar32ToFlat32
    3334TMPL_BEGIN_TEXT
    3435
     
    3637;;
    3738; @cproto   BS3_DECL(void) Bs3SwitchTo16BitV86(void);
     39; @uses No general registers modified. Regment registers loaded with specific
     40;       values and the stack register converted to real mode (not ebp).
    3841;
    3942BS3_PROC_BEGIN_CMN Bs3SwitchTo16BitV86
    4043        ; Construct basic v8086 return frame.
    41         BS3_ONLY_16BIT_STMT push gs
    42         BS3_ONLY_16BIT_STMT movzx esp, sp
    43         push    dword fs
     44        BS3_ONLY_16BIT_STMT movzx   esp, sp
     45        push    dword 0                 ; GS
     46        push    dword 0                 ; FS
    4447        push    dword BS3_SEL_DATA16    ; ES
    4548        push    dword BS3_SEL_DATA16    ; DS
    46         push    dword ss
     49        push    dword 0                 ; SS - later
    4750        push    dword 0                 ; return ESP, later.
    4851        pushfd
     
    5760        ; Save registers and stuff.
    5861        push    eax
    59  %if TMPL_BITS == 16
     62        push    edx
     63        push    ecx
     64        push    ebx
     65%if TMPL_BITS == 16
    6066        push    ds
    6167
     
    6975
    7076        pop     ds
     77        pop     ebx
     78        pop     ecx
     79        pop     edx
    7180        pop     eax
    7281        add     xSP, (9-1)*4
     
    91100        ; Set GS.
    92101        mov     ax, gs
    93         mov     [xSP + 4 + 20h], ax
     102        mov     [xSP + 4*4 + 20h], ax
    94103 %endif
    95104
    96         ; Thunk SS:ESP, first step: calc flat address.
    97         lea     eax, [esp + 4 + 24h]
     105        ; Thunk SS:ESP to real-mode address via 32-bit flat.
     106        lea     eax, [esp + 4*4 + 24h]
     107        push    ss
    98108        push    eax
    99         push    ss
    100 ;        call    Bs3SelFar32ToFlat32
    101 
    102         ; Second step: Calc realmode segment and offset.
    103 
     109        BS3_CALL Bs3SelProtFar32ToFlat32, 2
     110        mov     [esp + 4*4 + 0ch], ax   ; high word is already zero
     111 %if TMPL_BITS == 16
     112        mov     [esp + 4*4 + 10h], dx
     113 %else
     114        shr     eax, 16
     115        mov     [esp + 4*4 + 10h], ax
     116 %endif
    104117
    105118        ; Return to v8086 mode.
     119        pop     ebx
     120        pop     ecx
     121        pop     edx
    106122        pop     eax
    107123        iretd
    108 BS3_PROC_END_CMN   Bs3SwitchTo16Bit
    109 
    110 
     124BS3_PROC_END_CMN   Bs3SwitchTo16BitV86
    111125
    112126%endif ; ! 64-bit
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r59879 r59895  
    13091309
    13101310
     1311/**
     1312 * Converts a protected mode 32-bit far pointer to a 32-bit flat address.
     1313 *
     1314 * @returns 32-bit flat address.
     1315 * @param   off             The segment offset.
     1316 * @param   uSel            The protected mode segment selector.
     1317 */
     1318BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32_c16(uint32_t off, uint16_t uSel);
     1319BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32_c32(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelProtFar32ToFlat32_c16 */
     1320BS3_DECL(uint32_t) Bs3SelProtFar32ToFlat32_c64(uint32_t off, uint16_t uSel); /**< @copydoc Bs3SelProtFar32ToFlat32_c16 */
     1321#define Bs3SelProtFar32ToFlat32 BS3_CMN_NM(Bs3SelProtFar32ToFlat32) /**< Selects #Bs3SelProtFar32ToFlat32_c16, #Bs3SelProtFar32ToFlat32_c32 or #Bs3SelProtFar32ToFlat32_c64. */
     1322
    13111323
    13121324/**
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