Browse Source

Added ping telnet and dhcpclient. Added bindings to boot.fs. Solved little bug in BUILD

rafael 9 years ago
parent
commit
5575daf527
6 changed files with 44 additions and 10 deletions
  1. 2 2
      BUILD
  2. 30 1
      BUILD.conf
  3. 2 0
      sys/src/9/k10/boot.fs
  4. 3 0
      sys/src/9/k10/k8cpu
  5. 2 2
      sys/src/cmd/ip/dhcpclient.c
  6. 5 5
      sys/src/cmd/ip/telnet.h

+ 2 - 2
BUILD

@@ -220,7 +220,7 @@ compile_kernel()
 
 	## Rest of programs into ramfs ##
 
-	RAMFS_LIST="bind mount echo cat cp ls ip/ipconfig/ipconfig ps mkdir pwd chmod rio/rio date dd aux/vga/vga"
+	RAMFS_LIST="bind mount echo cat cp ls ip/ipconfig/ipconfig ip/ping ip/telnet ip/dhcpclient ps mkdir pwd chmod rio/rio date dd aux/vga/vga"
 
 	for elem in $RAMFS_LIST
 	do
@@ -649,7 +649,7 @@ build_a_cmd()
 			LD_LIBS=`process_libs_to_link "$LIBS_TO_LINK"`
 			echo $LD $LDFLAGS $LDFLAGS_EXTRA $LD_LIBS -o $BUILD_OUT *.o
 			$LD $LDFLAGS_EXTRA $LDFLAGS -o $BUILD_OUT *.o $LD_LIBS
-		elif [ -n ""$BUILD_DIR"" ]
+		elif [ -n "$BUILD_DIR" ] && [ -d "$BUILD_DIR/$1" ]
 		then
 			LD_LIBS=`process_libs_to_link "$LIBS_TO_LINK"`
 			echo $LD $LDFLAGS $LDFLAGS_EXTRA $LD_LIBS -o $BUILD_OUT *.o

+ 30 - 1
BUILD.conf

@@ -53,7 +53,7 @@ BUILD_LIBS="lib9p libString libauth libauthsrv libavl libbin libbio libcomplete
 BUILD_KLIBS="libc libip"
 
 ### CMD ###
-BUILD_CMD="rc bind mount cat cp echo ls ipconfig ps mkdir pwd chmod rio date dd vga"
+BUILD_CMD="rc bind mount cat cp echo ls ipconfig ps mkdir pwd chmod rio date dd vga ping telnet dhcpclient"
 
 
 
@@ -148,6 +148,35 @@ cmd_vga()
 	LIBS_TO_LINK="ndb bio libc"
 	LDFLAGS_EXTRA="-static -e_main"
 }
+
+cmd_dhcpclient()
+{
+	BUILD_DIR=${CMD_DIR}/ip
+	BUILD_IN="dhcpclient.c"
+	BUILD_OUT="dhcpclient.elf.out"
+	CLEAN_COM="rm -f *.o"
+	LIBS_TO_LINK="bio ip libc"
+	LDFLAGS_EXTRA="-static -e_main"
+}
+
+cmd_telnet()
+{
+	BUILD_DIR=${CMD_DIR}/ip
+	BUILD_IN="telnet.c"
+	BUILD_OUT="telnet.elf.out"
+	CLEAN_COM="rm -f *.o"
+	LIBS_TO_LINK="bio ip libc"
+	LDFLAGS_EXTRA="-static -e_main"
+}
+cmd_ping()
+{
+	BUILD_DIR=${CMD_DIR}/ip
+	BUILD_IN="ping.c"
+	BUILD_OUT="ping.elf.out"
+	CLEAN_COM="rm -f *.o"
+	LIBS_TO_LINK="ndb bio ip libc"
+	LDFLAGS_EXTRA="-static -e_main"
+}
 cmd_ipconfig()
 {
 	BUILD_DIR=${CMD_DIR}/ip/ipconfig

+ 2 - 0
sys/src/9/k10/boot.fs

@@ -7,5 +7,7 @@ echo 'Hello, I am Harvey :-)'
 echo
 bind -a '#I' /net
 bind -a '#l0' /net
+bind -a '#p' /proc
+bind -a '#d' /fd
 exec /boot/rc -m/boot/rcmain -i
 

+ 3 - 0
sys/src/9/k10/k8cpu

@@ -83,6 +83,9 @@ rootdir
 #	/amd64/bin/auth/factotum factotum
 #	/amd64/bin/ip/ipconfig ipconfig
 	/amd64/bin/ipconfig
+	/amd64/bin/ping
+	/amd64/bin/telnet
+	/amd64/bin/dhcpclient
 #	/amd64/bin/usb/usbd
 	/amd64/bin/rc
 	/rc/lib/rcmain

+ 2 - 2
sys/src/cmd/ip/dhcpclient.c

@@ -130,7 +130,7 @@ usage(void)
 }
 
 void
-timerthread(void*)
+timerthread(void* v)
 {
 	for(;;) {
 		sleep(1000);
@@ -183,7 +183,7 @@ timerthread(void*)
 }
 
 void
-stdinthread(void*)
+stdinthread(void* v)
 {
 	uint8_t buf[100];
 	int n;

+ 5 - 5
sys/src/cmd/ip/telnet.h

@@ -60,7 +60,7 @@ struct Opt
 	int	code;
 	char	noway;	
 	int	(*change)(Biobuf*, int);	/* routine for status change */
-	int	(*sub)(Biobuf*, uchar*, int n);	/* routine for subnegotiation */
+	int	(*sub)(Biobuf*, uint8_t*, int n);	/* routine for subnegotiation */
 	char	remote;				/* remote value */
 	char	local;				/* local value */
 };
@@ -257,8 +257,8 @@ dont(Biobuf *bp)
 int
 sub(Biobuf *bp)
 {
-	uchar subneg[128];
-	uchar *p;
+	uint8_t subneg[128];
+	uint8_t *p;
 	Opt *o;
 	int c;
 
@@ -312,7 +312,7 @@ sendd(int c0, int c1)
 int
 send2(int f, int c0, int c1)
 {
-	uchar buf[2];
+	uint8_t buf[2];
 
 	buf[0] = c0;
 	buf[1] = c1;
@@ -322,7 +322,7 @@ send2(int f, int c0, int c1)
 int
 send3(int f, int c0, int c1, int c2)
 {
-	uchar buf[3];
+	uint8_t buf[3];
 
 	buf[0] = c0;
 	buf[1] = c1;