shithub: riscv

Download patch

ref: 999cc5fd21233eff058377a58db6839a245225f0
parent: e2876cdfc7dc8f3509ee196f6dbcb020560d91dc
author: cinap_lenrek <cinap_lenrek@localhost>
date: Wed Apr 20 07:17:33 EDT 2011

9boot: initialize the junk portion of pxe unload call

--- a/sys/src/boot/pc/pxe.c
+++ b/sys/src/boot/pc/pxe.c
@@ -113,7 +113,7 @@
 		uchar status[2];
 		uchar junk[10];
 	} buf;
-	puts(buf.status, 0);
+	memset(&buf, 0, sizeof(buf));
 	pxecall(0x70, &buf);
 }
 
--- a/sys/src/boot/pc/sub.c
+++ b/sys/src/boot/pc/sub.c
@@ -18,6 +18,7 @@
 {
 	uchar *d = dst;
 	uchar *s = src;
+
 	if(d < s){
 		while(n > 0){
 			*d++ = *s++;
@@ -210,6 +211,8 @@
 		return "bad header";
 	if(beswal(ex.magic) != I_MAGIC)
 		return "bad magic";
+
+	/* load address */
 	e = (uchar*)(beswal(ex.entry) & ~0xF0000000UL);
 
 	/*
@@ -219,6 +222,7 @@
 	 * 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 @@
 	if(readn(f, d, n) != n)
 		goto Error;
 	close(f);
+
 	unload();
+
 	n = (d + n) - t;
 	memmove(e, t, n);
 	jump(e);