OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:32 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Hardware or software multitasking?
PostPosted: Sun Aug 06, 2017 9:58 pm 
Offline

Joined: Sun Apr 30, 2017 10:28 pm
Posts: 4
Location: WA, USA
Should I use hardware multitasking via the TSS, or software multitasking with minimal TSS?

Which option is faster? Which is easier to program? I already know that hardware multitasking is not portable.

_________________
My OS: WatOS (GitHub)


Top
 Profile  
 
 Post subject: Re: Hardware or software multitasking?
PostPosted: Sun Aug 06, 2017 10:28 pm 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
Software. It is faster. x86-64 long mode dropped support for it as well.


Top
 Profile  
 
 Post subject: Re: Hardware or software multitasking?
PostPosted: Mon Aug 07, 2017 12:05 am 
Offline
Member
Member

Joined: Thu Aug 13, 2015 4:57 pm
Posts: 384
Software is probably going to be a better choice.

I'd say they're both pretty much as easy, so no significant difference there.

Portability is also a non-issue, non of the hardware related stuff is portable anyway.

As for speed, I'm not sure. The general opinion is that software is faster, and it probably is for many kernel designs. For instance many syscalls don't actually switch processes and don't necessarily need to save much of the context. Assuming you do all the things that a hardware task switch does, then I doubt doing it manually in software is going to be faster. But if you don't do all the things then software can be faster.

And finally, as already mentioned, long mode doesn't support it. So if you want to do long mode there's no option.

Personally I wouldn't bother with hardware tasks witching mainly due to long mode support missing and prot mode is pretty much obsolete.


Top
 Profile  
 
 Post subject: Re: Hardware or software multitasking?
PostPosted: Mon Aug 07, 2017 1:42 am 
Offline

Joined: Sun Apr 30, 2017 10:28 pm
Posts: 4
Location: WA, USA
Thanks

_________________
My OS: WatOS (GitHub)


Top
 Profile  
 
 Post subject: Re: Hardware or software multitasking?
PostPosted: Mon Aug 07, 2017 2:04 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
It should also be noted that hardware task switching cannot be used to change MSRs or segment bases. It also does not support (actually not so) newer CPU features like the FPU/SSE state. So the question is not hardware vs. software switching but software vs. hybrid switching and software wins by a large margin in this comparison (for reasons that have already been stated).

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot], Google [Bot], SemrushBot [Bot] and 85 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