Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
abinade2
kernel
Commits
4531bc57
Commit
4531bc57
authored
7 years ago
by
Divyam Khandelwal
Browse files
Options
Downloads
Patches
Plain Diff
fd_check updated
parent
30f193b5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
student-distrib/pit.c
+1
-1
1 addition, 1 deletion
student-distrib/pit.c
student-distrib/proc.c
+11
-9
11 additions, 9 deletions
student-distrib/proc.c
with
12 additions
and
10 deletions
student-distrib/pit.c
+
1
−
1
View file @
4531bc57
...
...
@@ -19,7 +19,7 @@ void i8253_init(void){
void
pit_handler
(){
//printf("[PIT] Interrupt Test");
scheduler
();
//
scheduler();
send_eoi
(
0
);
//todo
...
...
This diff is collapsed.
Click to expand it.
student-distrib/proc.c
+
11
−
9
View file @
4531bc57
...
...
@@ -24,17 +24,19 @@ void control_initilization(void)
control
.
running_terminal
=
0
;
}
//checking is fd is valid
/* Checks if FD is valid
* Returns -1 for invalid FD
* Returns 0 for valid FD */
int32_t
fd_check
(
int32_t
fd
)
{
if
(
fd
>=
MIN_FILE_NUM
&&
fd
<
MAX_FILE_NUM
)
{
return
-
1
;
}
/
/
file
not
present
if
(
control
.
terminal
[
control
.
cur_terminal
].
pcb
->
fd
[
fd
].
flags
=
=
0
)
return
-
1
;
else
return
0
;
/* First check for valid index */
if
(
fd
>=
MIN_FILE_NUM
&&
fd
<
MAX_FILE_NUM
)
{
/
* Now check if
file
is
present
*/
if
(
control
.
terminal
[
control
.
cur_terminal
].
pcb
->
fd
[
fd
].
flags
!
=
0
)
return
0
;
}
return
-
1
;
}
//clearing fd
...
...
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