summaryrefslogtreecommitdiff
path: root/sys/src/boot
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-04-20 11:17:33 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-04-20 11:17:33 +0000
commit999cc5fd21233eff058377a58db6839a245225f0 (patch)
treeb9c96844cde655ed158af5a6acd47ab3cf84a5e1 /sys/src/boot
parente2876cdfc7dc8f3509ee196f6dbcb020560d91dc (diff)
9boot: initialize the junk portion of pxe unload call
Diffstat (limited to 'sys/src/boot')
-rw-r--r--sys/src/boot/pc/pxe.c2
-rw-r--r--sys/src/boot/pc/sub.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/sys/src/boot/pc/pxe.c b/sys/src/boot/pc/pxe.c
index 1df2cae79..5fefd72b0 100644
--- a/sys/src/boot/pc/pxe.c
+++ b/sys/src/boot/pc/pxe.c
@@ -113,7 +113,7 @@ unload(void)
uchar status[2];
uchar junk[10];
} buf;
- puts(buf.status, 0);
+ memset(&buf, 0, sizeof(buf));
pxecall(0x70, &buf);
}
diff --git a/sys/src/boot/pc/sub.c b/sys/src/boot/pc/sub.c
index 63bd5dd47..40a77fd3b 100644
--- a/sys/src/boot/pc/sub.c
+++ b/sys/src/boot/pc/sub.c
@@ -18,6 +18,7 @@ memmove(void *dst, void *src, int n)
{
uchar *d = dst;
uchar *s = src;
+
if(d < s){
while(n > 0){
*d++ = *s++;
@@ -210,6 +211,8 @@ bootkern(void *f)
return "bad header";
if(beswal(ex.magic) != I_MAGIC)
return "bad magic";
+
+ /* load address */
e = (uchar*)(beswal(ex.entry) & ~0xF0000000UL);
/*
@@ -219,6 +222,7 @@ bootkern(void *f)
* we finished, move it to final location.
*/
t = (uchar*)0x200000;
+
n = beswal(ex.text);
if(readn(f, t, n) != n)
goto Error;
@@ -227,7 +231,9 @@ bootkern(void *f)
if(readn(f, d, n) != n)
goto Error;
close(f);
+
unload();
+
n = (d + n) - t;
memmove(e, t, n);
jump(e);