Changeset 5eb5dcf in mainline for uspace/app
- Timestamp:
- 2010-01-06T20:56:04Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fccc236
- Parents:
- 002252a (diff), eca2435 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/app
- Files:
-
- 2 added
- 32 edited
- 7 moved
-
bdsh/Makefile (modified) (1 diff)
-
bdsh/Makefile.build (modified) (1 diff)
-
bdsh/Makefile.common (modified) (1 diff)
-
bdsh/cmds/modules/ls/ls.c (modified) (1 diff)
-
bdsh/input.c (modified) (19 diffs)
-
edit/Makefile (modified) (1 diff)
-
edit/Makefile.build (modified) (1 diff)
-
edit/Makefile.common (modified) (1 diff)
-
edit/edit.c (modified) (19 diffs)
-
getterm/Makefile (moved) (moved from uspace/app/getvc/Makefile ) (1 diff)
-
getterm/Makefile.build (moved) (moved from uspace/app/getvc/Makefile.build ) (2 diffs)
-
getterm/Makefile.common (moved) (moved from uspace/srv/fb/Makefile.common ) (1 diff)
-
getterm/getterm.c (moved) (moved from uspace/app/getvc/getvc.c ) (2 diffs)
-
getterm/getterm.h (moved) (moved from uspace/app/getvc/getvc.h ) (2 diffs)
-
getterm/version.c (moved) (moved from uspace/app/getvc/version.c ) (3 diffs)
-
getterm/version.h (moved) (moved from uspace/app/getvc/version.h ) (2 diffs)
-
init/Makefile (modified) (1 diff)
-
init/Makefile.build (modified) (1 diff)
-
init/Makefile.common (modified) (1 diff)
-
init/init.c (modified) (8 diffs)
-
klog/Makefile (modified) (1 diff)
-
klog/Makefile.build (modified) (1 diff)
-
klog/Makefile.common (modified) (1 diff)
-
redir/Makefile (modified) (1 diff)
-
redir/Makefile.build (modified) (1 diff)
-
redir/Makefile.common (modified) (1 diff)
-
tester/Makefile (modified) (1 diff)
-
tester/Makefile.build (modified) (2 diffs)
-
tester/Makefile.common (modified) (1 diff)
-
tester/fault/fault3.c (added)
-
tester/fault/fault3.def (added)
-
tester/tester.c (modified) (1 diff)
-
tester/tester.h (modified) (1 diff)
-
tester/vfs/vfs1.c (modified) (1 diff)
-
tetris/Makefile (modified) (1 diff)
-
tetris/Makefile.build (modified) (1 diff)
-
tetris/Makefile.common (modified) (1 diff)
-
trace/Makefile (modified) (1 diff)
-
trace/Makefile.build (modified) (1 diff)
-
trace/Makefile.common (modified) (1 diff)
-
trace/trace.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/Makefile
r002252a r5eb5dcf 34 34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/app/bdsh/Makefile.build
r002252a r5eb5dcf 79 79 %.o: %.c $(DEPEND) 80 80 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 81 ifeq ($(PRECHECK),y) 82 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 83 endif 81 84 82 85 $(DEPEND): -
uspace/app/bdsh/Makefile.common
r002252a r5eb5dcf 38 38 DEPEND = Makefile.depend 39 39 DEPEND_PREV = $(DEPEND).prev 40 JOB = bdsh.job 40 41 OUTPUT = bdsh -
uspace/app/bdsh/cmds/modules/ls/ls.c
r002252a r5eb5dcf 100 100 if (s.is_file) 101 101 printf("%-40s\t%llu\n", name, (long long) s.size); 102 else if (s.is_directory) 103 printf("%-40s\t<dir>\n", name); 102 104 else 103 105 printf("%-40s\n", name); -
uspace/app/bdsh/input.c
r002252a r5eb5dcf 36 36 #include <io/keycode.h> 37 37 #include <io/style.h> 38 #include <io/color.h> 38 39 #include <vfs/vfs.h> 40 #include <clipboard.h> 41 #include <macros.h> 39 42 #include <errno.h> 40 43 #include <assert.h> … … 50 53 #define HISTORY_LEN 10 51 54 55 /** Text input field. */ 52 56 typedef struct { 53 wchar_t buffer[INPUT_MAX]; 57 /** Buffer holding text currently being edited */ 58 wchar_t buffer[INPUT_MAX + 1]; 59 /** Screen coordinates of the top-left corner of the text field */ 54 60 int col0, row0; 61 /** Screen dimensions */ 55 62 int con_cols, con_rows; 63 /** Number of characters in @c buffer */ 56 64 int nc; 65 /** Caret position within buffer */ 57 66 int pos; 58 67 /** Selection mark position within buffer */ 68 int sel_start; 69 70 /** History (dynamically allocated strings) */ 59 71 char *history[1 + HISTORY_LEN]; 72 /** Number of entries in @c history, not counting [0] */ 60 73 int hnum; 74 /** Current position in history */ 61 75 int hpos; 76 /** Exit flag */ 77 bool done; 62 78 } tinput_t; 63 79 80 /** Seek direction */ 64 81 typedef enum { 65 82 seek_backward = -1, … … 70 87 71 88 static char *tinput_read(tinput_t *ti); 89 static void tinput_insert_string(tinput_t *ti, const char *str); 90 static void tinput_sel_get_bounds(tinput_t *ti, int *sa, int *sb); 91 static bool tinput_sel_active(tinput_t *ti); 92 static void tinput_sel_all(tinput_t *ti); 93 static void tinput_sel_delete(tinput_t *ti); 94 static void tinput_key_ctrl(tinput_t *ti, console_event_t *ev); 95 static void tinput_key_shift(tinput_t *ti, console_event_t *ev); 96 static void tinput_key_ctrl_shift(tinput_t *ti, console_event_t *ev); 97 static void tinput_key_unmod(tinput_t *ti, console_event_t *ev); 98 static void tinput_pre_seek(tinput_t *ti, bool shift_held); 99 static void tinput_post_seek(tinput_t *ti, bool shift_held); 72 100 73 101 /* Tokenizes input from console, sees if the first word is a built-in, if so … … 123 151 static void tinput_display_tail(tinput_t *ti, int start, int pad) 124 152 { 125 int i; 153 static wchar_t dbuf[INPUT_MAX + 1]; 154 int sa, sb; 155 int i, p; 156 157 tinput_sel_get_bounds(ti, &sa, &sb); 126 158 127 159 console_goto(fphone(stdout), (ti->col0 + start) % ti->con_cols, 128 160 ti->row0 + (ti->col0 + start) / ti->con_cols); 129 printf("%ls", ti->buffer + start); 161 console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0); 162 163 p = start; 164 if (p < sa) { 165 memcpy(dbuf, ti->buffer + p, (sa - p) * sizeof(wchar_t)); 166 dbuf[sa - p] = '\0'; 167 printf("%ls", dbuf); 168 p = sa; 169 } 170 171 if (p < sb) { 172 fflush(stdout); 173 console_set_color(fphone(stdout), COLOR_BLACK, COLOR_RED, 0); 174 memcpy(dbuf, ti->buffer + p, 175 (sb - p) * sizeof(wchar_t)); 176 dbuf[sb - p] = '\0'; 177 printf("%ls", dbuf); 178 p = sb; 179 } 180 181 fflush(stdout); 182 console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0); 183 184 if (p < ti->nc) { 185 memcpy(dbuf, ti->buffer + p, 186 (ti->nc - p) * sizeof(wchar_t)); 187 dbuf[ti->nc - p] = '\0'; 188 printf("%ls", dbuf); 189 } 190 130 191 for (i = 0; i < pad; ++i) 131 192 putchar(' '); … … 151 212 width = ti->col0 + ti->nc; 152 213 rows = (width / ti->con_cols) + 1; 153 214 154 215 /* Update row0 if the screen scrolled. */ 155 216 if (ti->row0 + rows > ti->con_rows) … … 180 241 ti->nc += 1; 181 242 ti->buffer[ti->nc] = '\0'; 243 ti->sel_start = ti->pos; 182 244 183 245 tinput_display_tail(ti, ti->pos - 1, 0); … … 186 248 } 187 249 250 static void tinput_insert_string(tinput_t *ti, const char *str) 251 { 252 int i; 253 int new_width, new_height; 254 int ilen; 255 wchar_t c; 256 size_t off; 257 258 ilen = min((ssize_t) str_length(str), INPUT_MAX - ti->nc); 259 if (ilen == 0) 260 return; 261 262 new_width = ti->col0 + ti->nc + ilen; 263 new_height = (new_width / ti->con_cols) + 1; 264 if (new_height >= ti->con_rows) 265 return; /* Disallow text longer than 1 page for now. */ 266 267 for (i = ti->nc - 1; i >= ti->pos; --i) 268 ti->buffer[i + ilen] = ti->buffer[i]; 269 270 off = 0; i = 0; 271 while (i < ilen) { 272 c = str_decode(str, &off, STR_NO_LIMIT); 273 if (c == '\0') 274 break; 275 276 /* Filter out non-printable chars. */ 277 if (c < 32) 278 c = 32; 279 280 ti->buffer[ti->pos + i] = c; 281 ++i; 282 } 283 284 ti->pos += ilen; 285 ti->nc += ilen; 286 ti->buffer[ti->nc] = '\0'; 287 ti->sel_start = ti->pos; 288 289 tinput_display_tail(ti, ti->pos - ilen, 0); 290 tinput_update_origin(ti); 291 tinput_position_caret(ti); 292 } 293 188 294 static void tinput_backspace(tinput_t *ti) 189 295 { 190 296 int i; 297 298 if (tinput_sel_active(ti)) { 299 tinput_sel_delete(ti); 300 return; 301 } 191 302 192 303 if (ti->pos == 0) … … 198 309 ti->nc -= 1; 199 310 ti->buffer[ti->nc] = '\0'; 311 ti->sel_start = ti->pos; 200 312 201 313 tinput_display_tail(ti, ti->pos, 1); … … 205 317 static void tinput_delete(tinput_t *ti) 206 318 { 319 if (tinput_sel_active(ti)) { 320 tinput_sel_delete(ti); 321 return; 322 } 323 207 324 if (ti->pos == ti->nc) 208 325 return; 209 326 210 327 ti->pos += 1; 328 ti->sel_start = ti->pos; 329 211 330 tinput_backspace(ti); 212 331 } 213 332 214 static void tinput_seek_cell(tinput_t *ti, seek_dir_t dir) 215 { 333 static void tinput_seek_cell(tinput_t *ti, seek_dir_t dir, bool shift_held) 334 { 335 tinput_pre_seek(ti, shift_held); 336 216 337 if (dir == seek_forward) { 217 338 if (ti->pos < ti->nc) … … 222 343 } 223 344 224 tinput_position_caret(ti); 225 } 226 227 static void tinput_seek_word(tinput_t *ti, seek_dir_t dir) 228 { 345 tinput_post_seek(ti, shift_held); 346 } 347 348 static void tinput_seek_word(tinput_t *ti, seek_dir_t dir, bool shift_held) 349 { 350 tinput_pre_seek(ti, shift_held); 351 229 352 if (dir == seek_forward) { 230 353 if (ti->pos == ti->nc) … … 258 381 } 259 382 260 tinput_position_caret(ti); 261 } 262 263 static void tinput_seek_vertical(tinput_t *ti, seek_dir_t dir) 264 { 383 tinput_post_seek(ti, shift_held); 384 } 385 386 static void tinput_seek_vertical(tinput_t *ti, seek_dir_t dir, bool shift_held) 387 { 388 tinput_pre_seek(ti, shift_held); 389 265 390 if (dir == seek_forward) { 266 391 if (ti->pos + ti->con_cols <= ti->nc) … … 271 396 } 272 397 273 tinput_position_caret(ti); 274 } 275 276 static void tinput_seek_max(tinput_t *ti, seek_dir_t dir) 277 { 398 tinput_post_seek(ti, shift_held); 399 } 400 401 static void tinput_seek_max(tinput_t *ti, seek_dir_t dir, bool shift_held) 402 { 403 tinput_pre_seek(ti, shift_held); 404 278 405 if (dir == seek_backward) 279 406 ti->pos = 0; … … 281 408 ti->pos = ti->nc; 282 409 410 tinput_post_seek(ti, shift_held); 411 } 412 413 static void tinput_pre_seek(tinput_t *ti, bool shift_held) 414 { 415 if (tinput_sel_active(ti) && !shift_held) { 416 /* Unselect and redraw. */ 417 ti->sel_start = ti->pos; 418 tinput_display_tail(ti, 0, 0); 419 tinput_position_caret(ti); 420 } 421 } 422 423 static void tinput_post_seek(tinput_t *ti, bool shift_held) 424 { 425 if (shift_held) { 426 /* Selecting text. Need redraw. */ 427 tinput_display_tail(ti, 0, 0); 428 } else { 429 /* Shift not held. Keep selection empty. */ 430 ti->sel_start = ti->pos; 431 } 283 432 tinput_position_caret(ti); 284 433 } … … 311 460 ti->nc = wstr_length(ti->buffer); 312 461 ti->pos = ti->nc; 462 ti->sel_start = ti->pos; 463 } 464 465 static void tinput_sel_get_bounds(tinput_t *ti, int *sa, int *sb) 466 { 467 if (ti->sel_start < ti->pos) { 468 *sa = ti->sel_start; 469 *sb = ti->pos; 470 } else { 471 *sa = ti->pos; 472 *sb = ti->sel_start; 473 } 474 } 475 476 static bool tinput_sel_active(tinput_t *ti) 477 { 478 return ti->sel_start != ti->pos; 479 } 480 481 static void tinput_sel_all(tinput_t *ti) 482 { 483 ti->sel_start = 0; 484 ti->pos = ti->nc; 485 tinput_display_tail(ti, 0, 0); 486 tinput_position_caret(ti); 487 } 488 489 static void tinput_sel_delete(tinput_t *ti) 490 { 491 int sa, sb; 492 493 tinput_sel_get_bounds(ti, &sa, &sb); 494 if (sa == sb) 495 return; 496 497 memmove(ti->buffer + sa, ti->buffer + sb, 498 (ti->nc - sb) * sizeof(wchar_t)); 499 ti->pos = ti->sel_start = sa; 500 ti->nc -= (sb - sa); 501 ti->buffer[ti->nc] = '\0'; 502 503 tinput_display_tail(ti, sa, sb - sa); 504 tinput_position_caret(ti); 505 } 506 507 static void tinput_sel_copy_to_cb(tinput_t *ti) 508 { 509 int sa, sb; 510 wchar_t tmp_c; 511 char *str; 512 513 tinput_sel_get_bounds(ti, &sa, &sb); 514 515 if (sb < ti->nc) { 516 tmp_c = ti->buffer[sb]; 517 ti->buffer[sb] = '\0'; 518 } 519 520 str = wstr_to_astr(ti->buffer + sa); 521 522 if (sb < ti->nc) 523 ti->buffer[sb] = tmp_c; 524 525 if (str == NULL) 526 goto error; 527 528 if (clipboard_put_str(str) != EOK) 529 goto error; 530 531 free(str); 532 return; 533 error: 534 return; 535 /* TODO: Give the user some warning. */ 536 } 537 538 static void tinput_paste_from_cb(tinput_t *ti) 539 { 540 char *str; 541 int rc; 542 543 rc = clipboard_get_str(&str); 544 if (rc != EOK || str == NULL) 545 return; /* TODO: Give the user some warning. */ 546 547 tinput_insert_string(ti, str); 548 free(str); 313 549 } 314 550 … … 337 573 } 338 574 575 /** Initialize text input field. 576 * 577 * Must be called before using the field. It clears the history. 578 */ 339 579 static void tinput_init(tinput_t *ti) 340 580 { … … 344 584 } 345 585 586 /** Read in one line of input. */ 346 587 static char *tinput_read(tinput_t *ti) 347 588 { … … 356 597 return NULL; 357 598 358 ti->pos = 0;599 ti->pos = ti->sel_start = 0; 359 600 ti->nc = 0; 360 601 ti->buffer[0] = '\0'; 361 362 while (true) { 602 ti->done = false; 603 604 while (!ti->done) { 363 605 fflush(stdout); 364 606 if (!console_get_event(fphone(stdin), &ev)) 365 607 return NULL; 366 608 367 609 if (ev.type != KEY_PRESS) 368 610 continue; … … 370 612 if ((ev.mods & KM_CTRL) != 0 && 371 613 (ev.mods & (KM_ALT | KM_SHIFT)) == 0) { 372 switch (ev.key) { 373 case KC_LEFT: 374 tinput_seek_word(ti, seek_backward); 375 break; 376 case KC_RIGHT: 377 tinput_seek_word(ti, seek_forward); 378 break; 379 case KC_UP: 380 tinput_seek_vertical(ti, seek_backward); 381 break; 382 case KC_DOWN: 383 tinput_seek_vertical(ti, seek_forward); 384 break; 385 } 614 tinput_key_ctrl(ti, &ev); 386 615 } 387 616 617 if ((ev.mods & KM_SHIFT) != 0 && 618 (ev.mods & (KM_CTRL | KM_ALT)) == 0) { 619 tinput_key_shift(ti, &ev); 620 } 621 622 if ((ev.mods & KM_CTRL) != 0 && 623 (ev.mods & KM_SHIFT) != 0 && 624 (ev.mods & KM_ALT) == 0) { 625 tinput_key_ctrl_shift(ti, &ev); 626 } 627 388 628 if ((ev.mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0) { 389 switch (ev.key) { 390 case KC_ENTER: 391 case KC_NENTER: 392 goto done; 393 case KC_BACKSPACE: 394 tinput_backspace(ti); 395 break; 396 case KC_DELETE: 397 tinput_delete(ti); 398 break; 399 case KC_LEFT: 400 tinput_seek_cell(ti, seek_backward); 401 break; 402 case KC_RIGHT: 403 tinput_seek_cell(ti, seek_forward); 404 break; 405 case KC_HOME: 406 tinput_seek_max(ti, seek_backward); 407 break; 408 case KC_END: 409 tinput_seek_max(ti, seek_forward); 410 break; 411 case KC_UP: 412 tinput_history_seek(ti, +1); 413 break; 414 case KC_DOWN: 415 tinput_history_seek(ti, -1); 416 break; 417 } 629 tinput_key_unmod(ti, &ev); 418 630 } 419 631 420 632 if (ev.c >= ' ') { 633 tinput_sel_delete(ti); 421 634 tinput_insert_char(ti, ev.c); 422 635 } 423 636 } 424 637 425 done:426 638 ti->pos = ti->nc; 427 639 tinput_position_caret(ti); … … 435 647 436 648 return str; 649 } 650 651 static void tinput_key_ctrl(tinput_t *ti, console_event_t *ev) 652 { 653 switch (ev->key) { 654 case KC_LEFT: 655 tinput_seek_word(ti, seek_backward, false); 656 break; 657 case KC_RIGHT: 658 tinput_seek_word(ti, seek_forward, false); 659 break; 660 case KC_UP: 661 tinput_seek_vertical(ti, seek_backward, false); 662 break; 663 case KC_DOWN: 664 tinput_seek_vertical(ti, seek_forward, false); 665 break; 666 case KC_X: 667 tinput_sel_copy_to_cb(ti); 668 tinput_sel_delete(ti); 669 break; 670 case KC_C: 671 tinput_sel_copy_to_cb(ti); 672 break; 673 case KC_V: 674 tinput_sel_delete(ti); 675 tinput_paste_from_cb(ti); 676 break; 677 case KC_A: 678 tinput_sel_all(ti); 679 break; 680 default: 681 break; 682 } 683 } 684 685 static void tinput_key_ctrl_shift(tinput_t *ti, console_event_t *ev) 686 { 687 switch (ev->key) { 688 case KC_LEFT: 689 tinput_seek_word(ti, seek_backward, true); 690 break; 691 case KC_RIGHT: 692 tinput_seek_word(ti, seek_forward, true); 693 break; 694 case KC_UP: 695 tinput_seek_vertical(ti, seek_backward, true); 696 break; 697 case KC_DOWN: 698 tinput_seek_vertical(ti, seek_forward, true); 699 break; 700 default: 701 break; 702 } 703 } 704 705 static void tinput_key_shift(tinput_t *ti, console_event_t *ev) 706 { 707 switch (ev->key) { 708 case KC_LEFT: 709 tinput_seek_cell(ti, seek_backward, true); 710 break; 711 case KC_RIGHT: 712 tinput_seek_cell(ti, seek_forward, true); 713 break; 714 case KC_UP: 715 tinput_seek_vertical(ti, seek_backward, true); 716 break; 717 case KC_DOWN: 718 tinput_seek_vertical(ti, seek_forward, true); 719 break; 720 case KC_HOME: 721 tinput_seek_max(ti, seek_backward, true); 722 break; 723 case KC_END: 724 tinput_seek_max(ti, seek_forward, true); 725 break; 726 default: 727 break; 728 } 729 } 730 731 static void tinput_key_unmod(tinput_t *ti, console_event_t *ev) 732 { 733 switch (ev->key) { 734 case KC_ENTER: 735 case KC_NENTER: 736 ti->done = true; 737 break; 738 case KC_BACKSPACE: 739 tinput_backspace(ti); 740 break; 741 case KC_DELETE: 742 tinput_delete(ti); 743 break; 744 case KC_LEFT: 745 tinput_seek_cell(ti, seek_backward, false); 746 break; 747 case KC_RIGHT: 748 tinput_seek_cell(ti, seek_forward, false); 749 break; 750 case KC_HOME: 751 tinput_seek_max(ti, seek_backward, false); 752 break; 753 case KC_END: 754 tinput_seek_max(ti, seek_forward, false); 755 break; 756 case KC_UP: 757 tinput_history_seek(ti, +1); 758 break; 759 case KC_DOWN: 760 tinput_history_seek(ti, -1); 761 break; 762 default: 763 break; 764 } 437 765 } 438 766 -
uspace/app/edit/Makefile
r002252a r5eb5dcf 34 34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/app/edit/Makefile.build
r002252a r5eb5dcf 57 57 %.o: %.c $(DEPEND) 58 58 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 59 ifeq ($(PRECHECK),y) 60 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 61 endif 59 62 60 63 $(DEPEND): -
uspace/app/edit/Makefile.common
r002252a r5eb5dcf 37 37 DEPEND = Makefile.depend 38 38 DEPEND_PREV = $(DEPEND).prev 39 JOB = edit.job 39 40 OUTPUT = edit -
uspace/app/edit/edit.c
r002252a r5eb5dcf 45 45 #include <align.h> 46 46 #include <macros.h> 47 #include <clipboard.h> 47 48 #include <bool.h> 48 49 … … 74 75 tag_t caret_pos; 75 76 77 /** Start of selection */ 78 tag_t sel_start; 79 76 80 /** 77 81 * Ideal column where the caret should try to get. This is used … … 107 111 static void key_handle_unmod(console_event_t const *ev); 108 112 static void key_handle_ctrl(console_event_t const *ev); 113 static void key_handle_shift(console_event_t const *ev); 114 static void key_handle_movement(unsigned int key, bool shift); 115 109 116 static int file_save(char const *fname); 110 117 static void file_save_as(void); … … 113 120 spt_t const *epos); 114 121 static char *filename_prompt(char const *prompt, char const *init_value); 122 static char *range_get_str(spt_t const *spos, spt_t const *epos); 123 115 124 static void pane_text_display(void); 116 125 static void pane_row_display(void); … … 118 127 static void pane_status_display(void); 119 128 static void pane_caret_display(void); 129 120 130 static void insert_char(wchar_t c); 121 131 static void delete_char_before(void); … … 123 133 static void caret_update(void); 124 134 static void caret_move(int drow, int dcolumn, enum dir_spec align_dir); 135 136 static bool selection_active(void); 137 static void selection_sel_all(void); 138 static void selection_get_points(spt_t *pa, spt_t *pb); 139 static void selection_delete(void); 140 static void selection_copy(void); 141 static void insert_clipboard_data(void); 142 125 143 static void pt_get_sof(spt_t *pt); 126 144 static void pt_get_eof(spt_t *pt); 145 static int tag_cmp(tag_t const *a, tag_t const *b); 146 static int spt_cmp(spt_t const *a, spt_t const *b); 147 static int coord_cmp(coord_t const *a, coord_t const *b); 148 127 149 static void status_display(char const *str); 128 150 … … 172 194 caret_move(-ED_INFTY, -ED_INFTY, dir_before); 173 195 196 /* Place selection start tag. */ 197 tag_get_pt(&pane.caret_pos, &pt); 198 sheet_place_tag(&doc.sh, &pt, &pane.sel_start); 199 174 200 /* Initial display */ 175 201 console_clear(con); … … 190 216 /* Handle key press. */ 191 217 if (((ev.mods & KM_ALT) == 0) && 218 ((ev.mods & KM_SHIFT) == 0) && 192 219 (ev.mods & KM_CTRL) != 0) { 193 220 key_handle_ctrl(&ev); 194 } else if ((ev.mods & (KM_CTRL | KM_ALT)) == 0) { 221 } else if (((ev.mods & KM_ALT) == 0) && 222 ((ev.mods & KM_CTRL) == 0) && 223 (ev.mods & KM_SHIFT) != 0) { 224 key_handle_shift(&ev); 225 } else if ((ev.mods & (KM_CTRL | KM_ALT | KM_SHIFT)) == 0) { 195 226 key_handle_unmod(&ev); 196 227 } … … 207 238 if (pane.rflags & REDRAW_CARET) 208 239 pane_caret_display(); 209 210 240 } 211 241 … … 220 250 switch (ev->key) { 221 251 case KC_ENTER: 252 selection_delete(); 222 253 insert_char('\n'); 223 254 caret_update(); 224 255 break; 225 256 case KC_LEFT: 226 caret_move(0, -1, dir_before);227 break;228 257 case KC_RIGHT: 229 caret_move(0, 0, dir_after);230 break;231 258 case KC_UP: 232 caret_move(-1, 0, dir_before);233 break;234 259 case KC_DOWN: 235 caret_move(+1, 0, dir_before);236 break;237 260 case KC_HOME: 238 caret_move(0, -ED_INFTY, dir_before);239 break;240 261 case KC_END: 241 caret_move(0, +ED_INFTY, dir_before);242 break;243 262 case KC_PAGE_UP: 244 caret_move(-pane.rows, 0, dir_before);245 break;246 263 case KC_PAGE_DOWN: 247 caret_move(+pane.rows, 0, dir_before);264 key_handle_movement(ev->key, false); 248 265 break; 249 266 case KC_BACKSPACE: 250 delete_char_before(); 267 if (selection_active()) 268 selection_delete(); 269 else 270 delete_char_before(); 251 271 caret_update(); 252 272 break; 253 273 case KC_DELETE: 254 delete_char_after(); 274 if (selection_active()) 275 selection_delete(); 276 else 277 delete_char_after(); 255 278 caret_update(); 256 279 break; 257 280 default: 258 281 if (ev->c >= 32 || ev->c == '\t') { 282 selection_delete(); 283 insert_char(ev->c); 284 caret_update(); 285 } 286 break; 287 } 288 } 289 290 /** Handle Shift-key combination. */ 291 static void key_handle_shift(console_event_t const *ev) 292 { 293 switch (ev->key) { 294 case KC_LEFT: 295 case KC_RIGHT: 296 case KC_UP: 297 case KC_DOWN: 298 case KC_HOME: 299 case KC_END: 300 case KC_PAGE_UP: 301 case KC_PAGE_DOWN: 302 key_handle_movement(ev->key, true); 303 break; 304 default: 305 if (ev->c >= 32 || ev->c == '\t') { 306 selection_delete(); 259 307 insert_char(ev->c); 260 308 caret_update(); … … 280 328 file_save_as(); 281 329 break; 330 case KC_C: 331 selection_copy(); 332 break; 333 case KC_V: 334 selection_delete(); 335 insert_clipboard_data(); 336 pane.rflags |= REDRAW_TEXT; 337 caret_update(); 338 break; 339 case KC_X: 340 selection_copy(); 341 selection_delete(); 342 pane.rflags |= REDRAW_TEXT; 343 caret_update(); 344 break; 345 case KC_A: 346 selection_sel_all(); 347 break; 282 348 default: 283 349 break; 350 } 351 } 352 353 static void key_handle_movement(unsigned int key, bool select) 354 { 355 spt_t pt; 356 spt_t caret_pt; 357 coord_t c_old, c_new; 358 bool had_sel; 359 360 /* Check if we had selection before. */ 361 tag_get_pt(&pane.caret_pos, &caret_pt); 362 tag_get_pt(&pane.sel_start, &pt); 363 had_sel = !spt_equal(&caret_pt, &pt); 364 365 switch (key) { 366 case KC_LEFT: 367 caret_move(0, -1, dir_before); 368 break; 369 case KC_RIGHT: 370 caret_move(0, 0, dir_after); 371 break; 372 case KC_UP: 373 caret_move(-1, 0, dir_before); 374 break; 375 case KC_DOWN: 376 caret_move(+1, 0, dir_before); 377 break; 378 case KC_HOME: 379 caret_move(0, -ED_INFTY, dir_before); 380 break; 381 case KC_END: 382 caret_move(0, +ED_INFTY, dir_before); 383 break; 384 case KC_PAGE_UP: 385 caret_move(-pane.rows, 0, dir_before); 386 break; 387 case KC_PAGE_DOWN: 388 caret_move(+pane.rows, 0, dir_before); 389 break; 390 default: 391 break; 392 } 393 394 if (select == false) { 395 /* Move sel_start to the same point as caret. */ 396 sheet_remove_tag(&doc.sh, &pane.sel_start); 397 tag_get_pt(&pane.caret_pos, &pt); 398 sheet_place_tag(&doc.sh, &pt, &pane.sel_start); 399 } 400 401 if (select) { 402 tag_get_pt(&pane.caret_pos, &pt); 403 spt_get_coord(&caret_pt, &c_old); 404 spt_get_coord(&pt, &c_new); 405 406 if (c_old.row == c_new.row) 407 pane.rflags |= REDRAW_ROW; 408 else 409 pane.rflags |= REDRAW_TEXT; 410 411 } else if (had_sel == true) { 412 /* Redraw because text was unselected. */ 413 pane.rflags |= REDRAW_TEXT; 284 414 } 285 415 } … … 473 603 } 474 604 605 /** Return contents of range as a new string. */ 606 static char *range_get_str(spt_t const *spos, spt_t const *epos) 607 { 608 char *buf; 609 spt_t sp, bep; 610 size_t bytes; 611 size_t buf_size, bpos; 612 613 buf_size = 1; 614 615 buf = malloc(buf_size); 616 if (buf == NULL) 617 return NULL; 618 619 bpos = 0; 620 sp = *spos; 621 622 while (true) { 623 sheet_copy_out(&doc.sh, &sp, epos, &buf[bpos], buf_size - bpos, 624 &bep); 625 bytes = str_size(&buf[bpos]); 626 bpos += bytes; 627 sp = bep; 628 629 if (spt_equal(&bep, epos)) 630 break; 631 632 buf_size *= 2; 633 buf = realloc(buf, buf_size); 634 if (buf == NULL) 635 return NULL; 636 } 637 638 return buf; 639 } 640 475 641 static void pane_text_display(void) 476 642 { … … 517 683 { 518 684 int i, j, fill; 519 spt_t rb, re, dep ;685 spt_t rb, re, dep, pt; 520 686 coord_t rbc, rec; 521 687 char row_buf[ROW_BUF_SIZE]; … … 523 689 size_t pos, size; 524 690 unsigned s_column; 691 coord_t csel_start, csel_end, ctmp; 692 693 /* Determine selection start and end. */ 694 695 tag_get_pt(&pane.sel_start, &pt); 696 spt_get_coord(&pt, &csel_start); 697 698 tag_get_pt(&pane.caret_pos, &pt); 699 spt_get_coord(&pt, &csel_end); 700 701 if (coord_cmp(&csel_start, &csel_end) > 0) { 702 ctmp = csel_start; 703 csel_start = csel_end; 704 csel_end = ctmp; 705 } 525 706 526 707 /* Draw rows from the sheet. */ … … 543 724 /* Display text from the buffer. */ 544 725 726 if (coord_cmp(&csel_start, &rbc) <= 0 && 727 coord_cmp(&rbc, &csel_end) < 0) { 728 fflush(stdout); 729 console_set_color(con, COLOR_BLACK, COLOR_RED, 0); 730 fflush(stdout); 731 } 732 545 733 console_goto(con, 0, i); 546 734 size = str_size(row_buf); 547 735 pos = 0; 548 s_column = 1;736 s_column = pane.sh_column; 549 737 while (pos < size) { 738 if (csel_start.row == rbc.row && csel_start.column == s_column) { 739 fflush(stdout); 740 console_set_color(con, COLOR_BLACK, COLOR_RED, 0); 741 fflush(stdout); 742 } 743 744 if (csel_end.row == rbc.row && csel_end.column == s_column) { 745 fflush(stdout); 746 console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0); 747 fflush(stdout); 748 } 749 550 750 c = str_decode(row_buf, &pos, size); 551 751 if (c != '\t') { … … 562 762 } 563 763 764 if (csel_end.row == rbc.row && csel_end.column == s_column) { 765 fflush(stdout); 766 console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0); 767 fflush(stdout); 768 } 769 564 770 /* Fill until the end of display area. */ 565 771 … … 572 778 putchar(' '); 573 779 fflush(stdout); 780 console_set_color(con, COLOR_BLACK, COLOR_WHITE, 0); 574 781 } 575 782 … … 760 967 } 761 968 969 /** Check for non-empty selection. */ 970 static bool selection_active(void) 971 { 972 return (tag_cmp(&pane.caret_pos, &pane.sel_start) != 0); 973 } 974 975 static void selection_get_points(spt_t *pa, spt_t *pb) 976 { 977 spt_t pt; 978 979 tag_get_pt(&pane.sel_start, pa); 980 tag_get_pt(&pane.caret_pos, pb); 981 982 if (spt_cmp(pa, pb) > 0) { 983 pt = *pa; 984 *pa = *pb; 985 *pb = pt; 986 } 987 } 988 989 /** Delete selected text. */ 990 static void selection_delete(void) 991 { 992 spt_t pa, pb; 993 coord_t ca, cb; 994 int rel; 995 996 tag_get_pt(&pane.sel_start, &pa); 997 tag_get_pt(&pane.caret_pos, &pb); 998 spt_get_coord(&pa, &ca); 999 spt_get_coord(&pb, &cb); 1000 rel = coord_cmp(&ca, &cb); 1001 1002 if (rel == 0) 1003 return; 1004 1005 if (rel < 0) 1006 sheet_delete(&doc.sh, &pa, &pb); 1007 else 1008 sheet_delete(&doc.sh, &pb, &pa); 1009 1010 if (ca.row == cb.row) 1011 pane.rflags |= REDRAW_ROW; 1012 else 1013 pane.rflags |= REDRAW_TEXT; 1014 } 1015 1016 static void selection_sel_all(void) 1017 { 1018 spt_t spt, ept; 1019 1020 pt_get_sof(&spt); 1021 pt_get_eof(&ept); 1022 sheet_remove_tag(&doc.sh, &pane.sel_start); 1023 sheet_place_tag(&doc.sh, &spt, &pane.sel_start); 1024 sheet_remove_tag(&doc.sh, &pane.caret_pos); 1025 sheet_place_tag(&doc.sh, &ept, &pane.caret_pos); 1026 1027 pane.rflags |= REDRAW_TEXT; 1028 caret_update(); 1029 } 1030 1031 static void selection_copy(void) 1032 { 1033 spt_t pa, pb; 1034 char *str; 1035 1036 selection_get_points(&pa, &pb); 1037 str = range_get_str(&pa, &pb); 1038 if (str == NULL || clipboard_put_str(str) != EOK) { 1039 status_display("Copying to clipboard failed!"); 1040 } 1041 free(str); 1042 } 1043 1044 static void insert_clipboard_data(void) 1045 { 1046 char *str; 1047 size_t off; 1048 wchar_t c; 1049 int rc; 1050 1051 rc = clipboard_get_str(&str); 1052 if (rc != EOK || str == NULL) 1053 return; 1054 1055 off = 0; 1056 1057 while (true) { 1058 c = str_decode(str, &off, STR_NO_LIMIT); 1059 if (c == '\0') 1060 break; 1061 1062 insert_char(c); 1063 } 1064 1065 free(str); 1066 } 762 1067 763 1068 /** Get start-of-file s-point. */ … … 781 1086 782 1087 sheet_get_cell_pt(&doc.sh, &coord, dir_after, pt); 1088 } 1089 1090 /** Compare tags. */ 1091 static int tag_cmp(tag_t const *a, tag_t const *b) 1092 { 1093 spt_t pa, pb; 1094 1095 tag_get_pt(a, &pa); 1096 tag_get_pt(b, &pb); 1097 1098 return spt_cmp(&pa, &pb); 1099 } 1100 1101 /** Compare s-points. */ 1102 static int spt_cmp(spt_t const *a, spt_t const *b) 1103 { 1104 coord_t ca, cb; 1105 1106 spt_get_coord(a, &ca); 1107 spt_get_coord(b, &cb); 1108 1109 return coord_cmp(&ca, &cb); 1110 } 1111 1112 /** Compare coordinats. */ 1113 static int coord_cmp(coord_t const *a, coord_t const *b) 1114 { 1115 if (a->row - b->row != 0) 1116 return a->row - b->row; 1117 1118 return a->column - b->column; 783 1119 } 784 1120 -
uspace/app/getterm/Makefile
r002252a r5eb5dcf 34 34 all: $(LIBC_PREFIX)/../../../version $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/app/getterm/Makefile.build
r002252a r5eb5dcf 41 41 42 42 SOURCES = \ 43 get vc.c \43 getterm.c \ 44 44 version.c 45 45 … … 60 60 %.o: %.c $(DEPEND) 61 61 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 62 ifeq ($(PRECHECK),y) 63 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 64 endif 62 65 63 66 $(DEPEND): -
uspace/app/getterm/Makefile.common
r002252a r5eb5dcf 37 37 DEPEND = Makefile.depend 38 38 DEPEND_PREV = $(DEPEND).prev 39 OUTPUT = fb 39 JOB = getterm.job 40 OUTPUT = getterm -
uspace/app/getterm/getterm.c
r002252a r5eb5dcf 27 27 */ 28 28 29 /** @addtogroup get vc GetVC29 /** @addtogroup getterm GetTerm 30 30 * @brief Console initialization task. 31 31 * @{ … … 44 44 static void usage(void) 45 45 { 46 printf("Usage: get vc <device> <path>\n");46 printf("Usage: getterm <terminal> <path>\n"); 47 47 } 48 48 -
uspace/app/getterm/getterm.h
r002252a r5eb5dcf 27 27 */ 28 28 29 /** @addtogroup get vc29 /** @addtogroup getterm 30 30 * @{ 31 31 */ … … 34 34 */ 35 35 36 #ifndef GET VC_H__37 #define GET VC_H__36 #ifndef GETTERM_H__ 37 #define GETTERM_H__ 38 38 39 39 #endif -
uspace/app/getterm/version.c
r002252a r5eb5dcf 27 27 */ 28 28 29 /** @addtogroup get vc29 /** @addtogroup getterm 30 30 * @{ 31 31 */ … … 37 37 #include <stdio.h> 38 38 #include <macros.h> 39 #include "get vc.h"39 #include "getterm.h" 40 40 #include "version.h" 41 41 … … 57 57 58 58 /** Print version information. */ 59 void version_print(const char * vc)59 void version_print(const char *term) 60 60 { 61 61 printf("HelenOS release %s (%s)%s%s\n", release, name, revision, timestamp); 62 printf("Running on %s (%s)\n", arch, vc);62 printf("Running on %s (%s)\n", arch, term); 63 63 printf("Copyright (c) 2001-2009 HelenOS project\n\n"); 64 64 } -
uspace/app/getterm/version.h
r002252a r5eb5dcf 27 27 */ 28 28 29 /** @addtogroup get vc29 /** @addtogroup getterm 30 30 * @{ 31 31 */ … … 37 37 #define VERSION_H__ 38 38 39 extern void version_print(const char * vc);39 extern void version_print(const char *term); 40 40 41 41 #endif -
uspace/app/init/Makefile
r002252a r5eb5dcf 34 34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/app/init/Makefile.build
r002252a r5eb5dcf 56 56 %.o: %.c $(DEPEND) 57 57 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 58 ifeq ($(PRECHECK),y) 59 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 60 endif 58 61 59 62 $(DEPEND): -
uspace/app/init/Makefile.common
r002252a r5eb5dcf 37 37 DEPEND = Makefile.depend 38 38 DEPEND_PREV = $(DEPEND).prev 39 JOB = init.job 39 40 OUTPUT = init -
uspace/app/init/init.c
r002252a r5eb5dcf 50 50 #include "init.h" 51 51 52 #define DEVFS_MOUNT_POINT "/dev" 53 54 #define SRV_CONSOLE "/srv/console" 55 #define APP_GETTERM "/app/getterm" 56 52 57 static void info_print(void) 53 58 { … … 58 63 { 59 64 char *opts = ""; 60 const char *root_dev = " initrd";65 const char *root_dev = "bd/initrd"; 61 66 62 67 if (str_cmp(fstype, "tmpfs") == 0) … … 97 102 } 98 103 99 snprintf(null, MAX_DEVICE_NAME, "null %d", null_id);100 int rc = mount("devfs", "/dev", null, "", IPC_FLAG_BLOCKING);104 snprintf(null, MAX_DEVICE_NAME, "null/%d", null_id); 105 int rc = mount("devfs", DEVFS_MOUNT_POINT, null, "", IPC_FLAG_BLOCKING); 101 106 102 107 switch (rc) { … … 170 175 } 171 176 172 if ( texit != TASK_EXIT_NORMAL || retval != 0) {177 if ((texit != TASK_EXIT_NORMAL) || (retval != 0)) { 173 178 printf(NAME ": Server %s failed to start (returned %d)\n", 174 179 fname, retval); … … 176 181 } 177 182 178 static void getvc(char *dev, char *app)179 { 180 char *argv[ 4];181 char vc[MAX_DEVICE_NAME];183 static void console(char *dev) 184 { 185 char *argv[3]; 186 char hid_in[MAX_DEVICE_NAME]; 182 187 int rc; 183 188 184 snprintf(vc, MAX_DEVICE_NAME, "/dev/%s", dev); 185 186 printf(NAME ": Spawning getvc on %s\n", vc); 187 189 snprintf(hid_in, MAX_DEVICE_NAME, "%s/%s", DEVFS_MOUNT_POINT, dev); 190 191 printf(NAME ": Spawning %s with %s\n", SRV_CONSOLE, hid_in); 192 193 /* Wait for the input device to be ready */ 188 194 dev_handle_t handle; 189 195 rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); 190 196 191 197 if (rc == EOK) { 192 argv[0] = "/app/getvc"; 193 argv[1] = vc; 198 argv[0] = SRV_CONSOLE; 199 argv[1] = hid_in; 200 argv[2] = NULL; 201 202 if (!task_spawn(SRV_CONSOLE, argv)) 203 printf(NAME ": Error spawning %s with %s\n", SRV_CONSOLE, hid_in); 204 } else 205 printf(NAME ": Error waiting on %s\n", hid_in); 206 } 207 208 static void getterm(char *dev, char *app) 209 { 210 char *argv[4]; 211 char term[MAX_DEVICE_NAME]; 212 int rc; 213 214 snprintf(term, MAX_DEVICE_NAME, "%s/%s", DEVFS_MOUNT_POINT, dev); 215 216 printf(NAME ": Spawning %s with %s %s\n", APP_GETTERM, term, app); 217 218 /* Wait for the terminal device to be ready */ 219 dev_handle_t handle; 220 rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); 221 222 if (rc == EOK) { 223 argv[0] = APP_GETTERM; 224 argv[1] = term; 194 225 argv[2] = app; 195 226 argv[3] = NULL; 196 227 197 if (!task_spawn( "/app/getvc", argv))198 printf(NAME ": Error spawning getvc on %s\n", vc);199 } else {200 printf(NAME ": Error waiting on %s\n", vc);201 }228 if (!task_spawn(APP_GETTERM, argv)) 229 printf(NAME ": Error spawning %s with %s %s\n", APP_GETTERM, 230 term, app); 231 } else 232 printf(NAME ": Error waiting on %s\n", term); 202 233 } 203 234 … … 206 237 int rc; 207 238 208 printf("Trying to mount disk0 on /data... ");239 printf("Trying to mount bd/disk0 on /data... "); 209 240 fflush(stdout); 210 241 211 rc = mount("fat", "/data", " disk0", "wtcache", 0);242 rc = mount("fat", "/data", "bd/disk0", "wtcache", 0); 212 243 if (rc == EOK) 213 244 printf("OK\n"); … … 232 263 } 233 264 265 spawn("/srv/fhc"); 266 spawn("/srv/obio"); 267 srv_start("/srv/i8042"); 268 srv_start("/srv/c_mouse"); 269 234 270 spawn("/srv/fb"); 235 271 spawn("/srv/kbd"); 236 spawn("/srv/console");237 spawn("/srv/fhc");238 spawn("/srv/ obio");272 console("hid_in/kbd"); 273 274 spawn("/srv/clip"); 239 275 240 276 /* … … 255 291 #endif 256 292 257 get vc("vc0", "/app/bdsh");258 get vc("vc1", "/app/bdsh");259 get vc("vc2", "/app/bdsh");260 get vc("vc3", "/app/bdsh");261 get vc("vc4", "/app/bdsh");262 get vc("vc5", "/app/bdsh");263 get vc("vc6", "/app/klog");293 getterm("term/vc0", "/app/bdsh"); 294 getterm("term/vc1", "/app/bdsh"); 295 getterm("term/vc2", "/app/bdsh"); 296 getterm("term/vc3", "/app/bdsh"); 297 getterm("term/vc4", "/app/bdsh"); 298 getterm("term/vc5", "/app/bdsh"); 299 getterm("term/vc6", "/app/klog"); 264 300 265 301 return 0; -
uspace/app/klog/Makefile
r002252a r5eb5dcf 34 34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/app/klog/Makefile.build
r002252a r5eb5dcf 56 56 %.o: %.c $(DEPEND) 57 57 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 58 ifeq ($(PRECHECK),y) 59 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 60 endif 58 61 59 62 $(DEPEND): -
uspace/app/klog/Makefile.common
r002252a r5eb5dcf 37 37 DEPEND = Makefile.depend 38 38 DEPEND_PREV = $(DEPEND).prev 39 JOB = klog.job 39 40 OUTPUT = klog -
uspace/app/redir/Makefile
r002252a r5eb5dcf 34 34 all: $(LIBC_PREFIX)/../../../version $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/app/redir/Makefile.build
r002252a r5eb5dcf 56 56 %.o: %.c $(DEPEND) 57 57 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 58 ifeq ($(PRECHECK),y) 59 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 60 endif 58 61 59 62 $(DEPEND): -
uspace/app/redir/Makefile.common
r002252a r5eb5dcf 37 37 DEPEND = Makefile.depend 38 38 DEPEND_PREV = $(DEPEND).prev 39 JOB = redir.job 39 40 OUTPUT = redir -
uspace/app/tester/Makefile
r002252a r5eb5dcf 34 34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/app/tester/Makefile.build
r002252a r5eb5dcf 49 49 fault/fault1.c \ 50 50 fault/fault2.c \ 51 fault/fault3.c \ 51 52 vfs/vfs1.c \ 52 53 ipc/ping_pong.c \ … … 72 73 %.o: %.c $(DEPEND) 73 74 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 75 ifeq ($(PRECHECK),y) 76 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 77 endif 74 78 75 79 $(DEPEND): -
uspace/app/tester/Makefile.common
r002252a r5eb5dcf 37 37 DEPEND = Makefile.depend 38 38 DEPEND_PREV = $(DEPEND).prev 39 JOB = tester.job 39 40 OUTPUT = tester -
uspace/app/tester/tester.c
r002252a r5eb5dcf 56 56 #include "fault/fault1.def" 57 57 #include "fault/fault2.def" 58 #include "fault/fault3.def" 58 59 #include "vfs/vfs1.def" 59 60 #include "ipc/ping_pong.def" -
uspace/app/tester/tester.h
r002252a r5eb5dcf 73 73 extern char *test_fault1(void); 74 74 extern char *test_fault2(void); 75 extern char *test_fault3(void); 75 76 extern char *test_vfs1(void); 76 77 extern char *test_ping_pong(void); -
uspace/app/tester/vfs/vfs1.c
r002252a r5eb5dcf 85 85 return "Unable to create null device"; 86 86 87 snprintf(null, MAX_DEVICE_NAME, "null %d", null_id);87 snprintf(null, MAX_DEVICE_NAME, "null/%d", null_id); 88 88 int rc = mount(FS_TYPE, MOUNT_POINT, null, OPTIONS, FLAGS); 89 89 switch (rc) { -
uspace/app/tetris/Makefile
r002252a r5eb5dcf 34 34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/app/tetris/Makefile.build
r002252a r5eb5dcf 60 60 %.o: %.c $(DEPEND) 61 61 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 62 ifeq ($(PRECHECK),y) 63 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 64 endif 62 65 63 66 $(DEPEND): -
uspace/app/tetris/Makefile.common
r002252a r5eb5dcf 37 37 DEPEND = Makefile.depend 38 38 DEPEND_PREV = $(DEPEND).prev 39 JOB = tetris.job 39 40 OUTPUT = tetris -
uspace/app/trace/Makefile
r002252a r5eb5dcf 34 34 all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS) 35 35 -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV) 36 $(MAKE) -f Makefile.build 36 $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK) 37 37 38 38 clean: 39 rm -f $(DEPEND) $(DEPEND_PREV) $( OUTPUT) $(OUTPUT).map $(OUTPUT).disasm39 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm 40 40 find . -name '*.o' -follow -exec rm \{\} \; -
uspace/app/trace/Makefile.build
r002252a r5eb5dcf 61 61 %.o: %.c $(DEPEND) 62 62 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 63 ifeq ($(PRECHECK),y) 64 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 65 endif 63 66 64 67 $(DEPEND): -
uspace/app/trace/Makefile.common
r002252a r5eb5dcf 37 37 DEPEND = Makefile.depend 38 38 DEPEND_PREV = $(DEPEND).prev 39 JOB = trace.job 39 40 OUTPUT = trace -
uspace/app/trace/trace.c
r002252a r5eb5dcf 48 48 #include <io/console.h> 49 49 #include <io/keycode.h> 50 #include <fibril_sync .h>50 #include <fibril_synch.h> 51 51 52 52 #include <libc.h>
Note:
See TracChangeset
for help on using the changeset viewer.
