Changeset 43152 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Sep 3, 2012 4:55:18 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 80528
- 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 144 144 #endif 145 145 146 /* Display "chip" identification helpers. */ 147 static 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 153 static 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 */ 162 void 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 } 146 174 147 175 /* Find the offset of the desired mode, given its number. */ … … 155 183 sig = in_word(VBE_EXTRA_PORT, 0); 156 184 if (sig != VBEHEADER_MAGIC) { 185 #ifdef DEBUG_VGA 157 186 printf("Signature NOT found! %x\n", sig); 187 #endif 158 188 return 0; 159 189 } … … 257 287 { 258 288 *AX = 0x0100; 289 #ifdef DEBUG_VGA 259 290 printf("Signature NOT found\n"); 291 #endif 260 292 return; 261 293 } -
trunk/src/VBox/Devices/Graphics/BIOS-new/vberom.asm
r43116 r43152 45 45 public _dispi_get_max_bpp 46 46 public _vbe_has_vbe_display 47 public _vbe_init48 47 49 48 public vbe_biosfn_return_current_mode … … 110 109 ret 111 110 112 ; DISPI ioport functions113 114 dispi_get_id:115 push dx116 mov dx, VBE_DISPI_IOPORT_INDEX117 mov ax, VBE_DISPI_INDEX_ID118 out_dx_ax119 mov dx, VBE_DISPI_IOPORT_DATA120 in_ax_dx121 pop dx122 ret123 124 dispi_set_id:125 push dx126 push ax127 mov dx, VBE_DISPI_IOPORT_INDEX128 mov ax, VBE_DISPI_INDEX_ID129 out_dx_ax130 pop ax131 mov dx, VBE_DISPI_IOPORT_DATA132 out_dx_ax133 pop dx134 ret135 111 136 112 ; AL = bits per pixel / AH = bytes per pixel … … 497 473 ret 498 474 499 ; VBE Init - Initialise the Vesa Bios Extension Code500 ; This function does a sanity check on the host side display code interface.501 502 _vbe_init:503 mov ax, VBE_DISPI_ID0504 call dispi_set_id505 call dispi_get_id506 cmp ax, VBE_DISPI_ID0507 jne no_vbe_interface508 push ds509 push bx510 mov ax, BIOSMEM_SEG511 mov ds, ax512 mov bx, BIOSMEM_VBE_FLAG513 mov al, 01514 mov [bx], al515 pop bx516 pop ds517 ; mov ax, VBE_DISPI_ID3518 mov ax, VBE_DISPI_ID4519 call dispi_set_id520 no_vbe_interface:521 ifdef VGA_DEBUG522 mov bx, msg_vbe_init523 push bx524 call _printf525 inc sp526 inc sp527 endif528 ret529 475 530 476 ; Function 03h - Return Current VBE Mode -
trunk/src/VBox/Devices/Graphics/BIOS-new/vgabios.c
r43116 r43152 73 73 74 74 // Output 75 static void unimplemented();76 static void unknown();75 void __cdecl unimplemented(void); 76 void __cdecl unknown(void); 77 77 78 78 static uint8_t find_vga_entry(); … … 80 80 #ifdef VBE 81 81 extern uint16_t __cdecl vbe_has_vbe_display(void); 82 extern void __cdeclvbe_init(void);82 extern void vbe_init(void); 83 83 #endif 84 84 … … 148 148 outb(0x3C5, 0x02); 149 149 150 #ifdef DEBUG_VGA 150 151 printf(msg_vga_init); 152 #endif 151 153 } 152 154 … … 285 287 // -------------------------------------------------------------------------------------------- 286 288 #ifdef VGA_DEBUG 287 static voidint10_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)289 void __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) 289 291 { 290 292 /* Function 0Eh is write char and would generate way too much output. */ … … 2007 2009 2008 2010 #ifdef VGA_DEBUG 2009 void unimplemented()2011 void __cdecl unimplemented() 2010 2012 { 2011 2013 printf("--> Unimplemented\n"); 2012 2014 } 2013 2015 2014 void unknown()2016 void __cdecl unknown() 2015 2017 { 2016 2018 printf("--> Unknown int10\n"); 2017 2019 } 2018 #endif2019 2020 2020 2021 #undef VBE_PRINTF_PORT … … 2022 2023 2023 2024 // -------------------------------------------------------------------------------------------- 2024 void printf(char *s, ...) 2025 { 2026 #ifdef VBE 2025 void __cdecl printf(char *s, ...) 2026 { 2027 2027 char c; 2028 2028 Boolean in_format; … … 2068 2068 ++s; 2069 2069 } 2070 #endif 2071 } 2070 } 2071 #endif 2072 2072 2073 2073 //@todo: rearrange, call only from VBE module? -
trunk/src/VBox/Devices/Graphics/BIOS-new/vgabios.h
r43115 r43152 49 49 50 50 /* Output. */ 51 extern void printf(char *s, ...);51 extern void __cdecl printf(char *s, ...); 52 52 53 53 /* VGA BIOS routines called by VBE. */ -
trunk/src/VBox/Devices/Graphics/BIOS-new/vgarom.asm
r43116 r43152 52 52 extrn vbe_biosfn_set_get_palette_data:near 53 53 extrn vbe_biosfn_return_protected_mode_interface:near 54 endif 55 56 ifdef VGA_DEBUG 57 extrn _int10_debugmsg:near 58 extrn _printf:near 59 extrn _unimplemented:near 60 extrn _unknown:near 54 61 endif 55 62
Note:
See TracChangeset
for help on using the changeset viewer.