flat assembler
Message board for the users of flat assembler.

Index > OS Construction > New DexOS release

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
dasyar



Joined: 27 Feb 2005
Posts: 33
dasyar
You mention that DexOS is multi-threading, how does that work. Since I have seen different explanations of multi-threading, what would be your definition of multi-threading as it applies to DexOS.

Thanks
Post 15 May 2008, 22:15
View user's profile Send private message Reply with quote
roboman



Joined: 03 Dec 2006
Posts: 122
Location: USA
roboman
"only a single process is allowed (though that process can spawn multiple threads). The program runs in ring0, you have direct access to all hardware (including CPU and graphics). Memory allocation is the responsibility of the app--there's no front-end memory allocation"

That part of the description of DexOS is a little old. You can also load drivers that are kind of like a Dos tsr and you can link them to an interrupt. The OS does some loading and provides some standard function calls, but the system is left open to do what ever the programer wants
Post 16 May 2008, 05:14
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I would add on to what roboman as put, that many codes interpret multi-tasking V multi-threading in many differant ways.
From my point of view, multi-tasking is running more than one program at the same time including running multi instances of the same program.

Multi-threading is running more than one thread inside a program.
Take a http server for a example, if its a single threading server running on a single-tasking OS you can only serve one page at a time.

But if the server was multi-threading, each new request could be give its own thread which would be call in its turn, once it finished it would be deleted from the list.
So multi-threading is a much better ver of the MAIN loop, in a main loop of a game for example it is possable for something taking longer to stop or slow down something else, but with multi-threading it is given a time slice and than switched to the next in the list.
In multi-threading (in DexOS case anyway) you can have thread states (just like task states)
free
ready
send
recv
putc
getc
Just like multi-tasking, if you want.

So to answer your ?, one is running more than one program at a time, the other is running more the one thread inside a program.

I can if you want dig out a simple DexOS example, if it would help.
Regards Dex.
Post 16 May 2008, 11:35
View user's profile Send private message Reply with quote
dasyar



Joined: 27 Feb 2005
Posts: 33
dasyar
For an example, the answer would be yes, I think that other people would also be interested. I am still not sure how multi-threading would be more beneficial than multi-tasking. Also, when you say that DexOS does not do multi-tasking, you mean it is not using the built-in processor functions, which means you could still do it with some software functions?

Thanks
Post 16 May 2008, 13:25
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
dasyar wrote:
For an example, the answer would be yes, I think that other people would also be interested. I am still not sure how multi-threading would be more beneficial than multi-tasking. Also, when you say that DexOS does not do multi-tasking, you mean it is not using the built-in processor functions, which means you could still do it with some software functions?

Thanks

I will post a example and yes you could make DexOS multi-task from code run from a module.
As to why multi-threading could be more beneficial than multi-tasking, the answer it for some task it can be, for example when you are coding for a multi-tasking OS you do not know what else is being run or how many other programs are being run.

With multi-threading ( as it is in DexOS) you still have full control over the whole OS.
That is very important with DexOS, to beable to control and have direct acsess to all hardware.

Thinks like the xbox are single tasking, but multi-threading.
Also you can us multi core for multi-threading.
Post 16 May 2008, 14:13
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
assuming an os is an application..
the programs running can be concidered as threads.

then, does multitasking really exist?
Post 16 May 2008, 14:57
View user's profile Send private message Visit poster's website Reply with quote
roboman



Joined: 03 Dec 2006
Posts: 122
Location: USA
roboman
The clock program on my web page would probably be called a multitasking program. It's external to any program that is being run and just updates a clock in the corner of the screen once a min. If, for example, you open up the text processor, the clock is still running in the background. It has nothing to do with the OS and just sits up in high mem stealing a few clock cycles several times a second. You could probably also call it multi threading, since it's written so that it can be turned off and on from inside another program. You turn it off and it no longer eats clock cycles, turn it back on and runs at the same time your program does, checking several times a second to see if the on screen clock needs updating. But the OS doesn't do the swapping between the tasks. A good example of where multithreading being good is a game. Each computer controled player may only need to have their movements updated 24 times a second, so every 1/24 of a second they get accessed and the rest to the time the game is in the main loop trying to keep your movements and screen updates as smooth as possable.
http://home.comcast.net/~dexos/
Post 16 May 2008, 15:23
View user's profile Send private message Visit poster's website Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
Hello Very Happy
Note that your CPUID program inside DexOS report to me HTT
technology , but my CPU don't support such extension.
To detect HTT:
Code:
mov eax,1
cpuid
shr ebx,16
and ebx,0ffh
cmp ebx,2
jc HTT_Not_Supported    
Post 18 May 2008, 10:11
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Thanks for the info D J Mauretto, i will look into it Smile .
Post 18 May 2008, 14:43
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
another mod to do :

HLT somewhere in the mainloop to save energy
and avoid the termal shutdown of PC.
Post 28 May 2008, 21:13
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
Multi-threading is way more important than Multi-tasking for some interactive applications like 3D renderers or games Wink Simply, you can divide the task into multiple ones, to work in parallel. Even the hard disk could have a different thread (for asynchronous read/write) that will mostly be idle Wink
Post 29 May 2008, 09:27
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Thanks for your inputs i agree with both of you, eg: this is the main CLI loop
Code:
CheckForKey:
        call  GetCommand
    call  ProcessCmd
    hlt
 jmp   CheckForKey
    
Post 29 May 2008, 12:36
View user's profile Send private message Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
Remember always to enable interrupt flag Wink
Code:
CheckForKey: 
        call  GetCommand 
        call  ProcessCmd 
        sti
        hlt 
        jmp   CheckForKey     

_________________
Nil Volentibus Arduum Razz
Post 29 May 2008, 12:45
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.