VirtualBox

Changeset 50160 in vbox


Ignore:
Timestamp:
Jan 22, 2014 3:39:46 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91723
Message:

BIOS: Rearranged POST to initialize video earlier.

Location:
trunk/src/VBox/Devices/PC/BIOS
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/Makefile.kmk

    r49286 r50160  
    4242          segment BIOSSEG segaddr=0xF000 offset=0xE000
    4343 VBoxPcBios_SOURCES = \
     44        post.c \
    4445        bios.c \
    4546        print.c \
  • trunk/src/VBox/Devices/PC/BIOS/biosint.h

    r48123 r50160  
    6666#define DEBUG_PCI       0
    6767#define DEBUG_APM       0
     68#define DEBUG_POST      0
    6869
    6970#define FP_OFF(p)   ((unsigned)(p))
  • trunk/src/VBox/Devices/PC/BIOS/makefile

    r49286 r50160  
    3030        wasm -fo=.obj $(AFLAGS) $(DEFS) $<
    3131
    32 OBJS =  bios.obj print.obj ata.obj floppy.obj floppyt.obj eltorito.obj &
     32OBJS =  bios.obj post.obj ata.obj floppy.obj floppyt.obj eltorito.obj &
    3333        boot.obj keyboard.obj disk.obj serial.obj system.obj invop.obj &
    3434        timepci.obj logo.obj ps2mouse.obj parallel.obj scsi.obj &
    3535        ahci.obj apm.obj apm_pm.obj pcibios.obj pciutil.obj vds.obj &
    36         pcibio32.obj pci32.obj orgs.obj
     36        print.obj pcibio32.obj pci32.obj orgs.obj
    3737
    3838vbxbios.rom : vbxbios.bin
  • trunk/src/VBox/Devices/PC/BIOS/orgs.asm

    r49286 r50160  
    128128extrn           _print_bios_banner:near
    129129extrn           _inv_op_handler:near
     130extrn           rom_scan_:near
    130131
    131132
     
    169170public          int15_handler_mouse
    170171public          iret_modify_cf
    171 public          rom_scan
    172 public          rom_checksum
    173172public          init_pic
    174173public          floppy_post
     
    393392                call    ebda_post
    394393
     394                ;; Initialize PCI devices. This can and should be done early.
     395                call    pcibios_init_iomem_bases
     396                call    pcibios_init_irqs
     397
    395398                ;; PIT setup
    396399                SET_INT_VECTOR 08h, BIOSSEG, int08_handler
     
    400403                out     40h, al
    401404                out     40h, al
     405
     406                ;; video setup - must be done before POSTing VGA ROM
     407                SET_INT_VECTOR 10h, BIOSSEG, int10_handler
    402408
    403409                ;; keyboard setup
     
    425431                push    ds
    426432                C_SETUP
     433
     434                ;; Scan for video ROMs in the C000-C800 range. This is done
     435                ;; early so that errors are displayed on the screen.
     436                mov     ax, 0C000h
     437                mov     dx, 0C800h
     438                call    rom_scan_
     439
     440                ;; Initialize the keyboard
    427441                call    _keyboard_init
    428442                pop     ds
     
    484498                SET_INT_VECTOR 75h, BIOSSEG, int75_handler
    485499
    486                 ;; Video setup
    487                 SET_INT_VECTOR 10h, BIOSSEG, int10_handler
    488 
    489500                call    init_pic
    490 
    491                 call    pcibios_init_iomem_bases
    492                 call    pcibios_init_irqs
    493 
    494                 call    rom_scan
    495501
    496502                jmp     norm_post_cont
     
    562568                C_SETUP                 ; in case assembly code changed things
    563569                call    _print_bios_banner
     570
     571                ;; Scan for additional ROMs in the C800-EFFF range
     572                mov     ax, 0C800h
     573                mov     dx, 0F000h
     574                call    rom_scan_
    564575
    565576                ;; El Torito floppy/hard disk emulation
     
    732743
    733744
    734 rom_checksum    proc    near
    735                 push    ax
    736 ifdef CHECKSUM_ROMS
    737                 push    bx
    738                 push    cx
    739                 xor     ax, ax
    740                 xor     bx, bx
    741                 xor     cx, cx
    742                 mov     ch, ds:[2]
    743                 shl     cx, 1
    744 checksum_loop:
    745                 add     al, [bx]
    746                 inc     bx
    747                 loop    checksum_loop
    748                 and     al, 0FFh        ; set flags
    749                 pop     cx
    750                 pop     bx
    751 else
    752                 xor     al, al
    753 endif
    754                 pop     ax
    755                 ret
    756 rom_checksum    endp
    757 
    758 
    759 ;;
    760 ;; ROM scan - scan for valid ROMs and initialize them
    761 ;;
    762 rom_scan:
    763                 mov     cx, 0C000h      ; start at C000
    764 rom_scan_loop:
    765                 mov     ds, cx
    766                 mov     ax, 4           ; scan in 2K increments
    767                 cmp     word ptr ds:[0], 0AA55h ; look for signature
    768                 jne     rom_scan_increment
    769 
    770                 call    rom_checksum
    771                 jnz     rom_scan_increment
    772 
    773                 mov     al, ds:[2]      ; set increment to ROM length
    774                 test    al, 3
    775                 jz      block_count_rounded
    776 
    777                 and     al, 0FCh        ; round up
    778                 add     al, 4           ; to nearest 2K
    779 block_count_rounded:
    780                 xor     bx, bx
    781                 mov     ds, bx
    782                 push    ax
    783                 push    cx              ; push segment...
    784                 push    3               ; ...and offset of ROM entry
    785                 mov     bp, sp
    786                 call    dword ptr [bp]  ; call ROM init routine
    787                 cli                     ; in case ROM enabled interrupts
    788                 add     sp, 2           ; get rid of offset
    789                 pop     cx              ; restore registers
    790                 pop     ax
    791 rom_scan_increment:
    792                 shl     ax, 5           ; convert to 16-byte increments
    793                 add     cx, ax
    794                 cmp     cx, 0E800h      ; must encompass VBOX_LANBOOT_SEG!
    795                 jbe     rom_scan_loop
    796 
    797                 xor     ax, ax          ; DS back to zero
    798                 mov     ds, ax
    799                 ret
    800 
    801745init_pic        proc    near
    802746
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