Changeset 93b84b3 in mainline for generic/src


Ignore:
Timestamp:
2005-12-12T16:30:07Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ebbdb8f
Parents:
af9a7c5
Message:

Fixed weird simics panic.
Run kconsole, if we panic. This currently works in gxemul,
simics. In mips we need to modify the simulator.
On ia32 we need a function, that would speak directly to the chip
and fetch the character using polling.

Location:
generic/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • generic/src/console/console.c

    raf9a7c5 r93b84b3  
    3535#include <typedefs.h>
    3636#include <arch.h>
     37#include <func.h>
     38#include <print.h>
    3739
    3840/** Standard input character device. */
     
    5052        __u8 ch;
    5153        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        }
    5266
    5367        waitq_sleep(&chardev->wq);
     
    115129void putchar(char c)
    116130{
    117         stdout->op->write(stdout, c);
     131        if (stdout->op->write)
     132                stdout->op->write(stdout, c);
    118133}
  • generic/src/console/kconsole.c

    raf9a7c5 r93b84b3  
    248248                        putchar(c);
    249249                        break;
    250                 } if (c == '\b') {
     250                } if (c == '\b') { /* Backspace */
    251251                        if (position == 0)
    252252                                continue;
     
    262262                        continue;
    263263                }
    264                 if (c == '\t') {
     264                if (c == '\t') { /* Tabulator */
    265265                        int found;
    266266
     
    310310                        continue;
    311311                }
    312                 if (c == 0x1b) {
     312                if (c == 0x1b) { /* Special command */
    313313                        mod = _getc(input);
    314314                        c = _getc(input);
     
    318318
    319319                        if (c == 0x33 && _getc(input) == 0x7e) {
     320                                /* Delete */
    320321                                if (position == curlen)
    321322                                        continue;
     
    332333                                position = 0;
    333334                        }
    334                         else if (c == 0x46) {
     335                        else if (c == 0x46) {  /* End */
    335336                                for (i=position;i<curlen;i++)
    336337                                        putchar(current[i]);
     
    356357                                rdln_print_c(' ',curlen);
    357358                                rdln_print_c('\b',curlen);
    358                                 if (c == 0x41)
     359                                if (c == 0x41) /* Up */
    359360                                        histposition--;
    360361                                else
  • generic/src/lib/func.c

    raf9a7c5 r93b84b3  
    3333#include <arch.h>
    3434#include <typedefs.h>
     35#include <console/kconsole.h>
    3536
    3637__u32   haltstate = 0; /**< Halt flag */
     
    4647        haltstate = 1;
    4748        interrupts_disable();
     49#ifdef CONFIG_DEBUG
     50        printf("\n");
     51        kconsole(NULL); /* Run kconsole as a last resort to user */
     52#endif     
     53
    4854        if (CPU)
    4955                printf("cpu%d: halted\n", CPU->id);
Note: See TracChangeset for help on using the changeset viewer.