Re: [Etherboot-developers] [COMMIT] 5.1.2+ boot from disk.
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Eric W B. <ebi...@ln...> - 2002-08-29 18:29:07
|
Eric W Biederman <ebi...@ln...> writes:
> That is one address I forget to check to see if it is safe to load. Want to
> take a look at that?
In particular something like:
printf("(NBI)");
/* Zero all context info */
memset(&tctx, 0, sizeof(tctx));
/* Copy first 4 longwords */
memcpy(&tctx.img, data, sizeof(tctx.img));
/* Memory location where we are supposed to save it */
tctx.segaddr = tctx.linlocation =
((tctx.img.u.segoff.ds) << 4) + tctx.img.u.segoff.bx;
+ if (!prep_segment(tctx.segaddr, tctx.segaddr + 512, tctx.segaddr + 512,
+ 0, 512) {
+ return 0;
+ }
/* Grab a copy */
memcpy(phys_to_virt(tctx.segaddr), data, 512);
/* Advance to first segment descriptor */
tctx.segaddr += ((tctx.img.length & 0x0F) << 2)
+ ((tctx.img.length & 0xF0) >> 2);
/* Remember to skip the first 512 data bytes */
tctx.first = 1;
Eric
|