Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
5e083578
Commit
5e083578
authored
13 years ago
by
Robert Morris
Browse files
Options
Downloads
Patches
Plain Diff
enterpgdir -> entrypgdir
parent
1ddfbbb1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
entry.S
+2
-2
2 additions, 2 deletions
entry.S
main.c
+5
-5
5 additions, 5 deletions
main.c
usertests.c
+17
-4
17 additions, 4 deletions
usertests.c
with
24 additions
and
11 deletions
entry.S
+
2
−
2
View file @
5e083578
...
...
@@ -44,11 +44,11 @@ entry:
orl
$
(
CR4_PSE
),
%
eax
movl
%
eax
,
%
cr4
#
Set
page
directory
movl
$
(
V2P_WO
(
ent
e
rpgdir
)),
%
eax
movl
$
(
V2P_WO
(
entr
y
pgdir
)),
%
eax
movl
%
eax
,
%
cr3
#
Turn
on
paging
.
movl
%
cr0
,
%
eax
orl
$
(
CR0_
PE|CR0_
PG|CR0_WP
),
%
eax
orl
$
(
CR0_PG
|
CR0_WP
),
%
eax
movl
%
eax
,
%
cr0
#
now
switch
to
using
addresses
above
KERNBASE
...
...
This diff is collapsed.
Click to expand it.
main.c
+
5
−
5
View file @
5e083578
...
...
@@ -60,7 +60,7 @@ mpmain(void)
scheduler
();
// start running processes
}
pde_t
ent
e
rpgdir
[];
// For entry.S
pde_t
entr
y
pgdir
[];
// For entry.S
// Start the non-boot (AP) processors.
static
void
...
...
@@ -83,15 +83,15 @@ startothers(void)
// Tell entryother.S what stack to use, the address of mpenter and pgdir;
// We cannot use kpgdir yet, because the AP processor is running in low
// memory, so we use ent
e
rpgdir for the APs too. kalloc can return addresses
// memory, so we use entr
y
pgdir for the APs too. kalloc can return addresses
// above 4Mbyte (the machine may have much more physical memory than 4Mbyte), which
// aren't mapped by ent
e
rpgdir, so we must allocate a stack using enter_alloc();
// aren't mapped by entr
y
pgdir, so we must allocate a stack using enter_alloc();
// This introduces the constraint that xv6 cannot use kalloc until after these
// last enter_alloc invocations.
stack
=
enter_alloc
();
*
(
void
**
)(
code
-
4
)
=
stack
+
KSTACKSIZE
;
*
(
void
**
)(
code
-
8
)
=
mpenter
;
*
(
int
**
)(
code
-
12
)
=
(
void
*
)
v2p
(
ent
e
rpgdir
);
*
(
int
**
)(
code
-
12
)
=
(
void
*
)
v2p
(
entr
y
pgdir
);
lapicstartap
(
c
->
id
,
v2p
(
code
));
...
...
@@ -106,7 +106,7 @@ startothers(void)
// hence the "__aligned__" attribute.
// Use PTE_PS in page directory entry to enable 4Mbyte pages.
__attribute__
((
__aligned__
(
PGSIZE
)))
pde_t
ent
e
rpgdir
[
NPDENTRIES
]
=
{
pde_t
entr
y
pgdir
[
NPDENTRIES
]
=
{
// Map VA's [0, 4MB) to PA's [0, 4MB)
[
0
]
=
(
0
)
+
PTE_P
+
PTE_W
+
PTE_PS
,
// Map VA's [KERNBASE, KERNBASE+4MB) to PA's [0, 4MB)
...
...
This diff is collapsed.
Click to expand it.
usertests.c
+
17
−
4
View file @
5e083578
#include
"param.h"
#include
"types.h"
#include
"stat.h"
#include
"user.h"
...
...
@@ -240,8 +241,10 @@ pipe1(void)
if
(
cc
>
sizeof
(
buf
))
cc
=
sizeof
(
buf
);
}
if
(
total
!=
5
*
1033
)
if
(
total
!=
5
*
1033
)
{
printf
(
1
,
"pipe1 oops 3 total %d
\n
"
,
total
);
exit
();
}
close
(
fds
[
0
]);
wait
();
}
else
{
...
...
@@ -401,10 +404,12 @@ sharedfd(void)
}
close
(
fd
);
unlink
(
"sharedfd"
);
if
(
nc
==
10000
&&
np
==
10000
)
if
(
nc
==
10000
&&
np
==
10000
)
{
printf
(
1
,
"sharedfd ok
\n
"
);
else
}
else
{
printf
(
1
,
"sharedfd oops %d %d
\n
"
,
nc
,
np
);
exit
();
}
}
// two processes write two different files at the same
...
...
@@ -423,7 +428,7 @@ twofiles(void)
pid
=
fork
();
if
(
pid
<
0
){
printf
(
1
,
"fork failed
\n
"
);
return
;
exit
()
;
}
fname
=
pid
?
"f1"
:
"f2"
;
...
...
@@ -1582,6 +1587,14 @@ fsfull()
printf
(
1
,
"fsfull test finished
\n
"
);
}
unsigned
long
randstate
=
1
;
unsigned
int
rand
()
{
randstate
=
randstate
*
1664525
+
1013904223
;
return
randstate
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
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