[Kos-cvs] kos/modules/console _console.c, 1.7, 1.8 console.c, 1.2, 1.3 _console.h, 1.2, 1.3 console.h, 1.1, 1.2

thomas at kos.enix.org thomas at kos.enix.org
Sun Jan 16 12:42:16 CET 2005


Update of /home/kos/cvs/kos/modules/console
In directory the-doors:/tmp/cvs-serv27084/modules/console

Modified Files:
	_console.c console.c _console.h console.h 
Log Message:
2005-01-16  Thomas Petazzoni  <thomas at crazy.kos.nx>

	* modules/i8042/i8042.c: Correct the name of init_module_level0 to
	init_module_level4, as reported by David Mentré.

	* modules/console/console.c: GPL header + doxygen documentation.

	* modules/console/console.h: GPL header + doxygen documentation.

	* modules/console/_console.h: GPL header + doxygen documentation.

	* modules/console/_console.c: GPL header + doxygen documentation.

	* modules/doc.cfg (PROJECT_NUMBER): Increment KOS version ;-)

	* doc/Makefile (SRCS): Add the helloworld documentation to the
	list of documentation automatically generated.

	* modules/debug/bochs.c: Some doxygen documentation.



Index: console.h
===================================================================
RCS file: /home/kos/cvs/kos/modules/console/console.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- console.h	25 May 2003 02:51:24 -0000	1.1
+++ console.h	16 Jan 2005 11:42:14 -0000	1.2
@@ -1,3 +1,30 @@
+/*
+ * Copyright (C) 2000-2005
+ * David Decotigny, Julien Munier, Thomas Petazzoni
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *
+ * @(#) $Id$
+ */
+
+/** @file
+ * PC Console driver public definitions
+ *
+ * @author Thomas Petazzoni, David Decotigny
+ */
 #ifndef __CONSOLE_H__
 #define __CONSOLE_H__
 

Index: _console.c
===================================================================
RCS file: /home/kos/cvs/kos/modules/console/_console.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- _console.c	6 Jan 2005 20:15:57 -0000	1.7
+++ _console.c	16 Jan 2005 11:42:14 -0000	1.8
@@ -1,3 +1,30 @@
+/*
+ * Copyright (C) 2000-2005
+ * David Decotigny, Julien Munier, Thomas Petazzoni
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *
+ * @(#) $Id$
+ */
+
+/** @file
+ * PC Console driver implementation
+ *
+ * @author Thomas Petazzoni, David Decotigny
+ */
 #include <console/_console.h>
 #include <kos/assert.h>
 #include <kos/macros.h>

Index: _console.h
===================================================================
RCS file: /home/kos/cvs/kos/modules/console/_console.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- _console.h	3 Jul 2003 20:57:03 -0000	1.2
+++ _console.h	16 Jan 2005 11:42:14 -0000	1.3
@@ -1,3 +1,30 @@
+/*
+ * Copyright (C) 2000-2005
+ * David Decotigny, Julien Munier, Thomas Petazzoni
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *
+ * @(#) $Id$
+ */
+
+/** @file
+ * PC Console driver private definitions
+ *
+ * @author Thomas Petazzoni, David Decotigny
+ */
 #ifndef ___CONSOLE_H__
 #define ___CONSOLE_H__
 
@@ -19,11 +46,10 @@
 #define ROWS    25
 
 typedef struct console {
-  int   usage; 
+  int   usage;
   volatile unsigned char *virt_addr;
   volatile unsigned char *back_buffer;
   int   attr;
 } console_t;
 
 #endif /* ___CONSOLE_H__ */
-

Index: console.c
===================================================================
RCS file: /home/kos/cvs/kos/modules/console/console.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- console.c	18 Aug 2003 17:05:26 -0000	1.2
+++ console.c	16 Jan 2005 11:42:14 -0000	1.3
@@ -1,32 +1,90 @@
+/*
+ * Copyright (C) 2000-2005
+ * David Decotigny, Julien Munier, Thomas Petazzoni
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *
+ * @(#) $Id$
+ */
+
+/** @file
+ * PC Console driver initialisation routines
+ *
+ * @author Thomas Petazzoni, David Decotigny
+ *
+ * This module contains a console driver for PC computers. It only
+ * supports the text-mode console available through the physical
+ * address 0xB8000. It provides functionalities that allows to have
+ * virtual consoles, and to switch between them.
+ *
+ * In order to do that, the driver conform to the tty_output_driver
+ * structure defined by the <i>tty</i> module (tty/tty.c).
+ */
+
 #include <loader/mod.h>
 #include <console/_console.h>
 #include <kos/assert.h>
 #include <kos/macros.h>
 #include <tty/tty.h>
 
+/**
+ * Pointer to the video memory in virtual memory. Since we do not use
+ * identity mapping, the video memory cannot be accessed at 0xB8000,
+ * but at some other address set up by the loader. This address is
+ * given by the loader to the kernel through the kernel_parameter_t
+ * structure.
+ */
 volatile unsigned char *video;
 
 extern struct tty_output_driver console_output_driver;
 
 tty_output_driver_t *console_get_output_driver(void);
 
+/**
+ * This function is called by the <i>tty</i> module to fetch the
+ * definition of the current console driver.
+ */
 tty_output_driver_t *console_get_output_driver(void) {
   return & console_output_driver;
 }
 
+/**
+ * Information about all consoles
+ */
 console_t consoles[MAX_CONSOLE];
 
+/**
+ * Initialisation function executed at level 0, in order to have the
+ * ability to display messages as soon as possible.
+ *
+ * It is not possible to call printk() while executing this function
+ * because the console is not ready.
+ */
 __init_text static int init_module_level0(kernel_parameter_t *kp)
 {
   int i;
   UNUSED(kp);
 
-  /* Cannot printk() in this function ! */
-  for (i = 0; i < MAX_CONSOLE; i++) 
+  /* Initializes the consoles structure */
+  for (i = 0; i < MAX_CONSOLE; i++)
     {
       consoles[i].usage = 0;
     }
 
+  /* Keep the pointer to video memory somewhere */
   video = (unsigned char *) kp->video_memory;
 
   return 0;



More information about the Kos-cvs mailing list