Hi, I'm writing a little "kernel" for a small microprocessor. Right now it just implements tasks, and does scheduling. That is , I have a timer fire every ms in which the interrupt handler sets up the kernel stack and pc, and the "kernel" merly checks if the current task has reached its timeslice. Now I want to do some abstractios over events.For now interrupts, but have no idea what that takes. One of the interrupts signals the press of a button, I want tasks to wait on such an event. Whats the basis of doing that ? I'd like the interrupt handlers as small as possible. One solution I can think of is to let the interrupt handler append events to a queue, and on each kernel tick check the event queue and if there are any task waiting.. but that seems odd. And rather high latency since little happens until my 1 ms tick. Basically, how to make tasks wait for events, and how to let interrupt handlers signal that an event happened.
- posted
20 years ago