[Etherboot-developers] patch to fix tagged NBIs on Etherboot 5.1.2
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Miles N. <ca...@Iv...> - 2002-11-07 23:08:10
|
You may already be aware of this, but I needed the following four-line
patch to make the development version 5.1.2 posted on Sourceforge work
with my mknbi-1.2 mknbi-dos image.
-----8<-----
diff -urN etherboot-5.1.2-orig/src/nic.c etherboot-5.1.2/src/nic.c
--- etherboot-5.1.2-orig/src/nic.c Sat Nov 2 04:18:28 2002
+++ etherboot-5.1.2/src/nic.c Wed Nov 6 09:29:34 2002
@@ -587,8 +587,10 @@
if ((rc = fnc(tr->u.data.download,
++bcounter, len, len < packetsize)) <= 0)
return(rc);
- if (len < packetsize) /* End of data */
+ if (len < packetsize) { /* End of data --- fnc should not have returned */
+ printf("tftp download complete, but\n");
return (1);
+ }
}
return (0);
}
diff -urN etherboot-5.1.2-orig/src/osloader.c etherboot-5.1.2/src/osloader.c
--- etherboot-5.1.2-orig/src/osloader.c Tue Nov 5 20:35:26 2002
+++ etherboot-5.1.2/src/osloader.c Wed Nov 6 09:28:08 2002
@@ -535,7 +535,7 @@
} else
return 0;
}
- do {
+ for (;;) {
if (len == 0) /* Detect truncated files */
eof = 0;
while (tctx.seglen == 0) {
@@ -584,13 +584,15 @@
/* Avoid lock-up */
if ( sh.length == 0 ) longjmp(restart_etherboot, -2);
}
+ if ((len <= 0) && !eof)
+ break;
i = (tctx.seglen > len) ? len : tctx.seglen;
memcpy(phys_to_virt(curaddr), data, i);
tctx.seglen -= i;
curaddr += i;
len -= i;
data += i;
- } while ((len > 0) || eof);
+ }
return 0;
}
#endif
-----8<-----
Thanks for your work on Etherboot. It's much, much less crappy than I
remember it being five years ago. Take care.
--
Le fascisme est la dictature ouverte de la bourgeoisie.
-- Georg Dimitrov
|