Changeset de07bcf in mainline for arch/ia32/src/drivers/vesa.c


Ignore:
Timestamp:
2006-05-05T13:42:42Z (19 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
203dcd45
Parents:
e3c762cd
Message:

Amd64 framebuffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/drivers/vesa.c

    re3c762cd rde07bcf  
    3333#include <putchar.h>
    3434#include <mm/page.h>
     35#include <mm/frame.h>
    3536#include <mm/as.h>
    3637#include <arch/mm/page.h>
     
    5556
    5657
     58static __u32 log2(__u32 x)
     59{
     60        __u32 l=2;
     61        if(x<=PAGE_SIZE) return PAGE_WIDTH+1;
     62       
     63        x--;
     64        while(x>>=1) l++;
     65        return l;
     66}
     67
    5768void vesa_init(void)
    5869{
    5970        int a;
    6071
     72        __address videoram_lin_addr;
     73
     74        videoram_lin_addr=PA2KA(PFN2ADDR(frame_alloc( log2(vesa_scanline*vesa_height) -FRAME_WIDTH,FRAME_KA)));
    6175        /* Map videoram */
    6276        for(a=0;a<((vesa_scanline*vesa_height+PAGE_SIZE-1)>>PAGE_WIDTH);a++)
    63         page_mapping_insert(AS_KERNEL, VIDEORAM_LIN_ADDR+a*4096, vesa_ph_addr+a*4096, PAGE_NOT_CACHEABLE);
     77        page_mapping_insert(AS_KERNEL, videoram_lin_addr+a*4096, vesa_ph_addr+a*4096, PAGE_NOT_CACHEABLE);
    6478       
    65         fb_init( VIDEORAM_LIN_ADDR,vesa_width,vesa_height,vesa_bpp,vesa_scanline);
     79        fb_init( videoram_lin_addr,vesa_width,vesa_height,vesa_bpp,vesa_scanline);
    6680        putchar('\n');
    6781}
Note: See TracChangeset for help on using the changeset viewer.