summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2011-08-17 20:52:28 -0400
committerFrans Kaashoek <[email protected]>2011-08-17 20:52:28 -0400
commitcd3d739e6f3d4d356ac8c34b25f16df82a5f2789 (patch)
tree5256486c6e7b26da9d665ecdcc0682b9bee7df65
parentfa81545f1c15630573dc1d312fa75f261f82b9f1 (diff)
downloadxv6-labs-cd3d739e6f3d4d356ac8c34b25f16df82a5f2789.tar.gz
xv6-labs-cd3d739e6f3d4d356ac8c34b25f16df82a5f2789.tar.bz2
xv6-labs-cd3d739e6f3d4d356ac8c34b25f16df82a5f2789.zip
bootloader reads into a physical address (not a virtual address)
-rw-r--r--bootmain.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/bootmain.c b/bootmain.c
index c2d6050..6c9f1ff 100644
--- a/bootmain.c
+++ b/bootmain.c
@@ -73,17 +73,17 @@ readsect(void *dst, uint offset)
insl(0x1F0, dst, SECTSIZE/4);
}
-// Read 'count' bytes at 'offset' from kernel into virtual address 'va'.
+// Read 'count' bytes at 'offset' from kernel into physical address 'pa'.
// Might copy more than asked.
void
-readseg(uchar* va, uint count, uint offset)
+readseg(uchar* pa, uint count, uint offset)
{
- uchar* eva;
+ uchar* epa;
- eva = va + count;
+ epa = pa + count;
// Round down to sector boundary.
- va -= offset % SECTSIZE;
+ pa -= offset % SECTSIZE;
// Translate from bytes to sectors; kernel starts at sector 1.
offset = (offset / SECTSIZE) + 1;
@@ -91,6 +91,6 @@ readseg(uchar* va, uint count, uint offset)
// If this is too slow, we could read lots of sectors at a time.
// We'd write more to memory than asked, but it doesn't matter --
// we load in increasing order.
- for(; va < eva; va += SECTSIZE, offset++)
- readsect(va, offset);
+ for(; pa < epa; pa += SECTSIZE, offset++)
+ readsect(pa, offset);
}