Commits

Author Commit Message Labels Comments Date
Cliff Biffle
Fixed YIELD to become a no-op if executed in a handler. This is a bit of a hack, but we were getting hard-faults when doing serial I/O from handler code because of the SVC.
Cliff Biffle
Threads can now become unprivileged by calling DROP-PRIVS, though everything starts privileged.
Cliff Biffle
Start new threads using the Process stack, not Main stack.
Cliff Biffle
Fixed context switch routine so that threads can use either Main or Process stack.
Cliff Biffle
First step toward using privilege levels: the Farcall Reflector now works on both stacks.
Cliff Biffle
Cleaned up tasking-test somewhat by introducing a defining word for LED blinkers.
Cliff Biffle
THREAD takes an additional argument, which becomes the new thread's initial TOS. This allows common thread code to be parameterized. tasking-test now uses this to spin up multiple LED blinkers with a single shared implementation.
Cliff Biffle
Improved documentation of THREAD, corrected a bogus stack comment.
Cliff Biffle
s/task/thread/g - standardizing my terms.
Cliff Biffle
Added PREV-TCP, making the run ring doubly-linked. This will make task deactivation easier.
Cliff Biffle
...the comment was not the only part of the user area that was horribly broken. Double whoops.
Cliff Biffle
Removed a misleading out-of-date comment that I accidentally left in. Whoops.
Cliff Biffle
Added a defining word, TASK, that creates a ready-to-run thread. (Yeah, I'm mixing my terminology.) Added ACTIVATE, which switches a task into the run ring.
Cliff Biffle
Serial I/O no longer yields if the receive/transmit operation does not block.
Cliff Biffle
Added YIELD, which gives up the rest of the time slice, and WAIT, which idles for a specified number of ticks. Changed the serial I/O to YIELD, and the tasking-test to WAIT.
Cliff Biffle
Added a systick counter. Currently it's in a register for simplicity.
Cliff Biffle
Rearranged how context switching works: the systick timer now pends a PendSV interrupt, which performs the context switch. The key here is the relative priority. Systick is highest (other than NMI and friends), while PendSV is lowest. This means we can take a tick and pend a context switch even during an interrupt handler. This fixes context switches in RAM code, which were failing when the tick occurred during the reflector Bus Fault.
Cliff Biffle
Removed the demo tasking words from cold.4th.
Cliff Biffle
Preemptive multitasking of Forth threads works. To test, load tasking-test.txt and run
Cliff Biffle
Erased the last vestiges of direct threading (I think).
Cliff Biffle
Clarified the message for an instruction access hard fault, after I eventually figured out what it really means.
Cliff Biffle
Improved save/restore during context switch. Should be able to run preemptive Forth tasks, though I haven't tested it.
Cliff Biffle
Rearranged commands in tasking-test to improve conciseness.
Cliff Biffle
More plumbing for preempting multitasking. Preemption now works for very simple assembly threads that don't use too many registers (context save/restore is incomplete). See tasking-test.txt and 'blinker' in kernel.s for such a case.
Cliff Biffle
Improved reporting of hard faults and a particular variety of usage fault.
Cliff Biffle
Rearranged the user area and shrunk its initial allocation to fit.
Cliff Biffle
cold.4th disagreed with itself about the size of the initial stack...on two subsequent lines. A silly oversight that was causing user variables to stomp on stack.
Cliff Biffle
Removed the defines for direct threading, since this isn't the direct threading branch.
Cliff Biffle
Fixed an embarrassing typo in the register commentary.
Cliff Biffle
Backed out changeset 4ee4d0ad36d5 - RAM-to-Flash portability is looking like less of a priority right now.
  1. Prev
  2. Next