VirtualBox

Ignore:
Timestamp:
Feb 6, 2020 8:58:32 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136017
Message:

VGABIOS: Further reduced mode set stack usage, centralized cld invocation, reduced explicit C000 segment usage.

Location:
trunk/src/VBox/Devices/Graphics/BIOS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/BIOS/inlines.h

    r82981 r83002  
    133133    parm [dx ax] value [dx ax] modify exact [dx ax] nomemory;
    134134
    135 //@todo: Do CLD elsewhere!
    136135extern void memsetb(uint16_t seg, uint16_t offset, uint16_t value, uint16_t count);
    137136#pragma aux memsetb =   \
    138     "cld"               \
    139137    "jcxz no_copy"      \
    140138    "rep stosb"         \
     
    142140    parm [es] [di] [ax] [cx];
    143141
    144 //@todo: Do CLD elsewhere!
    145142extern void memsetw(uint16_t seg, uint16_t offset, uint16_t value, uint16_t count);
    146143#pragma aux memsetw =   \
    147     "cld"               \
    148144    "jcxz no_copy"      \
    149145    "rep stosw"         \
     
    151147    parm [es] [di] [ax] [cx];
    152148
    153 //@todo: Do CLD elsewhere!
    154149extern void memcpyb(uint16_t dseg, uint16_t doffset, uint16_t sseg, uint16_t soffset, uint16_t count);
    155150#pragma aux memcpyb =   \
    156     "cld"               \
    157151    "jcxz   no_copy"    \
    158152    "push   ds"         \
     
    163157    parm [es] [di] [dx] [si] [cx];
    164158
    165 //@todo: Do CLD elsewhere!
    166159extern void memcpyw(uint16_t dseg, uint16_t doffset, uint16_t sseg, uint16_t soffset, uint16_t count);
    167160#pragma aux memcpyw =   \
    168     "cld"               \
    169161    "jcxz   no_copy"    \
    170162    "push   ds"         \
  • trunk/src/VBox/Devices/Graphics/BIOS/vberom.asm

    r69294 r83002  
    780780  test bl, bl
    781781  jnz _fail
    782   mov di, 0C000h
    783   mov es, di
     782  push cs
     783  pop es
    784784  mov di, offset vesa_pm_start
    785785  mov cx, vesa_pm_end - vesa_pm_start
  • trunk/src/VBox/Devices/Graphics/BIOS/vgabios.c

    r83001 r83002  
    7777
    7878static uint8_t find_vga_entry();
    79 
    80 extern uint8_t xread_byte(uint16_t seg, uint16_t offset);
     79static void biosfn_load_text_8_16_pat(uint8_t AL, uint8_t BL);
     80
     81extern uint8_t readx_byte(uint16_t seg, uint16_t offset);
    8182
    8283#ifdef VBE
     
    8586#endif
    8687
    87 void set_int_vector(uint8_t int_vec, void *offset)
     88void set_int_vector(uint8_t int_vec, void __far *ptr)
    8889{
    8990    void __far * __far *ivt = 0;
    9091
    91     ivt[int_vec] = 0xC000 :> offset;
     92    ivt[int_vec] = ptr;
    9293}
    9394
     
    573574        break;
    574575    case 0x02:
    575         ptr = 0xC000 :> vgafont14;
     576        ptr = vgafont14;
    576577        break;
    577578    case 0x03:
    578         ptr = 0xC000 :> vgafont8;
     579        ptr = vgafont8;
    579580        break;
    580581    case 0x04:
    581         ptr = 0xC000 :> (vgafont8 + 128 * 8);
     582        ptr = vgafont8 + 128 * 8;
    582583        break;
    583584    case 0x05:
    584         ptr = 0xC000 :> vgafont14alt;
     585        ptr = vgafont14alt;
    585586        break;
    586587    case 0x06:
    587         ptr = 0xC000 :> vgafont16;
     588        ptr = vgafont16;
    588589        break;
    589590    case 0x07:
    590         ptr = 0xC000 :> vgafont16alt;
     591        ptr = vgafont16alt;
    591592        break;
    592593    default:
     
    878879 // Should we clear the screen ?
    879880 uint8_t  noclearmem=mode&0x80;
    880  uint8_t  line,mmask,*palette,vpti;
    881  uint16_t i,twidth,theightm1,cheight;
    882  uint8_t  modeset_ctl,video_ctl,vga_switches;
     881 uint8_t  line,mmask,vpti;
     882 uint8_t  modeset_ctl;
     883 uint8_t  *palette;
     884 uint16_t i;
    883885 uint16_t crtc_addr;
    884886
     
    910912
    911913 vpti=line_to_vpti[line];
    912  twidth=video_param_table[vpti].twidth;
    913  theightm1=video_param_table[vpti].theightm1;
    914  cheight=video_param_table[vpti].cheight;
    915 
     914
     915#if 0   // These are unused, but perhaps they shouldn't be?
    916916 // Read the bios vga control
    917917 video_ctl=read_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL);
     
    919919 // Read the bios vga switches
    920920 vga_switches=read_byte(BIOSMEM_SEG,BIOSMEM_SWITCHES);
     921#endif
    921922
    922923 // Read the bios mode set control
     
    10361037 // Set the BIOS mem
    10371038 write_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_MODE,mode);
    1038  write_word(BIOSMEM_SEG,BIOSMEM_NB_COLS,twidth);
     1039 write_word(BIOSMEM_SEG,BIOSMEM_NB_COLS,video_param_table[vpti].twidth);
    10391040 write_word(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE,video_param_table[vpti].slength);
    10401041 write_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS,crtc_addr);
    1041  write_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS,theightm1);
    1042  write_word(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT,cheight);
     1042 write_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS,video_param_table[vpti].theightm1);
     1043 write_word(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT,video_param_table[vpti].cheight);
    10431044 write_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL,(0x60|noclearmem));
    10441045 write_byte(BIOSMEM_SEG,BIOSMEM_SWITCHES,0xF9);
     
    10781079 set_int_vector(0x1f, vgafont8+128*8);
    10791080
    1080   switch(cheight)
     1081  switch(video_param_table[vpti].cheight)
    10811082   {case 8:
    10821083     set_int_vector(0x43, vgafont8);
     
    13941395     mask=0x80>>j;
    13951396     outw(VGAREG_GRDC_ADDRESS, (mask << 8) | 0x08);
    1396      xread_byte(0xa000,dest);
     1397     readx_byte(0xa000,dest);
    13971398     if(fdata[src+i]&mask)
    13981399      {
     
    16411642     outw(VGAREG_GRDC_ADDRESS, (mask << 8) | 0x08);
    16421643     outw(VGAREG_GRDC_ADDRESS, 0x0205);
    1643      data = xread_byte(0xa000,addr);
     1644     data = readx_byte(0xa000,addr);
    16441645     if (AL & 0x80)
    16451646      {
     
    23322333 * may be corrupted.
    23332334 */
    2334 uint8_t xread_byte(uint16_t seg, uint16_t offset)
     2335uint8_t readx_byte(uint16_t seg, uint16_t offset)
    23352336{
    23362337    return( *(seg:>(uint8_t *)offset) );
     
    25482549        if (GET_AL() < 2) {
    25492550            write_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL,
    2550               (xread_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL) & ~1) | GET_AL());
     2551              (read_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL) & ~1) | GET_AL());
    25512552            SET_AL(0x12);
    25522553        }
  • trunk/src/VBox/Devices/Graphics/BIOS/vgarom.asm

    r69294 r83002  
    8787  push ds
    8888  DO_pusha
    89   mov   bx, 0C000h
    90   mov   ds, bx
     89  push  cs
     90  pop   ds
     91  cld
    9192  call _int10_debugmsg
    9293  DO_popa
     
    197198
    198199;; We have to set ds to access the right data segment
    199   mov   bx, 0C000h
    200   mov   ds, bx
     200  push  cs
     201  pop   ds
     202  cld
    201203  call _int10_func
    202204
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