Changeset 83b1d61 in mainline
- Timestamp:
- 2006-06-02T13:30:37Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb51e9a8
- Parents:
- bd929cfb
- Files:
-
- 3 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
fb/fb.c
rbd929cfb r83b1d61 41 41 #include <kernel/errno.h> 42 42 #include <async.h> 43 43 44 #include "font-8x16.h" 44 45 #include "helenos.xbm" 45 46 #include "fb.h" 47 #include "main.h" 48 #include "../console/screenbuffer.h" 46 49 47 50 #define DEFAULT_BGCOLOR 0x000080 … … 459 462 } 460 463 464 static void draw_text_data(int vp, keyfield_t *data) 465 { 466 viewport_t *vport = &viewports[vp]; 467 int i; 468 char c; 469 470 clear_port(vp); 471 for (i=0; i < vport->cols * vport->rows; i++) { 472 if (data[i].character == ' ') /* TODO: && data[i].style==vport->style */ 473 continue; 474 draw_char(vp, data[i].character, i/vport->rows, i % vport->cols); 475 } 476 cursor_print(vp); 477 } 478 479 461 480 /** Function for handling connections to FB 462 481 * … … 470 489 unsigned int row,col; 471 490 char c; 491 keyfield_t *interbuffer = NULL; 492 size_t intersize = 0; 472 493 473 494 int vp = 0; … … 495 516 ipc_answer_fast(callid,0,0,0); 496 517 return; /* Exit thread */ 518 case IPC_M_AS_AREA_SEND: 519 /* We accept one area for data interchange */ 520 intersize = IPC_GET_ARG2(call); 521 receive_comm_area(callid,&call,(void **)&interbuffer, 522 sizeof(*interbuffer)*viewports[0].cols*viewports[0].rows); 523 continue; 524 525 case FB_DRAW_TEXT_DATA: 526 if (!interbuffer) { 527 retval = EINVAL; 528 break; 529 } 530 if (intersize < vport->cols*vport->rows*sizeof(*interbuffer)) { 531 retval = EINVAL; 532 break; 533 } 534 draw_text_data(vp, interbuffer); 535 retval = 0; 536 break; 497 537 case FB_PUTCHAR: 498 538 c = IPC_GET_ARG1(call); -
fb/main.c
rbd929cfb r83b1d61 31 31 #include <sysinfo.h> 32 32 #include <async.h> 33 #include <as.h> 34 #include <align.h> 35 #include <errno.h> 33 36 34 37 #include "fb.h" 35 38 #include "sysio.h" 36 39 #include "ega.h" 40 #include "main.h" 41 42 void receive_comm_area(ipc_callid_t callid, ipc_call_t *call, void **area, 43 size_t maxsize) 44 { 45 void *dest; 46 47 if (*area) { 48 ipc_answer_fast(callid, ELIMIT, 0, 0); 49 return; 50 } 51 if (IPC_GET_ARG2(*call) > ALIGN_UP(maxsize, PAGE_SIZE)) { 52 ipc_answer_fast(callid, EINVAL, 0, 0); 53 return; 54 } 55 56 dest = as_get_mappable_page(maxsize); 57 if (ipc_answer_fast(callid, 0, (sysarg_t)dest, 0) == 0) 58 *area = dest; 59 } 37 60 38 61 int main(int argc, char *argv[]) -
libc/Makefile
rbd929cfb r83b1d61 72 72 generic/time.c \ 73 73 generic/err.c \ 74 generic/stdlib.c 74 generic/stdlib.c \ 75 generic/mmap.c 75 76 76 77 ARCH_SOURCES += \ -
libc/arch/amd64/include/types.h
rbd929cfb r83b1d61 33 33 typedef unsigned long size_t; 34 34 typedef signed long ssize_t; 35 typedef ssize_t off_t; 35 36 36 37 typedef char int8_t; -
libc/arch/ia32/include/types.h
rbd929cfb r83b1d61 33 33 typedef unsigned int size_t; 34 34 typedef signed int ssize_t; 35 typedef ssize_t off_t; 35 36 36 37 typedef char int8_t; -
libc/arch/ia64/include/types.h
rbd929cfb r83b1d61 33 33 typedef unsigned long size_t; 34 34 typedef signed long ssize_t; 35 typedef ssize_t off_t; 35 36 36 37 typedef char int8_t; -
libc/arch/mips32/include/types.h
rbd929cfb r83b1d61 33 33 typedef unsigned int size_t; 34 34 typedef signed int ssize_t; 35 typedef ssize_t off_t; 35 36 36 37 typedef char int8_t; -
libc/arch/ppc32/include/types.h
rbd929cfb r83b1d61 33 33 typedef unsigned int size_t; 34 34 typedef signed int ssize_t; 35 typedef ssize_t off_t; 35 36 36 37 typedef char int8_t; -
libc/arch/ppc64/include/types.h
rbd929cfb r83b1d61 33 33 typedef unsigned long size_t; 34 34 typedef signed long ssize_t; 35 typedef ssize_t off_t; 35 36 36 37 typedef char int8_t; -
libc/generic/as.c
rbd929cfb r83b1d61 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 29 #include <stdlib.h>30 #include <unistd.h>31 #include <string.h>32 #include <ddi.h>33 #include <sysinfo.h>34 #include <align.h>35 #include <as.h>36 #include <ipc/fb.h>37 #include <ipc/ipc.h>38 #include <ipc/ns.h>39 #include <ipc/services.h>40 #include <kernel/errno.h>41 42 28 43 29 #include <as.h> … … 134 120 } 135 121 122 /* TODO: make this type defined somewhere else */ 123 typedef sysarg_t __address; 124 136 125 /** Return pointer to some unmapped area, where fits new as_area 137 126 * -
libc/include/ipc/fb.h
rbd929cfb r83b1d61 18 18 #define FB_SET_STYLE 1034 19 19 #define FB_GET_RESOLUTION 1035 20 #define FB_DRAW_TEXT_DATA 1036 20 21 21 22 #endif
Note:
See TracChangeset
for help on using the changeset viewer.