Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
cd3d739e
Commit
cd3d739e
authored
13 years ago
by
Frans Kaashoek
Browse files
Options
Downloads
Patches
Plain Diff
bootloader reads into a physical address (not a virtual address)
parent
fa81545f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bootmain.c
+7
-7
7 additions, 7 deletions
bootmain.c
with
7 additions
and
7 deletions
bootmain.c
+
7
−
7
View file @
cd3d739e
...
...
@@ -73,17 +73,17 @@ readsect(void *dst, uint offset)
insl
(
0x1F0
,
dst
,
SECTSIZE
/
4
);
}
// Read 'count' bytes at 'offset' from kernel into
virtu
al address '
v
a'.
// Read 'count' bytes at 'offset' from kernel into
physic
al address '
p
a'.
// Might copy more than asked.
void
readseg
(
uchar
*
v
a
,
uint
count
,
uint
offset
)
readseg
(
uchar
*
p
a
,
uint
count
,
uint
offset
)
{
uchar
*
e
v
a
;
uchar
*
e
p
a
;
e
v
a
=
v
a
+
count
;
e
p
a
=
p
a
+
count
;
// Round down to sector boundary.
v
a
-=
offset
%
SECTSIZE
;
p
a
-=
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
(;
v
a
<
e
v
a
;
v
a
+=
SECTSIZE
,
offset
++
)
readsect
(
v
a
,
offset
);
for
(;
p
a
<
e
p
a
;
p
a
+=
SECTSIZE
,
offset
++
)
readsect
(
p
a
,
offset
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment