Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
83769971
authored
Dec 14, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
idk what im doing
parent
77d4fa74
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
src/PCB.c
src/hello.elf
src/kern.c
src/pit.c
src/PCB.c
View file @
83769971
...
@@ -31,7 +31,9 @@ void schedule()
...
@@ -31,7 +31,9 @@ void schedule()
{
{
curproc
=
(
curproc
<
NUM_PROCS
-
1
)
?
curproc
+
1
:
0
;
curproc
=
(
curproc
<
NUM_PROCS
-
1
)
?
curproc
+
1
:
0
;
}
}
serial_writestring
(
"about to switch
\n
"
);
context_switch
(
&
procs
[
old
]
->
ctxt
,
procs
[
curproc
]
->
ctxt
);
context_switch
(
&
procs
[
old
]
->
ctxt
,
procs
[
curproc
]
->
ctxt
);
serial_writestring
(
"switched
\n
"
);
//procs[old]->state=RUNNABLE;
//procs[old]->state=RUNNABLE;
procs
[
curproc
]
->
state
=
RUNNING
;
procs
[
curproc
]
->
state
=
RUNNING
;
//process* t = curproc;
//process* t = curproc;
...
@@ -44,6 +46,7 @@ int yield()
...
@@ -44,6 +46,7 @@ int yield()
{
{
//lock mutex
//lock mutex
procs
[
curproc
]
->
state
=
RUNNABLE
;
procs
[
curproc
]
->
state
=
RUNNABLE
;
serial_writestring
(
"about to schedule
\n
"
);
schedule
();
schedule
();
//unlock mutex
//unlock mutex
return
1
;
return
1
;
...
...
src/hello.elf
View file @
83769971
No preview for this file type
src/kern.c
View file @
83769971
...
@@ -67,11 +67,11 @@ void kernel_main(multiboot_info* mbt, uint32_t magic)
...
@@ -67,11 +67,11 @@ void kernel_main(multiboot_info* mbt, uint32_t magic)
enablePaging
();
enablePaging
();
serial_writestring
(
"Finished Initilizing memory
\n
"
);
serial_writestring
(
"Finished Initilizing memory
\n
"
);
int
o
=
0
;
//
int o=0;
int
j
=
5
/
o
;
//
int j=5/o;
serial_hexword
(
j
);
//
serial_hexword(j);
//test_mem();
//test_mem();
serial_writechar
(
'\n'
);
//
serial_writechar('\n');
// PCI
// PCI
checkAllBuses
();
checkAllBuses
();
...
@@ -86,6 +86,7 @@ void kernel_main(multiboot_info* mbt, uint32_t magic)
...
@@ -86,6 +86,7 @@ void kernel_main(multiboot_info* mbt, uint32_t magic)
pit_init
();
pit_init
();
pit_start_counter
(
100
,
PIT_OCW_CONT_0
,
PIT_OCW_MODE_SQWVGEN
);
pit_start_counter
(
100
,
PIT_OCW_CONT_0
,
PIT_OCW_MODE_SQWVGEN
);
serial_writestring
(
"enabling interrupts
\n
"
);
enable_int
();
enable_int
();
...
...
src/pit.c
View file @
83769971
...
@@ -18,6 +18,7 @@ void pit_irq()
...
@@ -18,6 +18,7 @@ void pit_irq()
pic_command
(
0
,
PIC_OCW2_EOI
);
pic_command
(
0
,
PIC_OCW2_EOI
);
//serial_writestring("PIT tickn\n");
//serial_writestring("PIT tickn\n");
//asm volatile("nop;nop;nop;popa; iret;");
//asm volatile("nop;nop;nop;popa; iret;");
serial_writestring
(
"ticked, yielding
\n
"
);
yield
();
yield
();
}
}
...
...
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