Skip to contentSkip to conversation

serial-split.c

PATCH New Charles Coffing 1 participant 1 message Feb 22, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial-split.c

A while back (probably a few months, actually) I saw others struggling to make sense of nsplitd. I had never managed to get nsplitd working either, so I wrote a simple tool to split a serial port between two TCP ports. Rather than letting it rot on my disk, here's the patch.

cd into tools/misc/serial-split and run "make" to build it.

Usage is as simple as running "serial-split" with no args. This will (by default) split COM1 (running at 115200/8N1) between ports 12010 and 12011. Attach gdb with "target remote localhost:12011". Attach to the console with (perhaps) "tools/misc/xencons localhost 12010".

Run "serial-split --help" for more help, or look at the comment at the top of the file for a setup scenario.

Hope someone else finds this useful.
Charles

tools/misc/serial-split/Makefile +18 -0
diff -ruN xen-2.0.bk.orig/tools/misc/serial-split/Makefile xen-2.0.bk/tools/misc/serial-split/Makefile
@@ -0,0 +1,18 @@
+CC     = gcc
+CFLAGS = -Wall -O3
+CFILES = $(wildcard *.c)
+OBJS   = $(patsubst %.c,%.o,$(wildcard *.c))
+TARGET = serial-split
+
+all: $(TARGET)
+
+install: all
+
+clean:
+	rm *.o $(TARGET) *~
+
+$(TARGET): $(OBJS)
+	$(CC) $(CFLAGS) -o $@ $^
+
+%.o: %.c Makefile
+	$(CC) $(CFLAGS) -c -o $@ $<
tools/misc/serial-split/serial-split.c +422 -0

422 lines not on this page · raw message