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
2cf6b32d
Commit
2cf6b32d
authored
14 years ago
by
Robert Morris
Browse files
Options
Downloads
Patches
Plain Diff
move jkstack to main.c
replace jstack with asm()s
parent
eb18645f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
defs.h
+0
-2
0 additions, 2 deletions
defs.h
main.c
+16
-6
16 additions, 6 deletions
main.c
runoff.list
+1
-0
1 addition, 0 deletions
runoff.list
sh.c
+0
-1
0 additions, 1 deletion
sh.c
swtch.S
+0
-8
0 additions, 8 deletions
swtch.S
vm.c
+0
-11
0 additions, 11 deletions
vm.c
with
17 additions
and
28 deletions
defs.h
+
0
−
2
View file @
2cf6b32d
...
...
@@ -110,7 +110,6 @@ void yield(void);
// swtch.S
void
swtch
(
struct
context
**
,
struct
context
*
);
void
jstack
(
uint
);
// spinlock.c
void
acquire
(
struct
spinlock
*
);
...
...
@@ -157,7 +156,6 @@ void pminit(void);
void
ksegment
(
void
);
void
kvmalloc
(
void
);
void
vminit
(
void
);
void
jkstack
();
void
printstack
(
void
);
void
printpgdir
(
pde_t
*
);
pde_t
*
setupkvm
(
void
);
...
...
This diff is collapsed.
Click to expand it.
main.c
+
16
−
6
View file @
2cf6b32d
...
...
@@ -7,7 +7,8 @@
static
void
bootothers
(
void
);
static
void
mpmain
(
void
);
void
jkstack
(
void
)
__attribute__
((
noreturn
));
void
jkstack
(
void
)
__attribute__
((
noreturn
));
void
mainc
(
void
);
// Bootstrap processor starts running C code here.
int
...
...
@@ -21,13 +22,24 @@ main(void)
consoleinit
();
// I/O devices & their interrupts
uartinit
();
// serial port
pminit
();
// physical memory for kernel
jkstack
();
// Jump to mainc on a proper-allocated kernel stack
jkstack
();
// Jump to mainc on a properly-allocated stack
}
void
jkstack
(
void
)
{
char
*
kstack
=
kalloc
(
PGSIZE
);
if
(
!
kstack
)
panic
(
"jkstack
\n
"
);
char
*
top
=
kstack
+
PGSIZE
;
asm
volatile
(
"movl %0,%%esp"
:
:
"r"
(
top
));
asm
volatile
(
"call mainc"
);
panic
(
"jkstack"
);
}
void
mainc
(
void
)
{
cprintf
(
"cpus %p cpu %p
\n
"
,
cpus
,
cpu
);
cprintf
(
"
\n
cpu%d: starting xv6
\n\n
"
,
cpu
->
id
);
kvmalloc
();
// allocate the kernel page table
pinit
();
// process table
...
...
@@ -52,14 +64,12 @@ mpmain(void)
{
if
(
cpunum
()
!=
mpbcpu
())
{
ksegment
();
cprintf
(
"other cpu
\n
"
);
lapicinit
(
cpunum
());
}
vminit
();
// Run with paging on each processor
cprintf
(
"cpu%d:
mpma
in
\n
"
,
cpu
->
id
);
cprintf
(
"cpu%d:
start
in
g
\n
"
,
cpu
->
id
);
idtinit
();
xchg
(
&
cpu
->
booted
,
1
);
cprintf
(
"cpu%d: scheduling
\n
"
,
cpu
->
id
);
scheduler
();
}
...
...
This diff is collapsed.
Click to expand it.
runoff.list
+
1
−
0
View file @
2cf6b32d
...
...
@@ -22,6 +22,7 @@ proc.h
proc.c
swtch.S
kalloc.c
vm.c
# system calls
traps.h
...
...
This diff is collapsed.
Click to expand it.
sh.c
+
0
−
1
View file @
2cf6b32d
...
...
@@ -420,7 +420,6 @@ parseexec(char **ps, char *es)
int
tok
,
argc
;
struct
execcmd
*
cmd
;
struct
cmd
*
ret
;
int
*
x
=
(
int
*
)
peek
;
if
(
peek
(
ps
,
es
,
"("
))
return
parseblock
(
ps
,
es
);
...
...
This diff is collapsed.
Click to expand it.
swtch.S
+
0
−
8
View file @
2cf6b32d
...
...
@@ -26,11 +26,3 @@ swtch:
popl
%
ebx
popl
%
ebp
ret
#
Jump
on
a
new
stack
,
fake
C
calling
conventions
.
globl
jstack
jstack
:
movl
4
(%
esp
),
%
esp
subl
$
16
,
%
esp
#
space
for
arguments
movl
$
0
,
%
ebp
#
terminate
functions
that
follow
ebp
's
call
mainc
#
continue
at
mainc
This diff is collapsed.
Click to expand it.
vm.c
+
0
−
11
View file @
2cf6b32d
...
...
@@ -324,17 +324,6 @@ pminit(void)
kinit
((
char
*
)
kernend
,
freesz
);
}
// Jump to mainc on a properly-allocated kernel stack
void
jkstack
(
void
)
{
char
*
kstack
=
kalloc
(
PGSIZE
);
if
(
!
kstack
)
panic
(
"jkstack
\n
"
);
char
*
top
=
kstack
+
PGSIZE
;
jstack
((
uint
)
top
);
}
// Allocate one page table for the machine for the kernel address
// space for scheduler processes.
void
...
...
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