aboutsummaryrefslogtreecommitdiff
path: root/src/sys/core.c
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-21 18:52:25 -0700
committerChristian Cunningham <cc@localhost>2022-01-21 18:52:25 -0700
commit0d551d712c098d6ebb75512340d7503da98361b4 (patch)
treead01fa489a37f70e3dd4e94bd22dc67381e05710 /src/sys/core.c
parentc7c1702dc66f5be0f8f07703e2c8e9f5bd8db80d (diff)
Got some scheduling
Diffstat (limited to 'src/sys/core.c')
-rw-r--r--src/sys/core.c48
1 files changed, 9 insertions, 39 deletions
diff --git a/src/sys/core.c b/src/sys/core.c
index fc3d9e1..aa10bdf 100644
--- a/src/sys/core.c
+++ b/src/sys/core.c
@@ -16,6 +16,7 @@
#include <util/time.h>
void testlocal(void);
+void longlocal(void);
// Initialize IRQs
void sysinit(void)
@@ -68,48 +69,17 @@ void sysinit(void)
add_thread(testlocal, 0, 1);
add_thread(testlocal, 0, 3);
add_thread(testlocal, 0, 5);
+ add_thread(longlocal, 0, 5);
uart_scheduler();
}
-void testlocal1(void)
-{
- //unsigned long a = 5;
- //struct Thread* t = scheduler.rthread_ll->data;
- //uart_string("vRan Thread ");
- //uart_10(t->data.pid);
- //uart_string(" Pri. ");
- //uart_10(t->data.priority);
- //uart_string(" ...\n");
- //add_thread(testlocal, 0);
- //schedule();
- //a += t->data.pid;
- //uart_10(a);
- //uart_string(" Done!\n");
-}
-
void testlocal(void)
{
- //struct Thread* t = scheduler.rthread_ll->data;
- //uart_string("Ran Thread ");
- //uart_10(t->data.pid);
- //uart_string(" Pri. ");
- //uart_10(t->data.priority);
- //uart_string(" ...\n");
- ////delay(0x80000000);
- //if (t->data.pid == 5) {
- // add_thread(testlocal1, 1);
- // schedule();
- //}
- //if (t->data.pid == 3) {
- // // Example
- // /*
- // while (uart_tx_full) {
- // t->data.status = THREAD_WAITING;
- // schedule();
- // } // Will wait until uart_tx is not full
- // */
- //}
- //uart_string("Done! ");
- //uart_10(t->data.pid);
- //uart_char('\n');
+ uart_string("Ran thread!\n");
+ if (scheduler.rthread->pid == 4) {
+ add_thread(testlocal, 0, 0);
+ //uart_scheduler();
+ }
+ uart_hexn((unsigned long)getsp());
+ uart_string("Exiting thread!\n");
}