diff options
author | Thomas Huth <thuth@redhat.com> | 2016-10-12 12:44:03 +0200 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2016-10-17 11:02:15 +1100 |
commit | a225adc3a14e56100730c35f626c32f5aeaba7dc (patch) | |
tree | fa211968d7b57fb9d7fc69ccbb2a345aa8cd4510 /lib | |
parent | ab3ce014ea462642de0ae29fdfab42fd99aa927c (diff) | |
download | SLOF-a225adc3a14e56100730c35f626c32f5aeaba7dc.zip SLOF-a225adc3a14e56100730c35f626c32f5aeaba7dc.tar.gz SLOF-a225adc3a14e56100730c35f626c32f5aeaba7dc.tar.bz2 |
Link libnet code to Paflof and add a wrapper for netboot()
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>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libnet/libnet.code | 19 | ||||
-rw-r--r-- | lib/libnet/libnet.in | 2 |
2 files changed, 21 insertions, 0 deletions
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) |