9boot: initialize the junk portion of pxe unload call
This commit is contained in:
parent
e2876cdfc7
commit
999cc5fd21
2 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue