@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -0,0 +1,2 @@
+
+cod(NET-LOAD)
@@ -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
Now that all necessary functions are provided by Paflof, too, we can finally link the libnet code to this binary. To be able to call the netboot() function from the Forth code now, we also add a wrapper that takes the parameter string from the obp-tftp package and converts it to an argv array that is expected by the netboot() function. Signed-off-by: Thomas Huth <thuth@redhat.com> --- board-qemu/slof/Makefile | 8 +++++--- lib/libnet/libnet.code | 19 +++++++++++++++++++ lib/libnet/libnet.in | 2 ++ slof/fs/packages/obp-tftp.fs | 7 ++++--- 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 lib/libnet/libnet.code create mode 100644 lib/libnet/libnet.in