aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board-qemu/slof/Makefile8
-rw-r--r--clients/net-snk/app/main.c2
-rw-r--r--lib/libnet/libnet.code19
-rw-r--r--lib/libnet/libnet.in2
-rw-r--r--slof/fs/packages/obp-tftp.fs7
5 files changed, 30 insertions, 8 deletions
diff --git a/board-qemu/slof/Makefile b/board-qemu/slof/Makefile
index cf57f16..02d819b 100644
--- a/board-qemu/slof/Makefile
+++ b/board-qemu/slof/Makefile
@@ -21,7 +21,7 @@ all: version.o Makefile.dep OF.ffs paflof $(SLOFCMNDIR)/xvect.bin
CPPFLAGS = -I$(LIBCMNDIR)/libbootmsg -I$(LIBCMNDIR)/libhvcall \
-I$(LIBCMNDIR)/libvirtio -I$(LIBCMNDIR)/libnvram \
-I$(LIBCMNDIR)/libusb -I$(LIBCMNDIR)/libveth \
- -I$(LIBCMNDIR)/libe1k
+ -I$(LIBCMNDIR)/libe1k -I$(LIBCMNDIR)/libnet
SLOF_LIBS = \
$(LIBCMNDIR)/libbootmsg.a \
$(LIBCMNDIR)/libelf.a \
@@ -30,7 +30,8 @@ SLOF_LIBS = \
$(LIBCMNDIR)/libusb.a \
$(LIBCMNDIR)/libnvram.a \
$(LIBCMNDIR)/libveth.a \
- $(LIBCMNDIR)/libe1k.a
+ $(LIBCMNDIR)/libe1k.a \
+ $(LIBCMNDIR)/libnet.a
BOARD_SLOF_IN = \
$(LIBCMNDIR)/libhvcall/hvcall.in \
$(LIBCMNDIR)/libvirtio/virtio.in \
@@ -40,7 +41,8 @@ BOARD_SLOF_IN = \
$(LIBCMNDIR)/libnvram/libnvram.in \
$(LIBCMNDIR)/libbases/libbases.in \
$(LIBCMNDIR)/libveth/veth.in \
- $(LIBCMNDIR)/libe1k/e1k.in
+ $(LIBCMNDIR)/libe1k/e1k.in \
+ $(LIBCMNDIR)/libnet/libnet.in
BOARD_SLOF_CODE = $(BOARD_SLOF_IN:%.in=%.code)
include $(SLOFCMNDIR)/Makefile.inc
diff --git a/clients/net-snk/app/main.c b/clients/net-snk/app/main.c
index 22aeba7..3a01ac6 100644
--- a/clients/net-snk/app/main.c
+++ b/clients/net-snk/app/main.c
@@ -31,8 +31,6 @@ main(int argc, char *argv[])
int i;
of_set_callback((void *) &_callback_entry);
- if (strcmp(argv[0], "netboot") == 0 && argc >= 5)
- return netboot(argc, argv);
if (strcmp(argv[0], "ping") == 0)
return ping(argc, argv);
#ifdef SNK_BIOSEMU_APPS
diff --git a/lib/libnet/libnet.code b/lib/libnet/libnet.code
new file mode 100644
index 0000000..66f955f
--- /dev/null
+++ b/lib/libnet/libnet.code
@@ -0,0 +1,19 @@
+
+#include <netapps.h>
+
+PRIM(NET_X2d_LOAD)
+ int slen = TOS.n; POP;
+ char *arg = TOS.a;
+ char *argvs[8];
+ int i, p;
+ argvs[0] = arg;
+ i = 1;
+ for (p = 0; p < slen; p++) {
+ if (arg[p] == ' ') {
+ arg[p] = 0;
+ argvs[i] = &arg[p + 1];
+ i++;
+ }
+ }
+ TOS.n = netboot(i, argvs);
+MIRP
diff --git a/lib/libnet/libnet.in b/lib/libnet/libnet.in
new file mode 100644
index 0000000..365587c
--- /dev/null
+++ b/lib/libnet/libnet.in
@@ -0,0 +1,2 @@
+
+cod(NET-LOAD)
diff --git a/slof/fs/packages/obp-tftp.fs b/slof/fs/packages/obp-tftp.fs
index 047c9b6..e26025d 100644
--- a/slof/fs/packages/obp-tftp.fs
+++ b/slof/fs/packages/obp-tftp.fs
@@ -38,15 +38,16 @@ INSTANCE VARIABLE ciregs-buffer
(u.) s" netboot " 2swap $cat s" 60000000 " $cat
\ Allocate 1720 bytes to store the BOOTP-REPLY packet
- 6B8 alloc-mem dup >r (u.) $cat s" " $cat
+ 6B8 alloc-mem dup >r (u.) $cat
huge-tftp-load @ IF s" 1 " ELSE s" 0 " THEN $cat
\ Add desired TFTP-Blocksize as additional argument
s" 1432 " $cat
\ Add OBP-TFTP Bootstring argument, e.g. "10.128.0.1,bootrom.bin,10.128.40.1"
my-args $cat
+ \ Zero-terminate string
+ s" " $cat 2dup + 1 - 0 swap c!
- \ Call SNK netboot loadr
- (client-exec) dup 0< IF drop 0 THEN
+ net-load dup 0< IF drop 0 THEN
\ Restore to old client interface register
ciregs-buffer @ ciregs ciregs-size move