I'm trying to develop an OS which uses Jobs, Processes and Threads (3 layers), each jobs can ask for an amount of time, which are then given to each process within the job (The job time is actually asked time * processes), each thread gets the time according to: process-time : threads.
The problem is that I haven't got a clue on how I can track the used time of a job/process/thread. Any idea's how I can manage some kind of "Super-Job" or "Job-Manager", which manages the other jobs?
I have knowledge of C and C++ (pretty good, I'm software-engineer) and some knowledge of Intel ASM (Mainly NASM)
thans in advance
Time Task Switching
Re:Time Task Switching
Simply you can put your "Super-job" into the timer interrupt service routine (IRQ0). You can keep track of the time used by every task by a global variable associated to every task.
void IRQ0_interrupt_handler()
{
global_ticks++;
NwTask=pick_next_task_to_run();
NewTask->used_ticks++;
jmp_to(NewTask)
}
By default the timer interrupt is generated 18.2 times per second, but if you want you can reprogram the frequency of the system timer (PIT INTEL 8253) according to your requirements...
void IRQ0_interrupt_handler()
{
global_ticks++;
NwTask=pick_next_task_to_run();
NewTask->used_ticks++;
jmp_to(NewTask)
}
By default the timer interrupt is generated 18.2 times per second, but if you want you can reprogram the frequency of the system timer (PIT INTEL 8253) according to your requirements...
Re:Time Task Switching
That I didn't think about that one! Well anyway, is there also some well-written information about TSS on the internet?