]> Zhao Yanbai Git Server - minix.git/commitdiff
Changed to use sys_readbios to get screen parameters. Added safecopy version
authorPhilip Homburg <philip@cs.vu.nl>
Mon, 10 Jul 2006 12:37:39 +0000 (12:37 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Mon, 10 Jul 2006 12:37:39 +0000 (12:37 +0000)
to get log messages.

drivers/tty/console.c
drivers/tty/tty.c
drivers/tty/tty.h

index 57984be332735de93427a1a9bd07816388c3beb0..37ad0d436e48affbc6a569659049c8b96df05c2b 100644 (file)
@@ -938,14 +938,14 @@ tty_t *tp;
   if (! vdu_initialized++) {
 
        /* How about error checking? What to do on failure??? */
-       s=sys_vircopy(SELF, BIOS_SEG, (vir_bytes) VDU_SCREEN_COLS_ADDR,
-               SELF, D, (vir_bytes) &bios_columns, VDU_SCREEN_COLS_SIZE);
-       s=sys_vircopy(SELF, BIOS_SEG, (vir_bytes) VDU_CRT_BASE_ADDR, 
-               SELF, D, (vir_bytes) &bios_crtbase, VDU_CRT_BASE_SIZE);
-       s=sys_vircopy(SELF, BIOS_SEG, (vir_bytes) VDU_SCREEN_ROWS_ADDR, 
-               SELF, D, (vir_bytes) &bios_rows, VDU_SCREEN_ROWS_SIZE);
-       s=sys_vircopy(SELF, BIOS_SEG, (vir_bytes) VDU_FONTLINES_ADDR, 
-               SELF, D, (vir_bytes) &bios_fontlines, VDU_FONTLINES_SIZE);
+       s=sys_readbios(VDU_SCREEN_COLS_ADDR, &bios_columns,
+               VDU_SCREEN_COLS_SIZE);
+       s=sys_readbios(VDU_CRT_BASE_ADDR, &bios_crtbase,
+               VDU_CRT_BASE_SIZE);
+       s=sys_readbios( VDU_SCREEN_ROWS_ADDR, &bios_rows,
+               VDU_SCREEN_ROWS_SIZE);
+       s=sys_readbios(VDU_FONTLINES_ADDR, &bios_fontlines,
+               VDU_FONTLINES_SIZE);
 
        vid_port = bios_crtbase;
        scr_width = bios_columns;
@@ -1130,6 +1130,26 @@ message *m_ptr;                  /* pointer to request message */
   send(m_ptr->m_source, m_ptr);
 }
 
+/*===========================================================================*
+ *                             do_get_kmess_s                               *
+ *===========================================================================*/
+PUBLIC void do_get_kmess_s(m_ptr)
+message *m_ptr;                        /* pointer to request message */
+{
+/* Provide the log device with debug output */
+  cp_grant_id_t gid;
+  int r;
+
+  gid = m_ptr->GETKM_GRANT;
+  r= OK;
+  if (sys_safecopyto(m_ptr->m_source, gid, 0, (vir_bytes)&kmess, sizeof(kmess),
+       D) != OK) {
+       r = EFAULT;
+  }
+  m_ptr->m_type = r;
+  send(m_ptr->m_source, m_ptr);
+}
+
 /*===========================================================================*
  *                             cons_putk                                    *
  *===========================================================================*/
index 2934deadc583a736ba94f19795d1c1e3431e526a..7af69877e6bffb5a76de3e38f1876f9bbeff4bcb 100644 (file)
@@ -221,6 +221,9 @@ PUBLIC void main(void)
        case GET_KMESS:
                do_get_kmess(&tty_mess);
                continue;
+       case GET_KMESS_S:
+               do_get_kmess_s(&tty_mess);
+               continue;
        case FKEY_CONTROL:              /* (un)register a fkey observer */
                do_fkey_ctl(&tty_mess);
                continue;
index a3fba614f7d90af543fcf21f25e7662260bf26c5..67a7e9349191df95d381347b2ca6643c36e694c1 100644 (file)
@@ -173,6 +173,7 @@ _PROTOTYPE( void cons_stop, (void)                                  );
 _PROTOTYPE( void do_new_kmess, (message *m)                            );
 _PROTOTYPE( void do_diagnostics, (message *m, int safe)                        );
 _PROTOTYPE( void do_get_kmess, (message *m)                            );
+_PROTOTYPE( void do_get_kmess_s, (message *m)                          );
 _PROTOTYPE( void scr_init, (struct tty *tp)                            );
 _PROTOTYPE( void toggle_scroll, (void)                                 );
 _PROTOTYPE( int con_loadfont, (message *m)                             );