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
a28f288c
Commit
a28f288c
authored
Dec 16, 2019
by
Amir Hosein Kashani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.1 finished
parent
7ec127fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
param.h
param.h
+1
-1
trap.c
trap.c
+4
-2
No files found.
param.h
View file @
a28f288c
...
...
@@ -11,4 +11,4 @@
#define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log
#define NBUF (MAXOPBLOCKS*3) // size of disk block cache
#define FSSIZE 1000 // size of file system in blocks
#define QUANTUM 10 //number of ticks that cpu must wait on current procces
trap.c
View file @
a28f288c
...
...
@@ -13,7 +13,7 @@ struct gatedesc idt[256];
extern
uint
vectors
[];
// in vectors.S: array of 256 entry pointers
struct
spinlock
tickslock
;
uint
ticks
;
int
currentQuantom
;
//show us how many quantom passed in this procces
void
tvinit
(
void
)
{
...
...
@@ -102,8 +102,10 @@ trap(struct trapframe *tf)
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
currentQuantom
++
;
if
(
myproc
()
&&
myproc
()
->
state
==
RUNNING
&&
tf
->
trapno
==
T_IRQ0
+
IRQ_TIMER
)
tf
->
trapno
==
T_IRQ0
+
IRQ_TIMER
&&
currentQuantom
%
QUANTUM
==
0
)
yield
();
// Check if the process has been killed since we yielded
...
...
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