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
5efca905
Commit
5efca905
authored
14 years ago
by
Austin Clements
Browse files
Options
Downloads
Patches
Plain Diff
Tab police
parent
5c4dc739
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
console.c
+2
-2
2 additions, 2 deletions
console.c
exec.c
+5
-5
5 additions, 5 deletions
exec.c
trap.c
+1
-1
1 addition, 1 deletion
trap.c
vm.c
+7
-7
7 additions, 7 deletions
vm.c
with
15 additions
and
15 deletions
console.c
+
2
−
2
View file @
5efca905
...
...
@@ -18,8 +18,8 @@ static void consputc(int);
static
int
panicked
=
0
;
static
struct
{
struct
spinlock
lock
;
int
locking
;
struct
spinlock
lock
;
int
locking
;
}
cons
;
static
void
...
...
This diff is collapsed.
Click to expand it.
exec.c
+
5
−
5
View file @
5efca905
...
...
@@ -30,7 +30,7 @@ exec(char *path, char **argv)
if
(
elf
.
magic
!=
ELF_MAGIC
)
goto
bad
;
if
(
!
(
pgdir
=
setupkvm
()))
if
(
!
(
pgdir
=
setupkvm
()))
goto
bad
;
// Load program into memory.
...
...
@@ -41,11 +41,11 @@ exec(char *path, char **argv)
continue
;
if
(
ph
.
memsz
<
ph
.
filesz
)
goto
bad
;
if
(
!
allocuvm
(
pgdir
,
(
char
*
)
ph
.
va
,
ph
.
memsz
))
if
(
!
allocuvm
(
pgdir
,
(
char
*
)
ph
.
va
,
ph
.
memsz
))
goto
bad
;
if
(
ph
.
va
+
ph
.
memsz
>
sz
)
sz
=
ph
.
va
+
ph
.
memsz
;
if
(
!
loaduvm
(
pgdir
,
(
char
*
)
ph
.
va
,
ip
,
ph
.
offset
,
ph
.
filesz
))
if
(
!
loaduvm
(
pgdir
,
(
char
*
)
ph
.
va
,
ip
,
ph
.
offset
,
ph
.
filesz
))
goto
bad
;
}
iunlockput
(
ip
);
...
...
@@ -53,7 +53,7 @@ exec(char *path, char **argv)
// Allocate and initialize stack at sz
sz
=
PGROUNDUP
(
sz
);
sz
+=
PGSIZE
;
// leave an invalid page
if
(
!
allocuvm
(
pgdir
,
(
char
*
)
sz
,
PGSIZE
))
if
(
!
allocuvm
(
pgdir
,
(
char
*
)
sz
,
PGSIZE
))
goto
bad
;
mem
=
uva2ka
(
pgdir
,
(
char
*
)
sz
);
spoffset
=
sz
;
...
...
@@ -105,7 +105,7 @@ exec(char *path, char **argv)
return
0
;
bad:
if
(
pgdir
)
freevm
(
pgdir
);
if
(
pgdir
)
freevm
(
pgdir
);
iunlockput
(
ip
);
return
-
1
;
}
This diff is collapsed.
Click to expand it.
trap.c
+
1
−
1
View file @
5efca905
...
...
@@ -86,7 +86,7 @@ trap(struct trapframe *tf)
cprintf
(
"pid %d %s: trap %d err %d on cpu %d "
"eip 0x%x addr 0x%x--kill proc
\n
"
,
proc
->
pid
,
proc
->
name
,
tf
->
trapno
,
tf
->
err
,
cpu
->
id
,
tf
->
eip
,
rcr2
());
rcr2
());
proc
->
killed
=
1
;
}
...
...
This diff is collapsed.
Click to expand it.
vm.c
+
7
−
7
View file @
5efca905
...
...
@@ -244,13 +244,13 @@ freevm(pde_t *pgdir)
if
(
da
!=
0
)
{
pte_t
*
pgtab
=
(
pte_t
*
)
da
;
for
(
j
=
0
;
j
<
NPTENTRIES
;
j
++
)
{
if
(
pgtab
[
j
]
!=
0
)
{
uint
pa
=
PTE_ADDR
(
pgtab
[
j
]);
uint
va
=
PGADDR
(
i
,
j
,
0
);
if
(
va
<
USERTOP
)
// user memory
if
(
pgtab
[
j
]
!=
0
)
{
uint
pa
=
PTE_ADDR
(
pgtab
[
j
]);
uint
va
=
PGADDR
(
i
,
j
,
0
);
if
(
va
<
USERTOP
)
// user memory
kfree
((
void
*
)
pa
);
pgtab
[
j
]
=
0
;
}
pgtab
[
j
]
=
0
;
}
}
kfree
((
void
*
)
da
);
pgdir
[
i
]
=
0
;
...
...
@@ -287,7 +287,7 @@ inituvm(pde_t *pgdir, char *addr, char *init, uint sz)
for
(
i
=
0
;
i
<
sz
;
i
+=
PGSIZE
)
{
if
(
!
(
pte
=
walkpgdir
(
pgdir
,
(
void
*
)(
i
+
addr
),
0
)))
panic
(
"inituvm: pte should exist
\n
"
);
panic
(
"inituvm: pte should exist
\n
"
);
off
=
(
i
+
(
uint
)
addr
)
%
PGSIZE
;
pa
=
PTE_ADDR
(
*
pte
);
if
(
sz
-
i
<
PGSIZE
)
n
=
sz
-
i
;
...
...
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