The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: woonsan on September 19, 2008, 10:00:00 PM

Title: Multitasking in x86-64 systems
Post by: woonsan on September 19, 2008, 10:00:00 PM
I want to multitask in the x86-64 systems. But, I have no idea about this.
If in the x86-32 systems, I can use 32-bit TSS to provide hardware task switching. However, there is no method to switch the task in x86-64 systems.
Of course, I can use software task switching method but it might be too slow.

Are there any other methods to switch tasks fastly in x86-64 systems?
Title: Re: Multitasking in x86-64 systems
Post by: hutch-- on September 20, 2008, 12:06:44 AM
Stephanos,

The details will vary from OS to OS but the hardware fundamentals are issues of threading and thread priority. These are directly supported hardware capacities but you will need to know how the OS you use does these things. Task switching without threading is an architecture from the 286 days and it was superceded by multithreading from the 386 upwards.
Title: Re: Multitasking in x86-64 systems
Post by: woonsan on September 20, 2008, 04:09:16 AM
Quote from: hutch-- on September 20, 2008, 12:06:44 AM
Stephanos,

The details will vary from OS to OS but the hardware fundamentals are issues of threading and thread priority. These are directly supported hardware capacities but you will need to know how the OS you use does these things. Task switching without threading is an architecture from the 286 days and it was superceded by multithreading from the 386 upwards.

Thank you for replying my question. But, I am not sure that I understood your reply exactly.
What I want to know is the fastest way to switch tasks in x86-64 systems. In the Intel 64 IA-32 Architectures Software Developer's Manual, it says that hardware task switching is no more supported in x86-64 architecture. Of course, there is a 64-bit TSS but, jumping to the 64-bit TSS Descriptor is invalid in x86-64.
Currently, I made the task switching in x86-64 with software task switching method.
I just want to know any other faster ways that can be used in x86-64 systems (Like some tricky ways,).
Title: Re: Multitasking in x86-64 systems
Post by: japheth on September 20, 2008, 08:56:51 AM

Hi,

task switching by task gates on the 80386 ("hardware task switching") wasn't used that much because usually it was faster to do the switch manually. So I guess that they simply removed this feature for 64bit.

PS: please forgive the admin! He usually replies without bothering to  read the question.  :toothy
Title: Re: Multitasking in x86-64 systems
Post by: woonsan on September 20, 2008, 09:34:56 AM
Hmm. If so, I will keep this method to multitask in x86-64 systems.
I thought that it would make more overhead than hardware ts. Basically, it must be so.
But, I could think that the hardware ts would have more complexity and overheads than software ts in a big system.
Thank you for letting me know the fact. :D
Title: Re: Multitasking in x86-64 systems
Post by: hutch-- on September 20, 2008, 10:20:45 AM
 :bg

> PS: please forgive the admin! He usually replies without bothering to  read the question.

You would think this guy was writing an assembler.

Quote
task switching by task gates on the 80386 ("hardware task switching") wasn't used that much because usually it was faster to do the switch manually. So I guess that they simply removed this feature for 64bit.

Which leaves hardware based multi-threading introduced in the i386 processor.  :green
Title: Re: Multitasking in x86-64 systems
Post by: woonsan on September 20, 2008, 04:55:03 PM
> You would think this guy was writing an assembler.
I am just writing an O.S. for x86-64 systems.
Recently, I studied the x86-64 architecture and I just want to write a simple O.S. on the arch. :D
Title: Re: Multitasking in x86-64 systems
Post by: Mark Jones on September 20, 2008, 09:30:06 PM
Your attempts are commendable Stephanos.

I believe the comment "You would think this guy was writing an assembler"  was directed towards Japeth, who is actually writing an assembler. :bg
Title: Re: Multitasking in x86-64 systems
Post by: woonsan on September 21, 2008, 12:47:55 AM
Quote from: Mark Jones on September 20, 2008, 09:30:06 PM
Your attempts are commendable Stephanos.

I believe the comment "You would think this guy was writing an assembler"  was directed towards Japeth, who is actually writing an assembler. :bg

Sorry, that might be because of my bad English --  :(
Title: Re: Multitasking in x86-64 systems
Post by: hutch-- on September 21, 2008, 10:09:05 AM
 :bg

> Sorry, that might be because of my bad English --

Your English is better than my Greek but I can still read your signature in greek.

There are guys in this forum if they are not busy who have worked on their own OS so they may be able to help you as well.
Title: Re: Multitasking in x86-64 systems
Post by: woonsan on September 21, 2008, 08:14:33 PM
What a good message  :bg
Is there anyone who is interested in Virtualisation with Intel VT?
I have just tried to run a basic virtual machine with Intel VT. It worked but, I cannot make it more complex.
Title: Re: Multitasking in x86-64 systems
Post by: MazeGen on September 22, 2008, 08:22:48 AM
Quote from: Stephanos on September 21, 2008, 08:14:33 PM
Is there anyone who is interested in Virtualisation with Intel VT?
I have just tried to run a basic virtual machine with Intel VT. It worked but, I cannot make it more complex.

Hi, few guys at http://board.flatassembler.net work with this technology, namely vid, HyperVista, and Feryno. Try to ask there (you need to register first).

You can find there also quite active OS dev subforum.
Title: Re: Multitasking in x86-64 systems
Post by: woonsan on September 23, 2008, 12:07:10 AM
MazeGen,
Thank you very much for serving me the information.
I did not know that there is another forum for x86 assembly as big as that.