diff options
| author | Jake Mannens <jakem_5@hotmail.com> | 2020-03-18 00:21:36 +1100 |
|---|---|---|
| committer | Jake Mannens <jakem_5@hotmail.com> | 2020-03-18 00:21:36 +1100 |
| commit | eda36531e8daedd045fb02c9c590cdf4dddd957f (patch) | |
| tree | 62d4dc49bc7505596d2e5f2213f8f7f0e3aff901 /include | |
| parent | b808d33c6bf30691b8cdb6cc0fd65f49e7db29f8 (diff) | |
Implemented a proper read requests queue in the floppy driver.
Previously, all tasks waiting on the floppy drive, would be woken
simultaneously and would compete for access to the drive, potentially
causing a dangerous race condition. Now, tasks enter a read queue, where
each task wakes the next after it is finished with the drive. This is
the basic groundwork for request queueing. Seek queues will be
implemented next along with a head scheduling algorithm.
Added a timeout for read_data(). Reading status from the FDC will return
an error if the FDC does not become available in the allotted time and
thus, will no longer potentially hang the system.
Diffstat (limited to 'include')
| -rw-r--r-- | include/kernel/sched.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/kernel/sched.h b/include/kernel/sched.h index 5429e8b..439da53 100644 --- a/include/kernel/sched.h +++ b/include/kernel/sched.h @@ -5,6 +5,9 @@ #include <stdint.h> #include <unistd.h> +/* TODO: change const 10 to tick rate */ +#define uptime() ((long) (ticks * 10)) + #define TSTATE_RUNNING 0 #define TSTATE_INTERRUPTIBLE 1 #define TSTATE_UNINTERRUPTIBLE 2 |
