- Timestamp:
- 2006-06-01T23:01:44Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 46bd593f
- Parents:
- c1d2c9d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fb/fb.c
rc1d2c9d rda0c91e7 28 28 */ 29 29 30 #include <stdio.h>31 30 #include <stdlib.h> 32 31 #include <unistd.h> 33 32 #include <string.h> 34 33 #include <ddi.h> 35 #include <task.h>36 34 #include <sysinfo.h> 37 35 #include <align.h> … … 390 388 } 391 389 392 static int init_fb(void)393 {394 __address fb_ph_addr;395 unsigned int fb_width;396 unsigned int fb_height;397 unsigned int fb_bpp;398 unsigned int fb_scanline;399 __address fb_addr;400 int a=0;401 int i,j,k;402 int w;403 char text[]="HelenOS Framebuffer driver\non Virtual Framebuffer\nVFB ";404 405 fb_ph_addr=sysinfo_value("fb.address.physical");406 fb_width=sysinfo_value("fb.width");407 fb_height=sysinfo_value("fb.height");408 fb_bpp=sysinfo_value("fb.bpp");409 fb_scanline=sysinfo_value("fb.scanline");410 411 fb_addr=ALIGN_UP(((__address)set_maxheapsize(USER_ADDRESS_SPACE_SIZE_ARCH>>1)),PAGE_SIZE);412 413 map_physmem(task_get_id(),(void *)((__address)fb_ph_addr),(void *)fb_addr,414 (fb_scanline*fb_height+PAGE_SIZE-1)>>PAGE_WIDTH,415 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);416 417 screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline);418 419 return 0;420 }421 422 390 static void draw_char(int vp, char c, unsigned int row, unsigned int col) 423 391 { … … 443 411 } 444 412 445 voidclient_connection(ipc_callid_t iid, ipc_call_t *icall)413 static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall) 446 414 { 447 415 ipc_callid_t callid; … … 578 546 } 579 547 580 int main(int argc, char *argv[]) 581 { 582 char connected = 0; 583 int res; 584 ipcarg_t phonead; 585 586 if(!sysinfo_value("fb")) 587 return -1; 588 589 if ((res = ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, &phonead)) != 0) 590 return -1; 591 592 if (init_fb() != 0) 593 return -1; 594 595 async_manager(); 596 /* Never reached */ 548 int fb_init(void) 549 { 550 __address fb_ph_addr; 551 unsigned int fb_width; 552 unsigned int fb_height; 553 unsigned int fb_bpp; 554 unsigned int fb_scanline; 555 __address fb_addr; 556 557 async_set_client_connection(fb_client_connection); 558 559 fb_ph_addr=sysinfo_value("fb.address.physical"); 560 fb_width=sysinfo_value("fb.width"); 561 fb_height=sysinfo_value("fb.height"); 562 fb_bpp=sysinfo_value("fb.bpp"); 563 fb_scanline=sysinfo_value("fb.scanline"); 564 565 fb_addr=ALIGN_UP(((__address)set_maxheapsize(USER_ADDRESS_SPACE_SIZE_ARCH>>1)),PAGE_SIZE); 566 567 map_physmem(task_get_id(),(void *)((__address)fb_ph_addr),(void *)fb_addr, 568 (fb_scanline*fb_height+PAGE_SIZE-1)>>PAGE_WIDTH, 569 AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); 570 571 screen_init(fb_addr, fb_width, fb_height, fb_bpp, fb_scanline); 572 597 573 return 0; 598 574 } 575
Note:
See TracChangeset
for help on using the changeset viewer.