Changed to use sys_readbios to get screen parameters. Added safecopy version

to get log messages.
This commit is contained in:
Philip Homburg 2006-07-10 12:37:39 +00:00
parent a3fce7ce8d
commit ee09d50403
3 changed files with 32 additions and 8 deletions

View file

@ -938,14 +938,14 @@ tty_t *tp;
if (! vdu_initialized++) { if (! vdu_initialized++) {
/* How about error checking? What to do on failure??? */ /* How about error checking? What to do on failure??? */
s=sys_vircopy(SELF, BIOS_SEG, (vir_bytes) VDU_SCREEN_COLS_ADDR, s=sys_readbios(VDU_SCREEN_COLS_ADDR, &bios_columns,
SELF, D, (vir_bytes) &bios_columns, VDU_SCREEN_COLS_SIZE); VDU_SCREEN_COLS_SIZE);
s=sys_vircopy(SELF, BIOS_SEG, (vir_bytes) VDU_CRT_BASE_ADDR, s=sys_readbios(VDU_CRT_BASE_ADDR, &bios_crtbase,
SELF, D, (vir_bytes) &bios_crtbase, VDU_CRT_BASE_SIZE); VDU_CRT_BASE_SIZE);
s=sys_vircopy(SELF, BIOS_SEG, (vir_bytes) VDU_SCREEN_ROWS_ADDR, s=sys_readbios( VDU_SCREEN_ROWS_ADDR, &bios_rows,
SELF, D, (vir_bytes) &bios_rows, VDU_SCREEN_ROWS_SIZE); VDU_SCREEN_ROWS_SIZE);
s=sys_vircopy(SELF, BIOS_SEG, (vir_bytes) VDU_FONTLINES_ADDR, s=sys_readbios(VDU_FONTLINES_ADDR, &bios_fontlines,
SELF, D, (vir_bytes) &bios_fontlines, VDU_FONTLINES_SIZE); VDU_FONTLINES_SIZE);
vid_port = bios_crtbase; vid_port = bios_crtbase;
scr_width = bios_columns; scr_width = bios_columns;
@ -1130,6 +1130,26 @@ message *m_ptr; /* pointer to request message */
send(m_ptr->m_source, m_ptr); 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 * * cons_putk *
*===========================================================================*/ *===========================================================================*/

View file

@ -221,6 +221,9 @@ PUBLIC void main(void)
case GET_KMESS: case GET_KMESS:
do_get_kmess(&tty_mess); do_get_kmess(&tty_mess);
continue; continue;
case GET_KMESS_S:
do_get_kmess_s(&tty_mess);
continue;
case FKEY_CONTROL: /* (un)register a fkey observer */ case FKEY_CONTROL: /* (un)register a fkey observer */
do_fkey_ctl(&tty_mess); do_fkey_ctl(&tty_mess);
continue; continue;

View file

@ -173,6 +173,7 @@ _PROTOTYPE( void cons_stop, (void) );
_PROTOTYPE( void do_new_kmess, (message *m) ); _PROTOTYPE( void do_new_kmess, (message *m) );
_PROTOTYPE( void do_diagnostics, (message *m, int safe) ); _PROTOTYPE( void do_diagnostics, (message *m, int safe) );
_PROTOTYPE( void do_get_kmess, (message *m) ); _PROTOTYPE( void do_get_kmess, (message *m) );
_PROTOTYPE( void do_get_kmess_s, (message *m) );
_PROTOTYPE( void scr_init, (struct tty *tp) ); _PROTOTYPE( void scr_init, (struct tty *tp) );
_PROTOTYPE( void toggle_scroll, (void) ); _PROTOTYPE( void toggle_scroll, (void) );
_PROTOTYPE( int con_loadfont, (message *m) ); _PROTOTYPE( int con_loadfont, (message *m) );