Page 6 of 6

Re: Confused about context switch

Posted: Fri Nov 10, 2023 1:29 pm
by Octocontrabass
KrotovOSdev wrote:I put stack to 0x4500 during the init process, when paging is not enabled. Should I put it to another address?
It's fine where it is now, as long as you've set up enough memory to hold it. You can always change it later.
KrotovOSdev wrote:If kmain() function returns, my code just execute "cli; hlt".
You shouldn't receive any interrupts after that.

Re: Confused about context switch

Posted: Wed Nov 15, 2023 1:02 pm
by KrotovOSdev
Octocontrabass wrote: It's fine where it is now, as long as you've set up enough memory to hold it. You can always change it later

You shouldn't receive any interrupts after that.
Ok, thanks. I do not receive interrupts after the "cli" instruction, of course.

Re: Confused about context switch

Posted: Thu Nov 23, 2023 1:24 pm
by KrotovOSdev
Looks like I solved this problem by using interrupt or interrupt-like stack for task switching.
Thanks for your help.

Re: Confused about context switch

Posted: Thu Nov 23, 2023 1:40 pm
by Octocontrabass
Interrupts are not necessary for task switching, so I really have to wonder why it didn't work for you.