#include "../drivers.h"
#include <termios.h>
+#include <sys/ioctl.h>
+#include <sys/vm.h>
#include <minix/callnr.h>
#include <minix/com.h>
#include "tty.h"
}
+/*===========================================================================*
+ * do_video *
+ *===========================================================================*/
+PUBLIC void do_video(message *m)
+{
+ int i, n, r, ops, watch;
+ unsigned char c;
+
+ /* Execute the requested device driver function. */
+ r= EINVAL; /* just in case */
+ switch (m->m_type) {
+ case DEV_OPEN:
+ /* Should grant IOPL */
+ r= OK;
+ break;
+ case DEV_CLOSE:
+ r= OK;
+ break;
+ case DEV_IOCTL:
+ if (m->TTY_REQUEST == MIOCMAP || m->TTY_REQUEST == MIOCUNMAP)
+ {
+ int r, do_map;
+ struct mapreq mapreq;
+
+ do_map= (m->REQUEST == MIOCMAP); /* else unmap */
+
+ /* Get request structure */
+ r= sys_vircopy(m->PROC_NR, D,
+ (vir_bytes)m->ADDRESS,
+ SELF, D, (vir_bytes)&mapreq, sizeof(mapreq));
+ if (r != OK)
+ {
+ tty_reply(TASK_REPLY, m->m_source, m->PROC_NR,
+ r);
+ return;
+ }
+ r= sys_vm_map(m->PROC_NR, do_map,
+ (phys_bytes)mapreq.base, mapreq.size,
+ mapreq.offset);
+ tty_reply(TASK_REPLY, m->m_source, m->PROC_NR, r);
+ return;
+ }
+ r= ENOTTY;
+ break;
+
+ default:
+ printf(
+ "Warning, TTY(video) got unexpected request %d from %d\n",
+ m->m_type, m->m_source);
+ r= EINVAL;
+ }
+ tty_reply(TASK_REPLY, m->m_source, m->PROC_NR, r);
+}
+
+
/*===========================================================================*
* beep_x *
*===========================================================================*/
/* First minor numbers for the various classes of TTY devices. */
#define CONS_MINOR 0
-#define KBD_MINOR 13
-#define KBDAUX_MINOR 14
#define LOG_MINOR 15
#define RS232_MINOR 16
+#define KBD_MINOR 127
+#define KBDAUX_MINOR 126
+#define VIDEO_MINOR 125
#define TTYPX_MINOR 128
#define PTYPX_MINOR 192
_PROTOTYPE( int con_loadfont, (message *m) );
_PROTOTYPE( void select_console, (int cons_line) );
_PROTOTYPE( void beep_x, ( unsigned freq, clock_t dur) );
+_PROTOTYPE( void do_video, (message *m) );
/* keyboard.c */
_PROTOTYPE( void kb_init, (struct tty *tp) );