Multitasking Issues
Same kind of thing here. Because I'm trying to achieve some degree of modularity, I set up a Device Manager (from a separate binary) and the kernel itself as the first tasks. Once I have got the device manager up to a reasonable state I will hope to remove the kernel from scheduling or give it minimal runtime...
Thank you guys. What I did was that I initiated kernel's process like this:
The label .KernelStartPointofProcess is where the kernel will have its process running. The little JMP at the end of the above code will actually end the unscheduled process of the kernel so from that point it will run from the specified label.
I coded a function called [__CreateKernelProcess] that adds the kernel to the process queue but with these flags:
The PROCESS_FLAG_NOTSCHEDULED will cause the kernel not to be scheduled by the scheduler and only run where the CPU is in an idle mode. Cutting the story short, WOOOOHOOOO finally my context switching mechanism is working.
I really want to thank you, everyone: mystran, urxae, Aali, Frank, AJ and anyone who I forgot. Thank you.
Code: Select all
INVOKE __DisableIRQPulse , IRQ_PULSE_IRQ0
INVOKE __CreateKernelProcess, OFFSET .KernelStartPointofProcess
INVOKE __EnableIRQPulse, IRQ_PULSE_IRQ0
JMP $
I coded a function called [__CreateKernelProcess] that adds the kernel to the process queue but with these flags:
Code: Select all
PROCESS_FLAG_KERNELPROCESS | PROCESS_FLAG_NOTSCHEDULED | PROCESS_PRIORITY_KERNEL
I really want to thank you, everyone: mystran, urxae, Aali, Frank, AJ and anyone who I forgot. Thank you.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.