Changeset de07bcf in mainline for arch/ia32/src/drivers/vesa.c
- Timestamp:
- 2006-05-05T13:42:42Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 203dcd45
- Parents:
- e3c762cd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/drivers/vesa.c
re3c762cd rde07bcf 33 33 #include <putchar.h> 34 34 #include <mm/page.h> 35 #include <mm/frame.h> 35 36 #include <mm/as.h> 36 37 #include <arch/mm/page.h> … … 55 56 56 57 58 static __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 57 68 void vesa_init(void) 58 69 { 59 70 int a; 60 71 72 __address videoram_lin_addr; 73 74 videoram_lin_addr=PA2KA(PFN2ADDR(frame_alloc( log2(vesa_scanline*vesa_height) -FRAME_WIDTH,FRAME_KA))); 61 75 /* Map videoram */ 62 76 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); 64 78 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); 66 80 putchar('\n'); 67 81 }
Note:
See TracChangeset
for help on using the changeset viewer.