VirtualBox

Changeset 60441 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 11, 2016 9:15:40 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106527
Message:

PCBIOS: 8086 adjustments.

Location:
trunk/src/VBox/Devices
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/BiosCommonCode/commondefs.inc

    r60433 r60441  
    4646
    4747
     48;;
     49; Pretends to do a call by pushing the return address and jumping
     50; to the function.
     51;
     52; This is slightly problematic on 8086 since it doesn't support pushing
     53; word immediates. OTOH, it support pushing memory, so we'll do that
     54; instead when targeting 8086.
     55;
     56if 0 ;; this crap crashes wasm, makes it call exit(0), or similar weird stuff.
     57     ;; switched to a simpler approach where I define the one return address variable myself.
     58DO_JMP_CALL     macro calling, returning
     59 if VBOX_BIOS_CPU gt 8086
     60        push    returning
     61        jmp     calling
     62 else
     63        push    word ptr cs:[%jmp_call_addr_&returning]
     64        jmp     calling
     65;public jmp_call_addr_&returning
     66%jmp_call_addr_&returning: dw offset retaddr
     67 endif
     68endm
     69
     70DO_JMP_CALL_AGAIN macro calling, returning
     71 if VBOX_BIOS_CPU gt 8086
     72        push    returning
     73        jmp     calling
     74 else
     75        push    word ptr cs:[%jmp_call_addr_&returning]
     76        jmp     calling
     77 endif
     78endm
     79
     80else  ; Simplified.
     81DO_JMP_CALL_EX  macro calling, returning, returning_ptr_var
     82 if VBOX_BIOS_CPU gt 8086
     83        push    returning
     84        jmp     calling
     85  else
     86        push    word ptr cs:[returning_ptr_var]
     87        jmp     calling
     88  endif
     89endm
     90
     91endif ; Simplified.
     92
     93
    4894;; For handling the pusha instruction depending on target CPU.
    49 DO_PUSHA        macro
    50  if VBOX_BIOS_CPU eq 8086
     95DO_pusha        macro
     96 if VBOX_BIOS_CPU gt 8086
     97        pusha
     98 else
    5199        push    ax
    52100        push    cx
     
    57105        push    si
    58106        push    di
    59  else
    60         pusha
    61107 endif
    62108endm
     
    64110
    65111;; For handling the popad/popa instruction depending on target CPU.
    66 DO_POPA         macro
    67  if VBOX_BIOS_CPU eq 8086
     112DO_popa         macro
     113 if VBOX_BIOS_CPU gt 8086
     114        popa
     115 else
    68116        pop     di
    69117        pop     si
     
    74122        pop     cx
    75123        pop     ax
    76  else
    77         popa
    78124 endif
    79125endm
     
    82128;; For handling the pushad/pusha instruction depending on target CPU.
    83129DO_PUSHAD       macro
    84  if VBOX_BIOS_CPU eq 8086
     130 if VBOX_BIOS_CPU ge 80386
     131        pushad
     132 elseif VBOX_BIOS_CPU gt 8086
     133        pusha
     134 else
    85135        push    ax
    86136        push    cx
     
    91141        push    si
    92142        push    di
    93  elseif VBOX_BIOS_CPU lt 80386
    94         pusha
    95  else
    96         pushad
    97143 endif
    98144endm
     
    101147;; For handling the popad/popa instruction depending on target CPU.
    102148DO_POPAD        macro
    103  if VBOX_BIOS_CPU eq 8086
     149 if VBOX_BIOS_CPU ge 80386
     150        popad
     151 elseif VBOX_BIOS_CPU gt 8086
     152        popa
     153 else
    104154        pop     di
    105155        pop     si
     
    110160        pop     cx
    111161        pop     ax
    112  elseif VBOX_BIOS_CPU lt 80386
    113         popa
    114  else
    115         popad
    116  endif
    117 endm
     162 endif
     163endm
     164
     165
     166;; ASSUMES working stack.
     167DO_shr          macro reg, count
     168 if VBOX_BIOS_CPU ge 80186
     169        shr     reg, count
     170 else
     171  if count ge 6
     172        push    cx
     173        mov     cl, count
     174        shr     reg, cl
     175        pop     cx
     176  else
     177   if count ge 5
     178        shr     reg, 1
     179   endif
     180   if count ge 4
     181        shr     reg, 1
     182   endif
     183   if count ge 3
     184        shr     reg, 1
     185   endif
     186   if count ge 2
     187        shr     reg, 1
     188   endif
     189   if count ge 1
     190        shr     reg, 1
     191   endif
     192  endif
     193 endif
     194endm
     195
     196
     197;; ASSUMES working stack.
     198DO_shl          macro reg, count
     199 if VBOX_BIOS_CPU ge 80186
     200        shl     reg, count
     201 else
     202  if count ge 6
     203        push    cx
     204        mov     cl, count
     205        shl     reg, cl
     206        pop     cx
     207  else
     208   if count ge 5
     209        shl     reg, 1
     210   endif
     211   if count ge 4
     212        shl     reg, 1
     213   endif
     214   if count ge 3
     215        shl     reg, 1
     216   endif
     217   if count ge 2
     218        shl     reg, 1
     219   endif
     220   if count ge 1
     221        shl     reg, 1
     222   endif
     223  endif
     224 endif
     225endm
     226
     227
    118228
    119229
  • trunk/src/VBox/Devices/Graphics/BIOS/vberom.asm

    r60422 r60441  
    801801endif
    802802set_palette_data:
    803   DO_PUSHAD
     803  DO_pushad
    804804  push  ds
    805805  push  es
     
    831831  loop  set_pal_loop
    832832  pop   ds
    833   DO_POPAD
     833  DO_popad
    834834vbe_09_ok:
    835835  mov  ax, 004Fh
     
    837837
    838838get_palette_data:
    839   DO_PUSHAD
     839  DO_pushad
    840840  mov   al, dl
    841841  mov   dx, VGAREG_DAC_READ_ADDRESS
     
    864864endif
    865865  loop  get_pal_loop
    866   DO_POPAD
     866  DO_popad
    867867  jmp   vbe_09_ok
    868868
  • trunk/src/VBox/Devices/Graphics/BIOS/vgarom.asm

    r60422 r60441  
    8787  push es
    8888  push ds
    89   DO_PUSHA
     89  DO_pusha
    9090  mov   bx, 0C000h
    9191  mov   ds, bx
    9292  call _int10_debugmsg
    93   DO_POPA
     93  DO_popa
    9494  pop ds
    9595  pop es
     
    200200  push es
    201201  push ds
    202   DO_PUSHA
     202  DO_pusha
    203203
    204204;; We have to set ds to access the right data segment
     
    207207  call _int10_func
    208208
    209   DO_POPA
     209  DO_popa
    210210  pop ds
    211211  pop es
  • trunk/src/VBox/Devices/PC/BIOS/Makefile.kmk

    r60426 r60441  
    9090 VBoxPcBios8086_EXTENDS = VBoxPcBios386
    9191 VBoxPcBios8086_CFLAGS  = -0
    92  VBoxPcBios8086_DEFS    = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=80186 ## @todo get it working as 8086!
     92 VBoxPcBios8086_DEFS    = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxPcBios386_DEFS)) VBOX_BIOS_CPU=8086
    9393
    9494
  • trunk/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative386.asm

    r60422 r60441  
    1539915399
    1540015400section BIOSSEG progbits vstart=0xe000 align=1 ; size=0x2000 class=CODE group=AUTO
    15401     db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
    15402     db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
    15403     db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 058h, 04dh
     15401biosorg_check_before_or_at_0E02Eh:           ; 0xfe000 LB 0x30
     15402    times 0x2e db 0
     15403    db  'XM'
    1540415404eoi_both_pics:                               ; 0xfe030 LB 0x4
    1540515405    mov AL, strict byte 020h                  ; b0 20
     
    1541515415    loop 0e039h                               ; e2 f6
    1541615416    retn                                      ; c3
    15417 eoi_jmp_post:                                ; 0xfe044 LB 0x17
     15417eoi_jmp_post:                                ; 0xfe044 LB 0xb
    1541815418    call 0e030h                               ; e8 e9 ff
    1541915419    db  033h, 0c0h
     
    1542115421    mov ds, ax                                ; 8e d8
    1542215422    jmp far [00467h]                          ; ff 2e 67 04
     15423biosorg_check_before_or_at_0E059h:           ; 0xfe04f LB 0xc
    1542315424    times 0xa db 0
    1542415425    db  'XM'
     
    1547915480    je short 0e047h                           ; 74 85
    1548015481    jmp short 0e0c4h                          ; eb 00
    15481 normal_post:                                 ; 0xfe0c4 LB 0x1ff
     15482normal_post:                                 ; 0xfe0c4 LB 0x1f6
    1548215483    mov ax, 07800h                            ; b8 00 78
    1548315484    db  08bh, 0e0h
     
    1568015681    call 0edbfh                               ; e8 07 0b
    1568115682    jmp short 0e31bh                          ; eb 61
     15683biosorg_check_before_or_at_0E2C1h:           ; 0xfe2ba LB 0x9
    1568215684    add byte [bx+si], al                      ; 00 00
    1568315685    add byte [bx+si], al                      ; 00 00
     
    1569515697    int 002h                                  ; cd 02
    1569615698    iret                                      ; cf
    15697 hard_drive_post:                             ; 0xfe2d2 LB 0x12c
     15699hard_drive_post:                             ; 0xfe2d2 LB 0xbd
    1569815700    db  033h, 0c0h
    1569915701    ; xor ax, ax                                ; 33 c0
     
    1577515777    sti                                       ; fb
    1577615778    retf 00002h                               ; ca 02 00
     15779biosorg_check_before_or_at_0E3FCh:           ; 0xfe38f LB 0x6f
    1577715780    times 0x6d db 0
    1577815781    db  'XM'
     
    1583015833int19_handler:                               ; 0xfe6f2 LB 0x3
    1583115834    jmp near 0f0ach                           ; e9 b7 09
    15832 biosorg_check_0E6F5h:                        ; 0xfe6f5 LB 0x34
     15835biosorg_check_at_0E6F5h:                     ; 0xfe6f5 LB 0xa
    1583315836    or word [bx+si], ax                       ; 09 00
    1583415837    cld                                       ; fc
    1583515838    add byte [bx+di], al                      ; 00 01
    1583615839    je short 0e73ch                           ; 74 40
    15837     times 0x2b db 0
     15840    times 0x3 db 0
     15841biosorg_check_before_or_at_0E727h:           ; 0xfe6ff LB 0x2a
     15842    times 0x28 db 0
    1583815843    db  'XM'
    15839 biosorg_check_0E729h:                        ; 0xfe729 LB 0x10
     15844biosorg_check_at_0E729h:                     ; 0xfe729 LB 0x10
    1584015845    times 0xe db 0
    1584115846    db  'XM'
    15842 biosorg_check_0E739h:                        ; 0xfe739 LB 0x1a
     15847biosorg_check_at_0E739h:                     ; 0xfe739 LB 0x1a
    1584315848    push DS                                   ; 1e
    1584415849    push ES                                   ; 06
     
    1588315888    out strict byte 0a1h, AL                  ; e6 a1
    1588415889    retn                                      ; c3
    15885 ebda_post:                                   ; 0xfe778 LB 0xb6
     15890ebda_post:                                   ; 0xfe778 LB 0x45
    1588615891    mov ax, 0e746h                            ; b8 46 e7
    1588715892    mov word [00034h], ax                     ; a3 34 00
     
    1590815913    mov word [0040eh], 09fc0h                 ; c7 06 0e 04 c0 9f
    1590915914    retn                                      ; c3
     15915biosorg_check_before_or_at_0E82Ch:           ; 0xfe7bd LB 0x71
    1591015916    times 0x6f db 0
    1591115917    db  'XM'
    15912 biosorg_check_0E82Eh:                        ; 0xfe82e LB 0x36
     15918biosorg_check_at_0E82Eh:                     ; 0xfe82e LB 0x36
    1591315919    sti                                       ; fb
    1591415920    push ES                                   ; 06
     
    1597115977    db  000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
    1597215978    db  0ffh, 0ffh, 000h, 004h, 000h, 093h, 000h, 000h
    15973 pmode_setup:                                 ; 0xfe8e0 LB 0xa7
     15979pmode_setup:                                 ; 0xfe8e0 LB 0x5c
    1597415980    push eax                                  ; 66 50
    1597515981    push esi                                  ; 66 56
     
    1599816004    pop eax                                   ; 66 58
    1599916005    retn                                      ; c3
     16006biosorg_check_before_or_at_0E985h:           ; 0xfe93c LB 0x4b
    1600016007    times 0x49 db 0
    1600116008    db  'XM'
    16002 biosorg_check_0E987h:                        ; 0xfe987 LB 0x2d2
     16009biosorg_check_at_0E987h:                     ; 0xfe987 LB 0x5c
    1600316010    cli                                       ; fa
    1600416011    push ax                                   ; 50
     
    1605816065    popaw                                     ; 61
    1605916066    iret                                      ; cf
     16067biosorg_check_before_or_at_0EC57h:           ; 0xfe9e3 LB 0x276
    1606016068    times 0x274 db 0
    1606116069    db  'XM'
    16062 biosorg_check_0EC59h:                        ; 0xfec59 LB 0x2
     16070biosorg_check_at_0EC59h:                     ; 0xfec59 LB 0x2
    1606316071    jmp short 0ecb0h                          ; eb 55
    1606416072int13_relocated:                             ; 0xfec5b LB 0x55
     
    1626716275    aad 00ah                                  ; d5 0a
    1626816276    retn                                      ; c3
    16269 rtc_post:                                    ; 0xfedbf LB 0x198
     16277rtc_post:                                    ; 0xfedbf LB 0x77
    1627016278    db  066h, 033h, 0c0h
    1627116279    ; xor eax, eax                              ; 66 33 c0
     
    1631516323    mov byte [00470h], AL                     ; a2 70 04
    1631616324    retn                                      ; c3
     16325biosorg_check_before_or_at_0EF55h:           ; 0xfee36 LB 0x121
    1631716326    times 0x11f db 0
    1631816327    db  'XM'
    16319 int0e_handler:                               ; 0xfef57 LB 0x70
     16328int0e_handler:                               ; 0xfef57 LB 0x3b
    1632016329    push ax                                   ; 50
    1632116330    push dx                                   ; 52
     
    1635016359    pop ax                                    ; 58
    1635116360    iret                                      ; cf
     16361biosorg_check_before_or_at_0EFC5h:           ; 0xfef92 LB 0x35
    1635216362    times 0x33 db 0
    1635316363    db  'XM'
     
    1636116371    db  0f6h
    1636216372    invd                                      ; 0f 08
    16363 biosorg_check_0EFD2h:                        ; 0xfefd2 LB 0x2
     16373biosorg_check_at_0EFD2h:                     ; 0xfefd2 LB 0x2
    1636416374    jmp short 0efd4h                          ; eb 00
    1636516375int17_handler:                               ; 0xfefd4 LB 0xd
     
    1637916389_rmode_IDT:                                  ; 0xfefe7 LB 0x6
    1638016390    db  0ffh, 003h, 000h, 000h, 000h, 000h
    16381 int1c_handler:                               ; 0xfefed LB 0x58
     16391int1c_handler:                               ; 0xfefed LB 0x1
    1638216392    iret                                      ; cf
     16393biosorg_check_before_or_at_0F043h:           ; 0xfefee LB 0x57
    1638316394    times 0x55 db 0
    1638416395    db  'XM'
    16385 biosorg_check_0F045h:                        ; 0xff045 LB 0x20
     16396biosorg_check_at_0F045h:                     ; 0xff045 LB 0x1
    1638616397    iret                                      ; cf
     16398biosorg_check_before_or_at_0F063h:           ; 0xff046 LB 0x1f
    1638716399    times 0x1d db 0
    1638816400    db  'XM'
    16389 int10_handler:                               ; 0xff065 LB 0x3f
     16401int10_handler:                               ; 0xff065 LB 0x1
    1639016402    iret                                      ; cf
     16403biosorg_check_before_or_at_0F0A2h:           ; 0xff066 LB 0x3e
    1639116404    times 0x3c db 0
    1639216405    db  'XM'
    16393 biosorg_check_0F0A4h:                        ; 0xff0a4 LB 0x8
     16406biosorg_check_at_0F0A4h:                     ; 0xff0a4 LB 0x8
    1639416407    push CS                                   ; 0e
    1639516408    pop DS                                    ; 1f
     
    1669216705    db  000h, 0e8h, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 01ch, 000h
    1669316706    db  000h, 0f0h, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 01dh, 000h
    16694 _pci_routing_table_size:                     ; 0xff4a0 LB 0x3a1
     16707_pci_routing_table_size:                     ; 0xff4a0 LB 0x2
    1669516708    loopne 0f4a3h                             ; e0 01
     16709biosorg_check_before_or_at_0F83Fh:           ; 0xff4a2 LB 0x39f
    1669616710    times 0x39d db 0
    1669716711    db  'XM'
     
    1678816802    popaw                                     ; 61
    1678916803    iret                                      ; cf
    16790 int76_handler:                               ; 0xff8d7 LB 0x197
     16804int76_handler:                               ; 0xff8d7 LB 0x12
    1679116805    push ax                                   ; 50
    1679216806    push DS                                   ; 1e
     
    1679816812    pop ax                                    ; 58
    1679916813    iret                                      ; cf
     16814biosorg_check_before_or_at_0FA6Ch:           ; 0xff8e9 LB 0x185
    1680016815    times 0x183 db 0
    1680116816    db  'XM'
     
    1686516880    db  018h, 018h, 018h, 000h, 018h, 018h, 018h, 000h, 0e0h, 030h, 030h, 01ch, 030h, 030h, 0e0h, 000h
    1686616881    db  076h, 0dch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 000h
    16867 biosorg_check_0FE6Eh:                        ; 0xffe6e LB 0x21
     16882biosorg_check_at_0FE6Eh:                     ; 0xffe6e LB 0x21
    1686816883    cmp ah, 0b1h                              ; 80 fc b1
    1686916884    jne short 0fe82h                          ; 75 0f
     
    1689016905    pop ES                                    ; 07
    1689116906    iret                                      ; cf
    16892 int70_handler:                               ; 0xffe8f LB 0x16
     16907int70_handler:                               ; 0xffe8f LB 0xd
    1689316908    push ES                                   ; 06
    1689416909    push DS                                   ; 1e
     
    1690216917    pop ES                                    ; 07
    1690316918    iret                                      ; cf
     16919biosorg_check_before_or_at_0FEA3h:           ; 0xffe9c LB 0x9
    1690416920    add byte [bx+si], al                      ; 00 00
    1690516921    add byte [bx+si], al                      ; 00 00
    1690616922    add byte [bx+si], al                      ; 00 00
    1690716923    add byte [bx+si+04dh], bl                 ; 00 58 4d
    16908 int08_handler:                               ; 0xffea5 LB 0x4e
     16924int08_handler:                               ; 0xffea5 LB 0x43
    1690916925    sti                                       ; fb
    1691016926    push eax                                  ; 66 50
     
    1694016956    pop eax                                   ; 66 58
    1694116957    iret                                      ; cf
     16958biosorg_check_before_or_at_0FEF1h:           ; 0xffee8 LB 0xb
    1694216959    times 0x9 db 0
    1694316960    db  'XM'
    16944 biosorg_check_0FEF3h:                        ; 0xffef3 LB 0xd
     16961biosorg_check_at_0FEF3h:                     ; 0xffef3 LB 0xd
    1694516962    times 0xb db 0
    1694616963    db  'XM'
    16947 biosorg_check_0FF00h:                        ; 0xfff00 LB 0x53
     16964biosorg_check_at_0FF00h:                     ; 0xfff00 LB 0x19
    1694816965    dec di                                    ; 4f
    1694916966    jc short 0ff64h                           ; 72 61
     
    1696116978    dec di                                    ; 4f
    1696216979    push bx                                   ; 53
     16980biosorg_check_before_or_at_0FF51h:           ; 0xfff19 LB 0x3a
    1696316981    times 0x38 db 0
    1696416982    db  'XM'
    1696516983dummy_iret:                                  ; 0xfff53 LB 0x1
    1696616984    iret                                      ; cf
    16967 biosorg_check_0FF54h:                        ; 0xfff54 LB 0x9c
     16985biosorg_check_at_0FF54h:                     ; 0xfff54 LB 0x2c
    1696816986    iret                                      ; cf
    1696916987    mov ax, ax                                ; 89 c0
     
    1699317011    add byte [bx+si], al                      ; 00 00
    1699417012    add byte [di], ah                         ; 00 25
    16995     times 0x6f db 0
     17013    times 0x1 db 0
     17014biosorg_check_before_or_at_0FFEEh:           ; 0xfff80 LB 0x70
     17015    times 0x6e db 0
    1699617016    db  'XM'
    1699717017cpu_reset:                                   ; 0xffff0 LB 0x10
  • trunk/src/VBox/Devices/PC/BIOS/orgs.asm

    r60434 r60441  
    161161public          int13_handler
    162162public          int13_relocated
     163if VBOX_BIOS_CPU eq 8086
     164public  jmp_call_ret_int13_out
     165endif
    163166public          int15_handler
    164167public          int17_handler
     
    171174public          normal_post
    172175public          eoi_jmp_post
     176public          no_eoi_jmp_post
    173177public          eoi_master_pic
    174178public          ebda_post
     179public          seg_40_value
    175180public          hard_drive_post
    176181public          int13_legacy
     
    239244                jmp     dword ptr ds:[0467h]
    240245
     246seg_40_value:   dw 40h ;; Replaces a push 40; pop ds.
     247
    241248;; --------------------------------------------------------
    242249;; POST entry point
     
    254261                jz      in_real_mode
    255262                SET_DEFAULT_CPU_286
     263else
     264                jmp     in_real_mode
    256265endif
    257266
     
    288297                ;; faulting the CPU or similar. Check reboot flag.
    289298                ;; NB: At this point, registers need not be preserved.
    290                 push    40h
    291                 pop     ds
     299               mov     ds, cs:[seg_40_value]
    292300                cmp     word ptr ds:[72h], 1234h
    293301                jnz     reset_sys       ; trigger system reset
     
    500508                mov     dx, 278h        ; parallel port 2
    501509                call    detect_parport
    502                 shl     bx, 0Eh
     510                DO_shl  bx, 0Eh
    503511                mov     ax, ds:[410h]   ; equipment word
    504512                and     ax, 3FFFh
     
    520528                mov     dx, 2E8h        ; fourth serial address
    521529                call    detect_serial
    522                 shl     bx, 9
     530                DO_shl  bx, 9
    523531                mov     ax, ds:[410h]   ; equipment word
    524532                and     ax, 0F1FFh      ; bits 9-11 determine serial ports
     
    760768                push    ds
    761769                push    es
    762                 DO_PUSHA
     770                DO_pusha
    763771                C_SETUP
    764772                call    _int14_function
    765                 DO_POPA
     773                DO_popa
    766774                pop     es
    767775                pop     ds
     
    776784                push    ds
    777785                push    es
    778                 DO_PUSHA
     786                DO_pusha
    779787                C_SETUP
    780788                call    _dummy_isr_function
    781                 DO_POPA
     789                DO_popa
    782790                pop     es
    783791                pop     ds
     
    837845                push    es
    838846                push    ds
    839                 DO_PUSHA
     847                DO_pusha
    840848
    841849                cmp     ah, 0
     
    847855                C_SETUP
    848856                call    _int16_function
    849                 DO_POPA
     857                DO_popa
    850858                pop     ds
    851859                pop     es
     
    874882                C_SETUP
    875883                call    _int16_function
    876                 DO_POPA
     884                DO_popa
    877885                pop     ds
    878886                pop     es
     
    919927                in      al, KBC_DATA
    920928                push    ds
    921                 DO_PUSHA
     929                DO_pusha
    922930                cld                     ; Before INT 15h (and any C code)
    923931ifdef BX_CALL_INT15_4F
     
    952960
    953961int09_done:
    954                 DO_POPA
     962                DO_popa
    955963                pop     ds
    956964                cli
     
    969977
    970978int06_handler:
    971                 DO_PUSHA
     979                DO_pusha
    972980                push    es
    973981                push    ds
     
    976984                pop     ds
    977985                pop     es
    978                 DO_POPA
     986                DO_popa
    979987                iret
    980988
     
    9991007                ja      int13_not_eltorito
    10001008
    1001                 DO_PUSHA
     1009                DO_pusha
    10021010                push    es
    10031011                push    ds
    10041012                C_SETUP                 ; TODO: setup C envrionment only once?
    1005                 push    int13_out       ; simulate a call
    1006                 jmp     _int13_eltorito ; ELDX not used
     1013                DO_JMP_CALL_EX _int13_eltorito, int13_out, jmp_call_ret_int13_out ; ELDX not used
     1014if VBOX_BIOS_CPU eq 8086
     1015jmp_call_ret_int13_out: dw offset int13_out
     1016endif
    10071017
    10081018int13_not_eltorito:
     
    10311041                pop     es
    10321042
    1033                 DO_PUSHA
     1043                DO_pusha
    10341044                push    es
    10351045                push    ds
    10361046                C_SETUP                 ; TODO: setup environment only once?
    10371047
    1038                 push    int13_out       ; simulate a call
    1039                 jmp     _int13_cdemu    ; ELDX not used
     1048                DO_JMP_CALL_EX _int13_cdemu, int13_out, jmp_call_ret_int13_out ; ELDX not used
    10401049
    10411050int13_nocdemu:
     
    10801089
    10811090                ;; now the registers can be restored with
    1082                 ;; pop ds; pop es; DO_POPA; iret
     1091                ;; pop ds; pop es; DO_popa; iret
    10831092                test    dl, 80h         ; non-removable?
    10841093                jnz     int13_notfloppy
    10851094
    1086                 push    int13_out       ; simulate a near call
    1087                 jmp     _int13_diskette_function
     1095                DO_JMP_CALL_EX _int13_diskette_function, int13_out, jmp_call_ret_int13_out
    10881096
    10891097int13_notfloppy:
     
    11161124                pop     ds
    11171125                pop     es
    1118                 DO_POPA
     1126                DO_popa
    11191127                iret
    11201128
     
    12141222look_drive0:
    12151223                ; TODO: pre-init bl to reduce jumps
    1216                 shr     al, 4           ; drive 0 in high nibble
     1224                DO_shr  al, 4           ; drive 0 in high nibble
    12171225                jz      f0_missing      ; jump if no drive
    12181226                mov     bl, 7           ; drv0 determined, multi-rate, chgline
     
    12551263                ;; in : AL in packed BCD format
    12561264                ;; out: AL in binary, AH always 0
     1265if VBOX_BIOS_CPU ge 80186
    12571266                shl     ax, 4
    12581267                shr     al, 4
     1268else
     1269                push    cx
     1270               mov      cl, 4
     1271                shl     ax, cl
     1272                shr     al, cl
     1273               pop      cx
     1274endif
    12591275                aad
    12601276                ret
     
    14371453                push    ds
    14381454                push    es
    1439                 DO_PUSHA
     1455                DO_pusha
    14401456                C_SETUP
    14411457                call    _int17_function
    1442                 DO_POPA
     1458                DO_popa
    14431459                pop     es
    14441460                pop     ds
     
    15641580                ; 3rd boot device
    15651581                mov     ax, 3
    1566                 push    3
     1582                push    ax
    15671583                call    _int19_function
    15681584                inc     sp
     
    15851601if VBOX_BIOS_CPU lt 80386
    15861602                mov     [bp], ax
    1587                shl      ax, 4
     1603               DO_shl   ax, 4
    15881604                mov     [bp+2], ax      ; set ip
    15891605                mov     ax, [bp]
     
    16581674                cmp     ah, 0d0h
    16591675                je      int15_handler32
    1660                 DO_PUSHA
     1676                DO_pusha
    16611677                cmp     ah, 53h         ; APM function?
    16621678                je      apm_call
     
    16661682                call    _int15_function
    16671683int15_handler_popa_ret:
    1668                 DO_POPA
     1684                DO_popa
    16691685int15_handler32_ret:
    16701686                pop     es
     
    16901706                .286
    16911707else
    1692                 DO_PUSHA
     1708                DO_pusha
    16931709                call    _int15_function32
    1694                 DO_POPA
     1710                DO_popa
    16951711endif
    16961712                jmp     int15_handler32_ret
     
    17191735
    17201736                sti
    1721                 DO_PUSHA
     1737                DO_pusha
    17221738                push    es
    17231739                push    ds
    1724                 push    0               ; placeholder for status
    1725                 push    0               ; placeholder for X
    1726                 push    0               ; placeholder for Y
    1727                 push    0               ; placeholder for Z
    1728                 push    0               ; placeholder for make_far_call bool
     1740               xor      ax, ax
     1741                push    ax              ; placeholder for status
     1742                push    ax              ; placeholder for X
     1743                push    ax              ; placeholder for Y
     1744                push    ax              ; placeholder for Z
     1745                push    ax              ; placeholder for make_far_call bool
    17291746                C_SETUP
    17301747                call    _int74_function
     
    17331750
    17341751                ;; make far call to EBDA:0022
     1752if VBOX_BIOS_CPU ge 80186
    17351753                push    0
     1754else
     1755               xor      ax, ax
     1756               push     ax
     1757endif
    17361758                pop     ds
    17371759                push    ds:[40Eh]
     
    17441766                pop     ds
    17451767                pop     es
    1746                 DO_POPA
     1768                DO_popa
    17471769                iret
    17481770
     
    17631785
    17641786int76_handler   endp
     1787
     1788
     1789;;
     1790;; IRQ 8 handler (RTC)
     1791;;
     1792int70_handler:
     1793                push    es
     1794                push    ds
     1795                DO_pusha
     1796                C_SETUP
     1797                call    _int70_function
     1798                DO_popa
     1799                pop     ds
     1800                pop     es
     1801                iret
     1802
     1803
     1804
     1805if VBOX_BIOS_CPU lt 80386
     1806;
     1807; We're tight on space down below in the int08_handler, so put
     1808; the 16-bit rollover code here.
     1809;
     1810int08_maybe_rollover:
     1811               ja       int08_rollover
     1812                cmp     ax, 00B0h
     1813               jb       int08_rollover_store
     1814                ;; there has been a midnight rollover
     1815int08_rollover:
     1816                xor     dx, dx
     1817                xor     ax, ax
     1818
     1819                inc     byte ptr ds:[70h]       ; increment rollover flag
     1820int08_rollover_store:
     1821                jmp     int08_store_ticks
     1822endif
     1823
    17651824
    17661825;; --------------------------------------------------------
     
    17961855                push    es
    17971856                push    ds
    1798                 DO_PUSHA
     1857                DO_pusha
    17991858                C_SETUP
    18001859int1a_callfunction:
    18011860                call    _int1a_function
    1802                 DO_POPA
     1861                DO_popa
    18031862                pop     ds
    18041863                pop     es
    18051864                iret
    18061865
    1807 
    1808 ;;
    1809 ;; IRQ 8 handler (RTC)
    1810 ;;
    1811 int70_handler:
    1812                 push    es
    1813                 push    ds
    1814                 DO_PUSHA
    1815                 C_SETUP
    1816                 call    _int70_function
    1817                 DO_POPA
    1818                 pop     ds
    1819                 pop     es
    1820                 iret
    1821 
    1822 if VBOX_BIOS_CPU lt 80386
    1823 ;
    1824 ; We're tight on space down below in the int08_handler, so put
    1825 ; the 16-bit rollover code here.
    1826 ;
    1827 int08_maybe_rollover:
    1828                ja       int08_rollover
    1829                 cmp     ax, 00B0h
    1830                jb       int08_store_ticks
    1831                 ;; there has been a midnight rollover
    1832 int08_rollover:
    1833                 xor     dx, dx
    1834                 xor     ax, ax
    1835 
    1836                 inc     byte ptr ds:[70h]       ; increment rollover flag
    1837                 jmp     int08_store_ticks
    1838 endif
    18391866
    18401867;; --------------------------------------------------------
     
    18741901else
    18751902                cmp     dx, 18h
    1876                jae      int08_maybe_rollover
     1903               jb       int08_store_ticks
     1904               jmp      int08_maybe_rollover
    18771905endif
    18781906
Note: See TracChangeset for help on using the changeset viewer.

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