[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
hurd-l4 ./AUTHORS laden/ChangeLog laden/Makefil...
From: |
Marcus Brinkmann |
Subject: |
hurd-l4 ./AUTHORS laden/ChangeLog laden/Makefil... |
Date: |
Fri, 19 Sep 2003 13:49:59 -0400 |
CVSROOT: /cvsroot/hurd
Module name: hurd-l4
Branch:
Changes by: Marcus Brinkmann <address@hidden> 03/09/19 13:49:59
Modified files:
. : AUTHORS
laden : ChangeLog Makefile.am README ia32-output.c
output-vga.c output.c output.h
physmem : zalloc.c
wortel : Makefile.am README ia32-output.c output-vga.c
output.c output.h
Added files:
laden : output-serial.c
wortel : output-serial.c
Log message:
laden/
2003-09-19 Marcus Brinkmann <address@hidden>
* Makefile.am (laden_CFLAGS): Add -I$(top_srcdir)/libc-parts.
* output.c: Include <stdlib.h> and <string.h>.
* output.h (struct output_driver): Add CFG argument to INIT
function.
(output_init): Make NAME argument const, rename it to DRIVER.
* output.c (output_init): Likewise. Only check if the prefix of
DRIVER is a driver name. Then skip a trailing comma and pass the
remainder via the new variable DRIVER_CFG to the init function of
the driver.
* output-vga.c (vga_init): Add CFG argument.
* output-serial.c: New file by Daniel Wagner <address@hidden>.
wortel/
2003-09-19 Marcus Brinkmann <address@hidden>
* Makefile.am (wortel_CFLAGS): Add -I$(top_srcdir)/libc-parts.
* output.c: Include <stdlib.h> and <string.h>.
* output.h (struct output_driver): Add CFG argument to INIT
function.
(output_init): Make NAME argument const, rename it to DRIVER.
* output.c (output_init): Likewise. Only check if the prefix of
DRIVER is a driver name. Then skip a trailing comma and pass the
remainder via the new variable DRIVER_CFG to the init function of
the driver.
* output-vga.c (vga_init): Add CFG argument.
* output-serial.c: New file by Daniel Wagner <address@hidden>.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/AUTHORS.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/output-serial.c?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/ChangeLog.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/Makefile.am.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/README.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/ia32-output.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/output-vga.c.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/output.c.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/laden/output.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/physmem/zalloc.c.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/wortel/output-serial.c?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/wortel/Makefile.am.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/wortel/README.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/wortel/ia32-output.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/wortel/output-vga.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/wortel/output.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/hurd/hurd-l4/wortel/output.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: hurd-l4/AUTHORS
diff -u hurd-l4/AUTHORS:1.2 hurd-l4/AUTHORS:1.3
--- hurd-l4/AUTHORS:1.2 Fri Sep 19 10:18:04 2003
+++ hurd-l4/AUTHORS Fri Sep 19 13:49:59 2003
@@ -7,3 +7,7 @@
The zone allocator physmem/zalloc.h, physmem/zalloc.c was originally
written by:
Neal H Walfield <address@hidden>
+
+The serial output driver for laden and wortel (laden/output-serial.c,
+wortel/output-serial.c) was written by:
+Daniel Wagner <address@hidden>
Index: hurd-l4/laden/ChangeLog
diff -u hurd-l4/laden/ChangeLog:1.1 hurd-l4/laden/ChangeLog:1.2
--- hurd-l4/laden/ChangeLog:1.1 Sat Jul 26 13:26:09 2003
+++ hurd-l4/laden/ChangeLog Fri Sep 19 13:49:59 2003
@@ -1,3 +1,17 @@
+2003-09-19 Marcus Brinkmann <address@hidden>
+
+ * Makefile.am (laden_CFLAGS): Add -I$(top_srcdir)/libc-parts.
+ * output.c: Include <stdlib.h> and <string.h>.
+ * output.h (struct output_driver): Add CFG argument to INIT
+ function.
+ (output_init): Make NAME argument const, rename it to DRIVER.
+ * output.c (output_init): Likewise. Only check if the prefix of
+ DRIVER is a driver name. Then skip a trailing comma and pass the
+ remainder via the new variable DRIVER_CFG to the init function of
+ the driver.
+ * output-vga.c (vga_init): Add CFG argument.
+ * output-serial.c: New file by Daniel Wagner <address@hidden>.
+
2003-07-26 Marcus Brinkmann <address@hidden>
* Initial check-in.
Index: hurd-l4/laden/Makefile.am
diff -u hurd-l4/laden/Makefile.am:1.6 hurd-l4/laden/Makefile.am:1.7
--- hurd-l4/laden/Makefile.am:1.6 Fri Sep 12 20:25:50 2003
+++ hurd-l4/laden/Makefile.am Fri Sep 19 13:49:59 2003
@@ -20,12 +20,13 @@
if ARCH_IA32
ARCH_SOURCES = multiboot.h ia32-crt0.S ia32-cmain.c \
- ia32-output.c output-vga.c ia32-shutdown.c
+ ia32-output.c output-vga.c output-serial.c ia32-shutdown.c
endif
noinst_PROGRAMS = laden
-laden_CFLAGS = -I$(srcdir) -I$(top_srcdir)/include $(AM_CFLAGS)
+laden_CFLAGS = -I$(srcdir) -I$(top_srcdir)/include \
+ -I$(top_srcdir)/libc-parts $(AM_CFLAGS)
laden_SOURCES = $(ARCH_SOURCES) \
output.h output.c output-none.c \
Index: hurd-l4/laden/README
diff -u hurd-l4/laden/README:1.2 hurd-l4/laden/README:1.3
--- hurd-l4/laden/README:1.2 Sat Jul 26 15:19:14 2003
+++ hurd-l4/laden/README Fri Sep 19 13:49:59 2003
@@ -35,6 +35,23 @@
details). You can suppress all output by using the output driver
"none", which is available on all architectures.
+Some drivers support options. You list the options you want to use
+directly following the driver name, separated by commas. For example,
+to specify COM2 and a baud rate of 9600, you would use the option "-o
+serial,uart2,speed=9600". Note that spaces are not allowed (as spaces
+separate the arguments to laden). Which options are recognized
+depends on the driver.
+
+Serial output
+-------------
+
+The serial output driver supports options to configure the serial
+port. The following options are recognized:
+
+uart1 Select UART1 (aka COM1).
+uart2 Select UART2 (aka COM2).
+speed=BAUD Set the baud rate to BAUD. Possible values are 50 to 115200.
+
Architecture Specific Notes
===========================
@@ -51,4 +68,4 @@
The boot info field in the KIP will be set to the multiboot
information structure.
-On this architecture laden supports VGA output.
+On this architecture, laden supports VGA and serial output.
Index: hurd-l4/laden/ia32-output.c
diff -u hurd-l4/laden/ia32-output.c:1.2 hurd-l4/laden/ia32-output.c:1.3
--- hurd-l4/laden/ia32-output.c:1.2 Sun Sep 7 18:13:04 2003
+++ hurd-l4/laden/ia32-output.c Fri Sep 19 13:49:59 2003
@@ -26,12 +26,14 @@
extern struct output_driver vga_output;
+extern struct output_driver serial_output;
extern struct output_driver no_output;
/* A list of all output drivers, terminated with a null pointer. */
struct output_driver *output_drivers[] =
{
&vga_output,
+ &serial_output,
&no_output,
0
};
Index: hurd-l4/laden/output-vga.c
diff -u hurd-l4/laden/output-vga.c:1.3 hurd-l4/laden/output-vga.c:1.4
--- hurd-l4/laden/output-vga.c:1.3 Sun Sep 7 18:13:04 2003
+++ hurd-l4/laden/output-vga.c Fri Sep 19 13:49:59 2003
@@ -80,7 +80,7 @@
static void
-vga_init (void)
+vga_init (const char *cfg)
{
unsigned int pos = vga_get_cursor_pos ();
col = pos % VGA_COLUMNS;
Index: hurd-l4/laden/output.c
diff -u hurd-l4/laden/output.c:1.6 hurd-l4/laden/output.c:1.7
--- hurd-l4/laden/output.c:1.6 Thu Sep 18 14:04:30 2003
+++ hurd-l4/laden/output.c Fri Sep 19 13:49:59 2003
@@ -22,7 +22,9 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <stdarg.h>
+#include <string.h>
#include "output.h"
@@ -40,23 +42,32 @@
putchar or any other output routine. Returns 0 if NAME is not a
valid output driver name, otherwise 1 on success. */
int
-output_init (char *name)
+output_init (const char *driver)
{
+ const char *driver_cfg = NULL;
+
if (output)
{
output_deinit ();
output = 0;
}
- if (name)
+ if (driver)
{
struct output_driver **out = &output_drivers[0];
while (*out)
{
- if (!strcmp (name, (*out)->name))
+ unsigned int name_len = strlen ((*out)->name);
+ if (!strncmp (driver, (*out)->name, name_len))
{
- output = *out;
- break;
+ const char *cfg = driver + name_len;
+ if (!*cfg || *cfg == ',')
+ {
+ if (*cfg)
+ driver_cfg = cfg + 1;
+ output = *out;
+ break;
+ }
}
out++;
}
@@ -67,7 +78,7 @@
output = output_drivers[0];
if (output->init)
- (*output->init) ();
+ (*output->init) (driver_cfg);
return 1;
}
@@ -251,6 +262,8 @@
break;
case 'p':
+ putchar ('0');
+ putchar ('x');
print_nr ((unsigned int) va_arg (ap, void *), 16);
p++;
break;
Index: hurd-l4/laden/output.h
diff -u hurd-l4/laden/output.h:1.4 hurd-l4/laden/output.h:1.5
--- hurd-l4/laden/output.h:1.4 Mon Sep 15 14:18:58 2003
+++ hurd-l4/laden/output.h Fri Sep 19 13:49:59 2003
@@ -31,7 +31,7 @@
const char *name;
/* Initialize the output device. */
- void (*init) (void);
+ void (*init) (const char *cfg);
/* Deinitialize the output device. */
void (*deinit) (void);
@@ -47,16 +47,20 @@
extern struct output_driver *output_drivers[];
-/* Activate the output driver NAME or the default one if NAME is a
+/* Activate the output driver DRIVER or the default one if DRIVER is a
null pointer. Must be called once at startup, before calling
- putchar or any other output routine. Returns 0 if NAME is not a
- valid output driver name, otherwise 1 on success. */
-int output_init (char *name);
+ putchar or any other output routine. DRIVER has the pattern
+ NAME[,CONFIG...], for example "serial,uart2,speed=9600". Returns 0
+ if DRIVER is not a valid output driver specification, otherwise 1
+ on success. */
+int output_init (const char *driver);
+
/* Deactivate the output driver. Must be called after the last time
putchar or any other output routine is called. */
void output_deinit (void);
+
/* Print the single character CHR on the output device. */
int putchar (int chr);
@@ -66,6 +70,7 @@
/* True if debug mode is enabled. */
extern int output_debug;
+
/* Print a debug message. */
#define debug(...) do { if (output_debug) printf (__VA_ARGS__); } while (0)
Index: hurd-l4/physmem/zalloc.c
diff -u hurd-l4/physmem/zalloc.c:1.3 hurd-l4/physmem/zalloc.c:1.4
--- hurd-l4/physmem/zalloc.c:1.3 Wed Sep 17 10:22:59 2003
+++ hurd-l4/physmem/zalloc.c Fri Sep 19 13:49:59 2003
@@ -205,8 +205,6 @@
? block_align : size_align)
- L4_MIN_PAGE_SHIFT;
- printf ("block align: %u size_align: %u zone_nr: %u\n",
- block_align, size_align, zone_nr);
add_block ((struct block *) block, zone_nr);
block += ZONE_SIZE (zone_nr);
Index: hurd-l4/wortel/Makefile.am
diff -u hurd-l4/wortel/Makefile.am:1.7 hurd-l4/wortel/Makefile.am:1.8
--- hurd-l4/wortel/Makefile.am:1.7 Tue Sep 16 15:24:05 2003
+++ hurd-l4/wortel/Makefile.am Fri Sep 19 13:49:59 2003
@@ -20,12 +20,13 @@
if ARCH_IA32
ARCH_SOURCES = multiboot.h ia32-crt0.S ia32-cmain.c \
- ia32-output.c output-vga.c ia32-shutdown.c
+ ia32-output.c output-vga.c output-serial.c ia32-shutdown.c
endif
noinst_PROGRAMS = wortel
-wortel_CFLAGS = -I$(srcdir) -I$(top_srcdir)/include $(AM_CFLAGS)
+wortel_CFLAGS = -I$(srcdir) -I$(top_srcdir)/include \
+ -I$(top_srcdir)/libc-parts $(AM_CFLAGS)
wortel_SOURCES = $(ARCH_SOURCES) \
output.h output.c output-none.c \
Index: hurd-l4/wortel/README
diff -u hurd-l4/wortel/README:1.1 hurd-l4/wortel/README:1.2
--- hurd-l4/wortel/README:1.1 Tue Sep 9 17:43:12 2003
+++ hurd-l4/wortel/README Fri Sep 19 13:49:59 2003
@@ -7,3 +7,37 @@
For now, only a rudimentary part of the loader is written, and the
only useful thing wortel can do is to start the dummy physmem server
for a small demonstration.
+
+
+OUTPUT
+======
+
+The available output drivers are architecture specific (see below for
+details). You can suppress all output by using the output driver
+"none", which is available on all architectures.
+
+Some drivers support options. You list the options you want to use
+directly following the driver name, separated by commas. For example,
+to specify COM2 and a baud rate of 9600, you would use the option "-o
+serial,uart2,speed=9600". Note that spaces are not allowed (as spaces
+separate the arguments to wortel). Which options are recognized
+depends on the driver.
+
+Serial output
+-------------
+
+The serial output driver supports options to configure the serial
+port. The following options are recognized:
+
+uart1 Select UART1 (aka COM1).
+uart2 Select UART2 (aka COM2).
+speed=BAUD Set the baud rate to BAUD. Possible values are 50 to 115200.
+
+
+Architecture Specific Notes
+===========================
+
+ia32
+----
+
+On this architecture, wortel supports VGA and serial output.
Index: hurd-l4/wortel/ia32-output.c
diff -u hurd-l4/wortel/ia32-output.c:1.1 hurd-l4/wortel/ia32-output.c:1.2
--- hurd-l4/wortel/ia32-output.c:1.1 Sun Sep 7 21:00:18 2003
+++ hurd-l4/wortel/ia32-output.c Fri Sep 19 13:49:59 2003
@@ -26,12 +26,14 @@
extern struct output_driver vga_output;
+extern struct output_driver serial_output;
extern struct output_driver no_output;
/* A list of all output drivers, terminated with a null pointer. */
struct output_driver *output_drivers[] =
{
&vga_output,
+ &serial_output,
&no_output,
0
};
Index: hurd-l4/wortel/output-vga.c
diff -u hurd-l4/wortel/output-vga.c:1.1 hurd-l4/wortel/output-vga.c:1.2
--- hurd-l4/wortel/output-vga.c:1.1 Sun Sep 7 21:00:18 2003
+++ hurd-l4/wortel/output-vga.c Fri Sep 19 13:49:59 2003
@@ -80,7 +80,7 @@
static void
-vga_init (void)
+vga_init (const char *cfg)
{
unsigned int pos = vga_get_cursor_pos ();
col = pos % VGA_COLUMNS;
Index: hurd-l4/wortel/output.c
diff -u hurd-l4/wortel/output.c:1.5 hurd-l4/wortel/output.c:1.6
--- hurd-l4/wortel/output.c:1.5 Thu Sep 18 13:33:45 2003
+++ hurd-l4/wortel/output.c Fri Sep 19 13:49:59 2003
@@ -22,6 +22,7 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
@@ -41,23 +42,32 @@
putchar or any other output routine. Returns 0 if NAME is not a
valid output driver name, otherwise 1 on success. */
int
-output_init (char *name)
+output_init (const char *driver)
{
+ const char *driver_cfg = NULL;
+
if (output)
{
output_deinit ();
output = 0;
}
- if (name)
+ if (driver)
{
struct output_driver **out = &output_drivers[0];
while (*out)
{
- if (!strcmp (name, (*out)->name))
+ unsigned int name_len = strlen ((*out)->name);
+ if (!strncmp (driver, (*out)->name, name_len))
{
- output = *out;
- break;
+ const char *cfg = driver + name_len;
+ if (!*cfg || *cfg == ',')
+ {
+ if (*cfg)
+ driver_cfg = cfg + 1;
+ output = *out;
+ break;
+ }
}
out++;
}
@@ -68,7 +78,7 @@
output = output_drivers[0];
if (output->init)
- (*output->init) ();
+ (*output->init) (driver_cfg);
return 1;
}
Index: hurd-l4/wortel/output.h
diff -u hurd-l4/wortel/output.h:1.3 hurd-l4/wortel/output.h:1.4
--- hurd-l4/wortel/output.h:1.3 Mon Sep 15 14:18:58 2003
+++ hurd-l4/wortel/output.h Fri Sep 19 13:49:59 2003
@@ -31,7 +31,7 @@
const char *name;
/* Initialize the output device. */
- void (*init) (void);
+ void (*init) (const char *cfg);
/* Deinitialize the output device. */
void (*deinit) (void);
@@ -47,16 +47,20 @@
extern struct output_driver *output_drivers[];
-/* Activate the output driver NAME or the default one if NAME is a
+/* Activate the output driver DRIVER or the default one if DRIVER is a
null pointer. Must be called once at startup, before calling
- putchar or any other output routine. Returns 0 if NAME is not a
- valid output driver name, otherwise 1 on success. */
-int output_init (char *name);
+ putchar or any other output routine. DRIVER has the pattern
+ NAME[,CONFIG...], for example "serial,uart2,speed=9600". Returns 0
+ if DRIVER is not a valid output driver specification, otherwise 1
+ on success. */
+int output_init (const char *driver);
+
/* Deactivate the output driver. Must be called after the last time
putchar or any other output routine is called. */
void output_deinit (void);
+
/* Print the single character CHR on the output device. */
int putchar (int chr);
@@ -66,6 +70,7 @@
/* True if debug mode is enabled. */
extern int output_debug;
+
/* Print a debug message. */
#define debug(...) do { if (output_debug) printf (__VA_ARGS__); } while (0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- hurd-l4 ./AUTHORS laden/ChangeLog laden/Makefil...,
Marcus Brinkmann <=