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
72d627ba
Commit
72d627ba
authored
7 years ago
by
Divyam Khandelwal
Browse files
Options
Downloads
Patches
Plain Diff
Triple Faulting
parent
cfee6a89
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
student-distrib/paging.c
+0
-2
0 additions, 2 deletions
student-distrib/paging.c
student-distrib/pit.c
+1
-0
1 addition, 0 deletions
student-distrib/pit.c
student-distrib/rtc.c
+1
-9
1 addition, 9 deletions
student-distrib/rtc.c
student-distrib/scheduler.c
+5
-0
5 additions, 0 deletions
student-distrib/scheduler.c
with
7 additions
and
11 deletions
student-distrib/paging.c
+
0
−
2
View file @
72d627ba
...
@@ -36,8 +36,6 @@ void paging_initi(void){
...
@@ -36,8 +36,6 @@ void paging_initi(void){
/* Kernel 4 MB page */
/* Kernel 4 MB page */
page_directory
[
1
]
=
KERNEL_ADDR
|
SIZE
|
READ_WRITE
|
PRESENT
;
page_directory
[
1
]
=
KERNEL_ADDR
|
SIZE
|
READ_WRITE
|
PRESENT
;
//clear();
/* call assembly linkage to set registers */
/* call assembly linkage to set registers */
loadPageDirectory
(
page_directory
);
loadPageDirectory
(
page_directory
);
enablePaging
();
enablePaging
();
...
...
This diff is collapsed.
Click to expand it.
student-distrib/pit.c
+
1
−
0
View file @
72d627ba
...
@@ -19,6 +19,7 @@ void i8253_init(void){
...
@@ -19,6 +19,7 @@ void i8253_init(void){
void
pit_handler
(){
void
pit_handler
(){
//printf("[PIT] Interrupt Test");
//printf("[PIT] Interrupt Test");
scheduler
();
send_eoi
(
0
);
send_eoi
(
0
);
//todo
//todo
...
...
This diff is collapsed.
Click to expand it.
student-distrib/rtc.c
+
1
−
9
View file @
72d627ba
...
@@ -30,16 +30,8 @@ void rtc_init(void)
...
@@ -30,16 +30,8 @@ void rtc_init(void)
/* Enable interrupts */
/* Enable interrupts */
sti
();
sti
();
/* Testing */
//freq = 2;
//rtc_write(0, &freq, 4);
/* Enable RTC interrupt line */
enable_irq
(
RTC_IRQ
);
enable_irq
(
RTC_IRQ
);
/* Testing */
//freq = 8192;
//rtc_write(0, &freq, 4);
}
}
/*
/*
...
@@ -75,7 +67,7 @@ int32_t rtc_read(int32_t fd, void* buf, int32_t nbytes)
...
@@ -75,7 +67,7 @@ int32_t rtc_read(int32_t fd, void* buf, int32_t nbytes)
/* Wait until interrupt handler clears flag */
/* Wait until interrupt handler clears flag */
while
(
interrupt_flag
);
while
(
interrupt_flag
);
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
student-distrib/scheduler.c
+
5
−
0
View file @
72d627ba
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
//in a certain mount of time, swap out of the current process and run the next one
//in a certain mount of time, swap out of the current process and run the next one
void
scheduler
(
void
){
void
scheduler
(
void
){
// printf("[SCHEDULE]");
if
(
control
.
cur_pid
==
-
1
)
return
;
if
(
control
.
cur_pid
==
-
1
)
return
;
int32_t
flag
=
0
;
int32_t
flag
=
0
;
...
@@ -33,6 +35,9 @@ void scheduler(void){
...
@@ -33,6 +35,9 @@ void scheduler(void){
// update current pid, tss and remap paging
// update current pid, tss and remap paging
remap_proc
(
i
);
remap_proc
(
i
);
printf
(
"[SCHEDULE]"
);
control
.
cur_pid
=
i
;
control
.
cur_pid
=
i
;
tss
.
ss0
=
KERNEL_DS
;
tss
.
ss0
=
KERNEL_DS
;
tss
.
esp0
=
_8_MB
-
_8_KB
*
control
.
cur_pid
;
tss
.
esp0
=
_8_MB
-
_8_KB
*
control
.
cur_pid
;
...
...
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