[Freedos-user] DOS and timing...

2012-03-28 Thread Michael Robinson
Since DOS environments typically don't multitask, there's no need to
time applications as they consume CPU resources and preempt them to let
other applications run.  Modern multi core processors can do real
multitasking and don't have to simulate process concurrency.  In DOS
environments, there is no multi tasking, so it doesn't make sense to
time programs beyond looking at whether the program's time complexity is
roughly exponential or not.  Is the solution to the problem a polynomial
time solution or worse?  If you need an idea real time of how your
program is using the system's resources, you need UNIX, MACOSX, Windows,
or some other modern OS.

I guess there is nothing stopping you from writing multitasking into
your DOS based application, think Windows 3.11.  If you go to the
trouble though of recognizing multiple processes and task switching,
chances are good that you'll want to protect user A's processes from
meddling by user B.  

DOS is a lightweight OS because unlike UNIX and Windows NT it doesn't
attempt to block direct hardware access let alone provide abstractions
for hardware.  DOS is lightweight, but DOS applications are hard to
maintain.  Actually, hard drives and video devices are abstracted in
DOS.  As hard drives and video devices change, DOS has to change too.
VESA is a standard, but is it updated?  How about the BIOS which is
changing now?  There is talk of having to have a special bios and a boot
sector signature to run Windows NT, how will that affect Freedos and
Linux going forward?  Printers and mice for example have changed over
time where interfaces have changed beyond just the hard drive interface.
Think universal serial bus, a replacement for serial ports, parallel
ports, and PS/2 ports.  For commercial DOS programs you are very
unlikely to be able to use a USB printer with them.  USB gamepads and
joysticks?  Not likely with games themselves having to support the
hardware directly.  USB video cameras?  Again, not likely.

DOS environments as far as I know don't even protect against processes
accessing memory that doesn't belong to them.  DOS originally was QDOS
which stood for quick and dirty operating system.  No protection means
you can write fast programs and not worry about the overhead of
protection, but you can't preempt processes to multitask without
protection.  Aside from simple applications which have to run fast, does
Freedos make any sense?  Emulated hardware running Freedos or DOSBox
make a lot of sense so long as the DOS application of choice doesn't tax
a modern computer.

Knowing how long a program will take to execute is often important, but
Freedos isn't the best environment for real time or otherwise time
critical apps.


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] DOS and timing...

2012-03-28 Thread Zbigniew
2012/3/28, Michael Robinson plu...@robinson-west.com:

   Since DOS environments typically don't multitask, there's no need to
 time applications as they consume CPU resources and preempt them to let
 other applications run. [..]

Ability to detect heavy CPU load can be important information for me,
that e.g. I did something wrong (for example, some loop has to be done
differently).

As for multitasking: no, Forths - at least the ones for DOS - don't do
preemptive, but cooperative multitasking. Then still I would to know,
how many % of CPU time will be left unused, when the graphics - corpse
rotation in this particular case - has been done. It'll tell me, what
else can I do without slowing down the display; do I have spare
CPU-power, or not.
-- 
Z.

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] DOS and timing...

2012-03-28 Thread Bernd Blaauw
Op 29-3-2012 1:20, Zbigniew schreef:

 Ability to detect heavy CPU load can be important information for me,
 that e.g. I did something wrong (for example, some loop has to be done
 differently).

In-app profiling, or using a debugger maybe, could help.
Otherwise, run DOS and your program inside an emulator 
(QEMU/Bochs/DosEMU) and get detailed output (timestamped logfiles) from 
that.

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] DOS and timing...

2012-03-28 Thread Zbigniew
2012/3/28, Bernd Blaauw bbla...@home.nl:

 In-app profiling, or using a debugger maybe, could help.
 Otherwise, run DOS and your program inside an emulator
 (QEMU/Bochs/DosEMU) and get detailed output (timestamped logfiles) from
 that.

But of course using debugger I can check this in its every detail. But
having such little CPU monitor built directly into application for
most cases could be quite enough, as kind of rough check. Besides:
here we are on opposite pole of the subject; remember: I need it not
just as a detector for programming mistakes, but also as kind of
graphics system efficiency meter.

Both applications for this are equally valid.
-- 
Z.

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user