VirtualBox

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


Ignore:
Timestamp:
Sep 3, 2012 4:55:18 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
80528
Message:

VGABIOS: Allow building with DEBUG_VGA again.

Location:
trunk/src/VBox/Devices/Graphics/BIOS-new
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/BIOS-new/vbe.c

    r43115 r43152  
    144144#endif
    145145
     146/* Display "chip" identification helpers. */
     147static uint16_t dispi_get_id(void)
     148{
     149    outw(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID);
     150    return inw(VBE_DISPI_IOPORT_DATA);
     151}
     152
     153static void dispi_set_id(uint16_t chip_id)
     154{
     155    outw(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_ID);
     156    outw(VBE_DISPI_IOPORT_DATA, chip_id);
     157}
     158
     159/* VBE Init - Initialise the VESA BIOS Extension (VBE) support
     160 * This function does a sanity check on the host side display code interface.
     161 */
     162void vbe_init(void)
     163{
     164    dispi_set_id(VBE_DISPI_ID0);
     165    if (dispi_get_id() == VBE_DISPI_ID0) {
     166        /* VBE support was detected. */
     167        write_byte(BIOSMEM_SEG, BIOSMEM_VBE_FLAG, 1);
     168        dispi_set_id(VBE_DISPI_ID4);
     169    }
     170#ifdef DEBUG_VGA
     171    printf(msg_vbe_init);
     172#endif
     173}
    146174
    147175/* Find the offset of the desired mode, given its number. */
     
    155183    sig = in_word(VBE_EXTRA_PORT, 0);
    156184    if (sig != VBEHEADER_MAGIC) {
     185#ifdef DEBUG_VGA
    157186        printf("Signature NOT found! %x\n", sig);
     187#endif
    158188        return 0;
    159189    }
     
    257287    {
    258288        *AX = 0x0100;
     289#ifdef DEBUG_VGA
    259290        printf("Signature NOT found\n");
     291#endif
    260292        return;
    261293    }
  • trunk/src/VBox/Devices/Graphics/BIOS-new/vberom.asm

    r43116 r43152  
    4545public  _dispi_get_max_bpp
    4646public  _vbe_has_vbe_display
    47 public  _vbe_init
    4847
    4948public  vbe_biosfn_return_current_mode
     
    110109  ret
    111110
    112 ; DISPI ioport functions
    113 
    114 dispi_get_id:
    115   push dx
    116   mov  dx, VBE_DISPI_IOPORT_INDEX
    117   mov  ax, VBE_DISPI_INDEX_ID
    118   out_dx_ax
    119   mov  dx, VBE_DISPI_IOPORT_DATA
    120   in_ax_dx
    121   pop  dx
    122   ret
    123 
    124 dispi_set_id:
    125   push dx
    126   push ax
    127   mov  dx, VBE_DISPI_IOPORT_INDEX
    128   mov  ax, VBE_DISPI_INDEX_ID
    129   out_dx_ax
    130   pop  ax
    131   mov  dx, VBE_DISPI_IOPORT_DATA
    132   out_dx_ax
    133   pop  dx
    134   ret
    135111
    136112; AL = bits per pixel / AH = bytes per pixel
     
    497473  ret
    498474
    499 ; VBE Init - Initialise the Vesa Bios Extension Code
    500 ; This function does a sanity check on the host side display code interface.
    501 
    502 _vbe_init:
    503   mov  ax, VBE_DISPI_ID0
    504   call dispi_set_id
    505   call dispi_get_id
    506   cmp  ax, VBE_DISPI_ID0
    507   jne  no_vbe_interface
    508   push ds
    509   push bx
    510   mov  ax, BIOSMEM_SEG
    511   mov  ds, ax
    512   mov  bx, BIOSMEM_VBE_FLAG
    513   mov  al, 01
    514   mov  [bx], al
    515   pop  bx
    516   pop  ds
    517 ;  mov  ax, VBE_DISPI_ID3
    518   mov  ax, VBE_DISPI_ID4
    519   call dispi_set_id
    520 no_vbe_interface:
    521 ifdef VGA_DEBUG
    522   mov  bx, msg_vbe_init
    523   push bx
    524   call _printf
    525   inc  sp
    526   inc  sp
    527 endif
    528   ret
    529475
    530476; Function 03h - Return Current VBE Mode
  • trunk/src/VBox/Devices/Graphics/BIOS-new/vgabios.c

    r43116 r43152  
    7373
    7474// Output
    75 static void           unimplemented();
    76 static void           unknown();
     75void __cdecl          unimplemented(void);
     76void __cdecl          unknown(void);
    7777
    7878static uint8_t find_vga_entry();
     
    8080#ifdef VBE
    8181extern uint16_t __cdecl vbe_has_vbe_display(void);
    82 extern void     __cdecl vbe_init(void);
     82extern void             vbe_init(void);
    8383#endif
    8484
     
    148148    outb(0x3C5, 0x02);
    149149
     150#ifdef DEBUG_VGA
    150151    printf(msg_vga_init);
     152#endif
    151153}
    152154
     
    285287// --------------------------------------------------------------------------------------------
    286288#ifdef VGA_DEBUG
    287 static void int10_debugmsg(uint16_t DI, uint16_t SI, uint16_t BP, uint16_t SP, uint16_t BX,
    288                            uint16_t DX, uint16_t CX, uint16_t AX, uint16_t DS, uint16_t ES, uint16_t FLAGS)
     289void __cdecl int10_debugmsg(uint16_t DI, uint16_t SI, uint16_t BP, uint16_t SP, uint16_t BX,
     290                            uint16_t DX, uint16_t CX, uint16_t AX, uint16_t DS, uint16_t ES, uint16_t FLAGS)
    289291{
    290292    /* Function 0Eh is write char and would generate way too much output. */
     
    20072009
    20082010#ifdef VGA_DEBUG
    2009 void unimplemented()
     2011void __cdecl unimplemented()
    20102012{
    20112013 printf("--> Unimplemented\n");
    20122014}
    20132015
    2014 void unknown()
     2016void __cdecl unknown()
    20152017{
    20162018 printf("--> Unknown int10\n");
    20172019}
    2018 #endif
    20192020
    20202021#undef VBE_PRINTF_PORT
     
    20222023
    20232024// --------------------------------------------------------------------------------------------
    2024 void printf(char *s, ...)
    2025 {
    2026 #ifdef VBE
     2025void __cdecl printf(char *s, ...)
     2026{
    20272027    char        c;
    20282028    Boolean     in_format;
     
    20682068        ++s;
    20692069    }
    2070 #endif
    2071 }
     2070}
     2071#endif
    20722072
    20732073//@todo: rearrange, call only from VBE module?
  • trunk/src/VBox/Devices/Graphics/BIOS-new/vgabios.h

    r43115 r43152  
    4949
    5050/* Output. */
    51 extern void printf(char *s, ...);
     51extern void __cdecl printf(char *s, ...);
    5252
    5353/* VGA BIOS routines called by VBE. */
  • trunk/src/VBox/Devices/Graphics/BIOS-new/vgarom.asm

    r43116 r43152  
    5252extrn   vbe_biosfn_set_get_palette_data:near
    5353extrn   vbe_biosfn_return_protected_mode_interface:near
     54endif
     55
     56ifdef VGA_DEBUG
     57extrn   _int10_debugmsg:near
     58extrn   _printf:near
     59extrn   _unimplemented:near
     60extrn   _unknown:near
    5461endif
    5562
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