Changeset 93b84b3 in mainline for generic/src
- Timestamp:
- 2005-12-12T16:30:07Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ebbdb8f
- Parents:
- af9a7c5
- Location:
- generic/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/console/console.c
raf9a7c5 r93b84b3 35 35 #include <typedefs.h> 36 36 #include <arch.h> 37 #include <func.h> 38 #include <print.h> 37 39 38 40 /** Standard input character device. */ … … 50 52 __u8 ch; 51 53 ipl_t ipl; 54 55 if (haltstate) { 56 /* If we are here, we are hopefully on the processor, that 57 * issued the 'halt' command, so proceed to read the character 58 * directly from input 59 */ 60 if (chardev->op->read) 61 return chardev->op->read(chardev); 62 /* no other way of interacting with user, halt */ 63 printf("cpu: halted - no kconsole\n"); 64 cpu_halt(); 65 } 52 66 53 67 waitq_sleep(&chardev->wq); … … 115 129 void putchar(char c) 116 130 { 117 stdout->op->write(stdout, c); 131 if (stdout->op->write) 132 stdout->op->write(stdout, c); 118 133 } -
generic/src/console/kconsole.c
raf9a7c5 r93b84b3 248 248 putchar(c); 249 249 break; 250 } if (c == '\b') { 250 } if (c == '\b') { /* Backspace */ 251 251 if (position == 0) 252 252 continue; … … 262 262 continue; 263 263 } 264 if (c == '\t') { 264 if (c == '\t') { /* Tabulator */ 265 265 int found; 266 266 … … 310 310 continue; 311 311 } 312 if (c == 0x1b) { 312 if (c == 0x1b) { /* Special command */ 313 313 mod = _getc(input); 314 314 c = _getc(input); … … 318 318 319 319 if (c == 0x33 && _getc(input) == 0x7e) { 320 /* Delete */ 320 321 if (position == curlen) 321 322 continue; … … 332 333 position = 0; 333 334 } 334 else if (c == 0x46) { 335 else if (c == 0x46) { /* End */ 335 336 for (i=position;i<curlen;i++) 336 337 putchar(current[i]); … … 356 357 rdln_print_c(' ',curlen); 357 358 rdln_print_c('\b',curlen); 358 if (c == 0x41) 359 if (c == 0x41) /* Up */ 359 360 histposition--; 360 361 else -
generic/src/lib/func.c
raf9a7c5 r93b84b3 33 33 #include <arch.h> 34 34 #include <typedefs.h> 35 #include <console/kconsole.h> 35 36 36 37 __u32 haltstate = 0; /**< Halt flag */ … … 46 47 haltstate = 1; 47 48 interrupts_disable(); 49 #ifdef CONFIG_DEBUG 50 printf("\n"); 51 kconsole(NULL); /* Run kconsole as a last resort to user */ 52 #endif 53 48 54 if (CPU) 49 55 printf("cpu%d: halted\n", CPU->id);
Note:
See TracChangeset
for help on using the changeset viewer.