Changeset 47a350f in mainline for uspace/srv/console/console.c
- Timestamp:
- 2009-12-16T01:49:16Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- df747bd8
- Parents:
- 4491338
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/console/console.c
r4491338 r47a350f 50 50 #include <event.h> 51 51 #include <devmap.h> 52 #include <fcntl.h> 53 #include <vfs/vfs.h> 52 54 #include <fibril_synch.h> 53 55 … … 665 667 } 666 668 667 static bool console_init(void) 668 { 669 ipcarg_t color_cap; 670 671 /* Connect to keyboard driver */ 672 kbd_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_KEYBOARD, 0, 0); 669 static bool console_init(char *input) 670 { 671 /* Connect to input device */ 672 int input_fd = open(input, O_RDONLY); 673 if (input_fd < 0) { 674 printf(NAME ": Failed opening %s\n", input); 675 return false; 676 } 677 678 kbd_phone = fd_phone(input_fd); 673 679 if (kbd_phone < 0) { 674 printf(NAME ": Failed to connect to keyboard service\n");680 printf(NAME ": Failed to connect to input device\n"); 675 681 return false; 676 682 } 677 683 684 /* NB: The callback connection is slotted for removal */ 678 685 ipcarg_t phonehash; 679 686 if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) { 680 printf(NAME ": Failed to create callback from keyboard service\n");687 printf(NAME ": Failed to create callback from input device\n"); 681 688 return false; 682 689 } … … 702 709 703 710 /* Synchronize, the gcons could put something in queue */ 711 ipcarg_t color_cap; 704 712 async_req_0_0(fb_info.phone, FB_FLUSH); 705 713 async_req_0_2(fb_info.phone, FB_GET_CSIZE, &fb_info.cols, &fb_info.rows); … … 771 779 } 772 780 781 static void usage(void) 782 { 783 printf("Usage: console <input>\n"); 784 } 785 773 786 int main(int argc, char *argv[]) 774 787 { 788 if (argc < 2) { 789 usage(); 790 return -1; 791 } 792 775 793 printf(NAME ": HelenOS Console service\n"); 776 794 777 if (!console_init( ))795 if (!console_init(argv[1])) 778 796 return -1; 779 797
Note:
See TracChangeset
for help on using the changeset viewer.