Confused about context switch

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Octocontrabass
Member
Member
Posts: 5501
Joined: Mon Mar 25, 2013 7:01 pm

Re: Confused about context switch

Post 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.
KrotovOSdev
Member
Member
Posts: 40
Joined: Sat Aug 12, 2023 1:48 am
Location: Nizhny Novgorod, Russia

Re: Confused about context switch

Post 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.
KrotovOSdev
Member
Member
Posts: 40
Joined: Sat Aug 12, 2023 1:48 am
Location: Nizhny Novgorod, Russia

Re: Confused about context switch

Post by KrotovOSdev »

Looks like I solved this problem by using interrupt or interrupt-like stack for task switching.
Thanks for your help.
Octocontrabass
Member
Member
Posts: 5501
Joined: Mon Mar 25, 2013 7:01 pm

Re: Confused about context switch

Post by Octocontrabass »

Interrupts are not necessary for task switching, so I really have to wonder why it didn't work for you.
Post Reply