diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-21 16:45:28 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-21 16:45:33 -0400 |
commit | ceb9471fed96f907e37a6ba031825c31167a8ff4 (patch) | |
tree | d98392e420b4541a6ba926ff4d8b3ebe85734580 /user/idle.c | |
parent | update linker scripts (diff) | |
download | comus-ceb9471fed96f907e37a6ba031825c31167a8ff4.tar.gz comus-ceb9471fed96f907e37a6ba031825c31167a8ff4.tar.bz2 comus-ceb9471fed96f907e37a6ba031825c31167a8ff4.zip |
update userland to compile
Diffstat (limited to '')
-rw-r--r-- | user/idle.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/user/idle.c b/user/idle.c deleted file mode 100644 index c088a3c..0000000 --- a/user/idle.c +++ /dev/null @@ -1,52 +0,0 @@ -#include <common.h> - -/** -** Idle process: write, getpid, gettime, exit -** -** Reports itself, then loops forever delaying and printing a character. -** MUST NOT SLEEP, as it must always be available in the ready queue -** when there is no other process to dispatch. -** -** Invoked as: idle -*/ - -USERMAIN(main) -{ - // this is the character we will repeatedly print - char ch = '.'; - - // ignore the command-line arguments - (void)argc; - (void)argv; - - // get some current information - uint_t pid = getpid(); - uint32_t now = gettime(); - enum priority_e prio = getprio(); - - char buf[128]; - sprint(buf, "Idle [%d], started @ %u\n", pid, prio, now); - cwrites(buf); - - // report our presence on the console - cwrites("Idle started\n"); - - write(CHAN_SIO, &ch, 1); - - // idle() should never block - it must always be available - // for dispatching when we need to pick a new current process - - for (;;) { - DELAY(LONG); - write(CHAN_SIO, &ch, 1); - } - - // we should never reach this point! - now = gettime(); - sprint(buf, "Idle [%d] EXITING @ %u!?!?!\n", pid, now); - cwrites(buf); - - exit(1); - - return (42); -} |