-CSRCS = devlpr.c devtty.c devfd.c
+CSRCS = devlpr.c devtty.c devfd.c ttydw.c
CSRCS += devices.c main.c libc.c
CDSRCS = discard.c
dragon.o mem-nx32.o ../bankfixed.o \
../start.o ../version.o ../lowlevel-6809.o \
tricks.o main.o ../timer.o ../kdata.o devfd.o floppy.o devices.o \
- drivewire.o devdw.o \
+ drivewire.o devdw.o ttydw.o \
../devio.o ../filesys.o ../process.o ../inode.o ../syscall_fs.o \
../syscall_proc.o ../syscall_other.o ../mm.o ../swap.o \
../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o ../syscall_exec16.o \
#define CMDLINE NULL /* Location of root dev name */
/* Device parameters */
-#define NUM_DEV_TTY 2
+#define NUM_DEV_TTY 4
#define NDEVS 2 /* Devices 0..NDEVS-1 are capable of being mounted */
/* (add new mountable devices to beginning area.) */
#define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */
#define NMOUNTS 2 /* Number of mounts at a time */
#define swap_map(x) ((uint8_t *)(x))
+/* Drivewire Defines */
+
+#define DW_VSER_NUM 1 /* No of Virtual Serial Ports */
+#define DW_VWIN_NUM 1 /* No of Virtual Window Ports */
+#define DW_MIN_OFF 3 /* Minor number offset */
+
/* Remember to update platform-dragon-nx32/kernel.defs to match */
extern void platform_discard(void);
#include <devfd.h>
#include <vt.h>
#include <tty.h>
+#include <devdw.h>
+#include <ttydw.h>
#include <graphics.h>
#undef DEBUG /* UNdefine to delete debug code sequences */
unsigned char tbuf1[TTYSIZ];
unsigned char tbuf2[TTYSIZ];
+unsigned char tbuf3[TTYSIZ]; /* drivewire VSER 0 */
+unsigned char tbuf4[TTYSIZ]; /* drivewire VWIN 0 */
struct s_queue ttyinq[NUM_DEV_TTY + 1] = { /* ttyinq[0] is never used */
{NULL, NULL, NULL, 0, 0, 0},
{tbuf1, tbuf1, tbuf1, TTYSIZ, 0, TTYSIZ / 2},
- {tbuf2, tbuf2, tbuf2, TTYSIZ, 0, TTYSIZ / 2}
+ {tbuf2, tbuf2, tbuf2, TTYSIZ, 0, TTYSIZ / 2},
+ /* Drivewire Virtual Serial Ports */
+ {tbuf3, tbuf3, tbuf3, TTYSIZ, 0, TTYSIZ / 2},
+ {tbuf4, tbuf4, tbuf4, TTYSIZ, 0, TTYSIZ / 2},
};
uint8_t vtattr_cap = VTA_INVERSE|VTA_UNDERLINE|VTA_ITALIC|VTA_BOLD|
void tty_putc(uint8_t minor, unsigned char c)
{
+ if (minor > 2 ) {
+ dw_putc(minor, c);
+ return;
+ }
if (minor == 1) {
/* We don't do text except in 256x192 resolution modes */
if (vmode < 2)
void tty_setup(uint8_t minor)
{
uint8_t r;
+ if (minor > 2) {
+ dw_vopen(minor);
+ return;
+ }
if (minor != 2)
return;
r = ttydata[2].termios.c_cflag & CBAUD;
int tty_carrier(uint8_t minor)
{
+ if (minor > 2) return dw_carrier( minor );
/* The serial DCD is status bit 5 but not wired */
return 1;
}
}
fd_timer_tick();
timer_interrupt();
+ dw_vpoll();
}
}
int gfx_ioctl(uint8_t minor, uarg_t arg, char *ptr)
{
+ if (minor > 2) /* remove once DW get its own ioctl() */
+ return tty_ioctl(minor, arg, ptr);
if (arg >> 8 != 0x03)
return vt_ioctl(minor, arg, ptr);
switch(arg) {
}
return -1;
}
+
+/* A wrapper for tty_close that closes the DW port properly */
+int my_tty_close(uint8_t minor)
+{
+ if (minor > 2 && ttydata[minor].users == 1)
+ dw_vclose(minor);
+ return (tty_close(minor));
+}