Changeset e8a9dc3 in mainline
- Timestamp:
- 2005-12-10T16:37:20Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e5fcf00
- Parents:
- f7f6f25
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/drivers/ega.c
rf7f6f25 re8a9dc3 100 100 101 101 switch (ch) { 102 102 case '\n': 103 103 ega_cursor = (ega_cursor + ROW) - ega_cursor % ROW; 104 104 break; 105 105 case '\t': 106 106 ega_cursor = (ega_cursor + 8) - ega_cursor % 8; 107 107 break; 108 default: 108 case '\b': 109 if (ega_cursor % ROW) 110 ega_cursor--; 111 break; 112 default: 109 113 ega_display_char(ch); 110 114 ega_cursor++; -
arch/ia32/src/drivers/i8042.c
rf7f6f25 re8a9dc3 82 82 SPECIAL, /* 0x01 - Esc */ 83 83 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 84 SPECIAL, /* 0x0e - Backspace */84 '\b', /* 0x0e - Backspace */ 85 85 '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', 86 86 SPECIAL, /* 0x1d - LCtrl */ -
arch/mips32/src/drivers/arc.c
rf7f6f25 re8a9dc3 210 210 if (ch == '\r') 211 211 ch = '\n'; 212 212 if (ch == 0x7f) 213 ch = '\b'; 214 213 215 chardev_push_character(&console, ch); 214 216 } -
arch/mips32/src/drivers/msim.c
rf7f6f25 re8a9dc3 62 62 } 63 63 64 #include <print.h> 64 65 /** Process keyboard interrupt. */ 65 66 static void msim_interrupt(int n, void *stack) … … 70 71 if (ch =='\r') 71 72 ch = '\n'; 73 if (ch == 0x7f) 74 ch = '\b'; 72 75 chardev_push_character(&console, ch); 73 76 } -
generic/src/console/chardev.c
rf7f6f25 re8a9dc3 63 63 } 64 64 65 putchar(ch);66 65 chardev->buffer[chardev->index++] = ch; 67 66 chardev->index = chardev->index % CHARDEV_BUFLEN; /* index modulo size of buffer */ -
generic/src/console/console.c
rf7f6f25 re8a9dc3 40 40 chardev_t *stdout = NULL; 41 41 42 /** Get character from character device. 43 * 44 * @param chardev Character device. 45 * 46 * @return Character read. 47 */ 48 static __u8 _getc(chardev_t *chardev) 49 { 50 __u8 ch; 51 ipl_t ipl; 52 53 waitq_sleep(&chardev->wq); 54 ipl = interrupts_disable(); 55 spinlock_lock(&chardev->lock); 56 ch = chardev->buffer[(chardev->index - chardev->counter) % CHARDEV_BUFLEN]; 57 chardev->counter--; 58 spinlock_unlock(&chardev->lock); 59 interrupts_restore(ipl); 60 61 chardev->op->resume(chardev); 62 63 return ch; 64 } 65 42 66 /** Get string from character device. 43 67 * … … 57 81 58 82 while (index < buflen) { 59 ch = getc(chardev); 83 ch = _getc(chardev); 84 if (ch == '\b') { 85 if (index > 0) { 86 index--; 87 /* Space backspace, space */ 88 putchar('\b'); 89 putchar(' '); 90 putchar('\b'); 91 } 92 continue; 93 } 94 putchar(ch); 95 60 96 if (ch == '\n') { /* end of string => write 0, return */ 61 97 buf[index] = '\0'; … … 67 103 } 68 104 69 /** Get character from character device. 70 * 71 * @param chardev Character device. 72 * 73 * @return Character read. 74 */ 105 /** Get character from device & echo it to screen */ 75 106 __u8 getc(chardev_t *chardev) 76 107 { 77 108 __u8 ch; 78 ipl_t ipl;79 109 80 waitq_sleep(&chardev->wq); 81 ipl = interrupts_disable(); 82 spinlock_lock(&chardev->lock); 83 ch = chardev->buffer[(chardev->index - chardev->counter) % CHARDEV_BUFLEN]; 84 chardev->counter--; 85 spinlock_unlock(&chardev->lock); 86 interrupts_restore(ipl); 87 88 chardev->op->resume(chardev); 89 110 ch = _getc(chardev); 111 putchar(ch); 90 112 return ch; 91 113 }
Note:
See TracChangeset
for help on using the changeset viewer.