OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Apr 18, 2021 9:24 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Strange behavior of functions be called after task switching
PostPosted: Wed Sep 23, 2020 2:40 am 
Offline
Member
Member
User avatar

Joined: Sun Jul 21, 2019 7:34 am
Posts: 253
Hi.
I rewrite the code of my task switcher for the hundredth time and now it seems to work correctly.
However, I get a strange error related to calling a function rather than switching tasks.

So, in order for threads running at the kernel level to safely use "return", the first time I call them with the help of "call".
Immediately after calling the thread function, I make a call to the function that completes execution as soon as the thread terminates.
However, here I have problems. This function prints nonsense(data about the first thread is correct, data about the second thread is incorrect, and there should not be a third thread)
For the test I tried calling this function 3 times here and everything prints fine.

It turns out that if I call a function that prints data from another function, I run into problems.
Why is she acting like this?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group