Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
OS_XV6
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9631059
OS_XV6
Commits
e5b82e38
Commit
e5b82e38
authored
Dec 18, 2019
by
Amir Hosein Kashani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disapointing
parent
3daba6c2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
4 deletions
+44
-4
Makefile
Makefile
+1
-0
OriginalSchedTest.c
OriginalSchedTest.c
+29
-0
getChildrenTest.c
getChildrenTest.c
+2
-0
trap.c
trap.c
+4
-3
user.h
user.h
+8
-1
No files found.
Makefile
View file @
e5b82e38
...
...
@@ -185,6 +185,7 @@ UPROGS=\
_zombie
\
_getChildrenTest
\
_getCountTest
\
_OriginalSchedTest
\
fs.img
:
mkfs README $(UPROGS)
./mkfs fs.img README
$(UPROGS)
...
...
OriginalSchedTest.c
0 → 100644
View file @
e5b82e38
#include "types.h"
#include "stat.h"
#include "user.h"
//#include "proc.h"
int
main
()
{
//struct timeVariables *t = malloc(sizeof(struct timeVariables));
for
(
int
i
=
0
;
i
<
10
;
i
++
){
if
(
fork
()
!=
0
)
wait
();
else
{
int
f
=
getpid
();
for
(
int
j
=
0
;
j
<
1000
;
j
++
){
printf
(
1
,
"[%d]:[%d]
\n
"
,
f
,
i
);
}
break
;
}
}
exit
();
}
\ No newline at end of file
getChildrenTest.c
View file @
e5b82e38
...
...
@@ -5,9 +5,11 @@ int
main
(
int
argc
,
char
**
argv
)
{
int
a
=
fork
();
fork
();
fork
();
fork
();
wait
();
wait
();
wait
();
...
...
trap.c
View file @
e5b82e38
...
...
@@ -37,7 +37,7 @@ idtinit(void)
void
trap
(
struct
trapframe
*
tf
)
{
clockCounter
();
if
(
tf
->
trapno
==
T_SYSCALL
){
if
(
myproc
()
->
killed
)
exit
();
...
...
@@ -52,6 +52,7 @@ trap(struct trapframe *tf)
if
(
cpuid
()
==
0
){
acquire
(
&
tickslock
);
ticks
++
;
clockCounter
();
wakeup
(
&
ticks
);
release
(
&
tickslock
);
}
...
...
@@ -105,8 +106,8 @@ trap(struct trapframe *tf)
// If interrupts were on while locks held, would need to check nlock.
currentQuantom
++
;
if
(
myproc
()
&&
myproc
()
->
state
==
RUNNING
&&
tf
->
trapno
==
T_IRQ0
+
IRQ_TIMER
&&
(
currentQuantom
%
QUANTUM
==
0
||
cpuMode
!=
1
)
)
tf
->
trapno
==
T_IRQ0
+
IRQ_TIMER
/*
&&
(currentQuantom%QUANTUM==0 || cpuMode!= 1)
*/
)
yield
();
// Check if the process has been killed since we yielded
...
...
user.h
View file @
e5b82e38
struct
stat
;
struct
rtcdate
;
struct
timeVariables
;
struct
timeVariables
{
//this struct for 3.4
int
creationTime
;
int
terminationTime
;
int
sleepingTime
;
int
readyTime
;
int
runningTime
;
};
// system calls
int
fork
(
void
);
int
exit
(
void
)
__attribute__
((
noreturn
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment