Single-Tasking?

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.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

iskra wrote:
M-Saunders wrote: Hi, glad you like MikeOS. I determine those exact locations by disassembling the kernel (MIKEKERN.BIN) and looking at the list of calls and rets after the 32K blank space.

You can see that a pattern emerges in the list in mikedev.inc, and when you add a new system call, it's pretty easy to guess as to which number it'll use :-)

Mike
Hey, what disassembler you're using? I need one. :)
try objdump or ndisasm. Objdump ships with GNU binutils, ndisasm ships with NASM.
iskra
Posts: 14
Joined: Thu Oct 11, 2007 7:21 pm

Post by iskra »

JamesM wrote: try objdump or ndisasm. Objdump ships with GNU binutils, ndisasm ships with NASM.
I tried ndisasm but, without file output file i couldn't see much information. How can i make ndisasm to write output to a file?

Can i use Objdump in WinXp?
M-Saunders
Member
Member
Posts: 155
Joined: Fri Oct 27, 2006 5:11 am
Location: Oberbayern
Contact:

Post by M-Saunders »

iskra wrote:I tried ndisasm but, without file output file i couldn't see much information. How can i make ndisasm to write output to a file?
Just redirect it to a file:

ndisasm mikekern.bin > output.asm

Remember that the first 32K of the MikeOS kernel is zeroed-out blank space, so ignore the instructions there (search for the first 'call' and 'ret' combo).

M
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

Colonel Kernel wrote: If there's no stack switch, there's no multithreading/multitasking/whatever you feel like calling it this week. With interrupts, execution is strictly nested. It's re-entrant, but not really concurrent.
There may very well be stack switching, Dos certainly changes stack on its interrupt's.
Go to anyone who know what they are talking about, and they will tell you the old Xbox is single-tasking, but multi-threading.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

actually, the idea that DOS was single-tasking only, is simply untrue...

anyone who worked with computers professionally (including graphics artists, programmers, accountants, etc...) made extensive use of DOS's multi-tasking abilities -- it did have them, they were just very primitive

and there is no difference between a 'task' and a 'thread' they are simply different words to refer to exactly the same thing... (you could consider my computer to be single-tasking: one thread is handling my websurfing, while another is handling my im, and yet another is handling my e-mail notification, and another is handling my spreadsheet, etc...)
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

JAAman wrote:actually, the idea that DOS was single-tasking only, is simply untrue...

anyone who worked with computers professionally (including graphics artists, programmers, accountants, etc...) made extensive use of DOS's multi-tasking abilities -- it did have them, they were just very primitive
Are you talking about TSRs, or something else?
and there is no difference between a 'task' and a 'thread' they are simply different words to refer to exactly the same thing...
Agreed. I think Dex was trying to say that 'task' and 'process' refer to the same thing however.
(you could consider my computer to be single-tasking: one thread is handling my websurfing, while another is handling my im, and yet another is handling my e-mail notification, and another is handling my spreadsheet, etc...)
Now you've lost me. You said task == thread. From this I conclude that multitasking == multithreading and singletasking == singlethreading. Then you said your computer has many threads running. Is that not multitasking then?
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

Dex wrote:There may very well be stack switching, Dos certainly changes stack on its interrupt's.
Why? I've never heard of stack switching on interrupts in real mode before. Seems a bit pointless to me...
Go to anyone who know what they are talking about, and they will tell you the old Xbox is single-tasking, but multi-threading.
They might also say that the sky is green and the grass is blue... It all depends on how you define "task" and "thread". The old Xbox runs a single process with multiple threads. It is based on the NT kernel, and that is NT kernel terminology. If we remove the ambiguous term "task" from the discussion, maybe we can agree a little less violently. :P
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Post by Brendan »

Hi,
Colonel Kernel wrote:
Dex wrote:There may very well be stack switching, Dos certainly changes stack on its interrupt's.
Why? I've never heard of stack switching on interrupts in real mode before. Seems a bit pointless to me...
For DOS, the operating system can't be sure how much free stack space the application has left. For example if the application has 2 KB of space reserved for stack but only 512 bytes is free and if an IRQ handler uses 1 KB of stack space, then switching to another stack makes some sense...


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

Brendan wrote:For DOS, the operating system can't be sure how much free stack space the application has left. For example if the application has 2 KB of space reserved for stack but only 512 bytes is free and if an IRQ handler uses 1 KB of stack space, then switching to another stack makes some sense...
That would make sense... I don't remember that from when I last did DOS programming 12 years ago, but the brain cells are dying whether I like it or not... :P
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

Now you've lost me. You said task == thread. From this I conclude that multitasking == multithreading and singletasking == singlethreading. Then you said your computer has many threads running. Is that not multitasking then?
exactly the point i was trying to make -- there is no difference at all between them

task==process==thread -- they are all different words with exactly the same meaning (well... some people try to make a difference between them, but the difference is artificial -- ie there isnt a defined meaning for them, simply a difference in how they are handled reletive to each other within a single OS -- and that distinction will be different for different OSs
Are you talking about TSRs, or something else?
that is what i had in mind... (although not the only way...) -- it isnt as elegant, but it works, and it is multi-tasking, and it was just as common as multi-tasking today
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

Multi-tasking and multi-threading are different and the differenc is important in this case. This is a good simple example of the differanc :
http://www-304.ibm.com/jct09002c/isv/te ... id=1:13922

Now my point is that you can very easy have multi-threading in a single-tasking OS, as its the program that controls the multi-threading, just like in the xbox theres no memory management, its the programs (games) job to do that.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

Now my point is that you can very easy have multi-threading in a single-tasking OS, as its the program that controls the multi-threading, just like in the xbox theres no memory management, its the programs (games) job to do that.
this is just another way of saying multi-tasking without memory managment

you cannot have multi-threading without multi-tasking, but you can have multi-tasking without multi-threading -- basically, the word 'multi-threading' means multi-tasking in a different way... which means you cannot have it unless you have a baseline for what 'different' means...

if you have one method of multi-tasking, its called multi-tasking, if you have 2 ways of multi-tasking, its called multi-threading



btw: that link is quite irrelevant, since it assumes a definition for what a 'program' is -- and it is completely absurd that there could even be a definition of what a program is -- a program is about how the end-user views the system -- not how the os interacts with it (for example: is office 1 program? or a collection of programs...)
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

JAAman wrote:
Now my point is that you can very easy have multi-threading in a single-tasking OS, as its the program that controls the multi-threading, just like in the xbox theres no memory management, its the programs (games) job to do that.
this is just another way of saying multi-tasking without memory managment

you cannot have multi-threading without multi-tasking, but you can have multi-tasking without multi-threading -- basically, the word 'multi-threading' means multi-tasking in a different way... which means you cannot have it unless you have a baseline for what 'different' means...

if you have one method of multi-tasking, its called multi-tasking, if you have 2 ways of multi-tasking, its called multi-threading



btw: that link is quite irrelevant, since it assumes a definition for what a 'program' is -- and it is completely absurd that there could even be a definition of what a program is -- a program is about how the end-user views the system -- not how the os interacts with it (for example: is office 1 program? or a collection of programs...)
This is nonsense, i can make a multi-threading program to run in Dos very easy, but i can not make Dos multi-task, without a full rewrite.

I have taken you to the water, if you do not want to drink it, that up to you.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Dex you do not seem to understand that it is the nomenclature Colonel Kernel is arguing against.

He (and I) think that the concept 'task' can include both thread and process. You disagree, but seem to be arguing a completely different point!
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

This is nonsense, i can make a multi-threading program to run in Dos very easy, but i can not make Dos multi-task, without a full rewrite.
did you miss my previous post? DOS does multi-task -- apparently your too young to remember (as are most of the people here...), but anyone who actually used DOS for anything serious did multi-task -- quite extensively

however without a complete rewrite you cannot get DOS to multi-thread... (mulit-threading requires the OS -- not the aplication -- to provide 2 separate methods of task-switching)

what one OS calls multi-tasking is exactly like what another calls multi-threading -- the only difference is whether the OS provides a distinct method of doing one different from the other...

my point is there is no way to define the term multi-threading without a comparison to multi-tasking... therefore one must exist before the other to be defined
I have taken you to the water, if you do not want to drink it, that up to you.
you havent taken anyone anywhere -- all you have done is linked to an article miss-abusing a technical term to create a non-technical definition that can be accepted by the ignorant who wouldnt understand the real technical definition

for a brain teaser:
is office 1 program or a collection of programs (for your definition to be valid, you must define what a 'program' is, which is very much undefinable from a technical perspective...)
Post Reply