Ignore:
Timestamp:
Jul 7, 2017, 9:16:50 AM (5 years ago)
Author:
max@…
Message:

use a demultiplexer to get the channel on the serial port, and
make x86_printf print both on the VGA and COM1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_interrupt.c

    r152 r154  
    4949void hal_com1_intr(struct trapframe *tf)
    5050{
    51         char c = hal_com_read();
     51        static char prev;
     52        uint8_t chan;
     53        char c;
    5254
    53         x86_printf("-> got com '%c'\n", c);
     55        if (prev & 0x80) {
     56                /* the previous char was the channel number (tty) */
     57                c = hal_com_read();
     58                chan = prev & 0x7F;
     59                x86_printf("-> got com [%z,'%c']\n", (uint64_t)chan, c);
     60                prev = 0;
     61        } else {
     62                prev = hal_com_read();
     63        }
     64
    5465        return;
    5566}
Note: See TracChangeset for help on using the changeset viewer.