Executing One process alone in the PC.

Posted on 1999-01-21
Last Modified: 2010-04-02
Some form exists to execute a alone program in the PC, stopping all the other processes of sistema(screen rest, TSR...)
Question by:rosch
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 22

Accepted Solution

nietod earned 50 total points
ID: 1184722
You can dissable hardware interrupts for short periods of time.  that would allow you to prevent a TSR from taking over or would prevent a memory refresh from occuring.  You can so this only for a fraction of a second however, before you must enable interrupts again or the computer will die.  Is this what you are talking about?
LVL 22

Expert Comment

ID: 1184723
From C++ you could do
__asm CLI

to prevent interrupts and do

__asm STI

to enable interrupts.

Author Comment

ID: 1184724
This dissable of interruptions will function for the processes in the WIN95? I am using Visual Microsoft Studio 5.0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 22

Expert Comment

ID: 1184725
>> This dissable of interruptions will function for the processes in the WIN95?
Not a chance.  These instructions will fail in protected mode (use of them will cause a general protection fault), since they would allow a program to crash the system if used incorrectly.  

However 16 bit program will still be allowed to use them (which is one of many reasons why 16 bit programs can crash the system).  This is about your only recourse.  The OS isn't going to provide any way for you to have exclusive use of the CPU and is designed to stop any attempt you make.  

Perhaps there is another way, like a high (realtime) thread priority, What are are you doing that you need this for?

Author Comment

ID: 1184726
>> Perhaps there is another way, like a high (realtime) thread priority, What are are you doing that you need this for?
How? I make VxD ring 0?
LVL 22

Expert Comment

ID: 1184727
you can use SetPriorityClass() to set the thread's priority class to REALTIME_PRIORITY_CLASS and you can use SetThreadPriority() to set the priority to THREAD_PRIOROITY_TIME_CITICAL.  This does not guarantee that you get all the CPU time, but it comes close.  However, you can only do this for short periods of time or you could crash the system.

A device driver can use the STI and CLI instructions.  This pretty much insures complete CPU access.  I don't know if a VxD can use those instructions though.  

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C++ Language error 28 312
How to convert MFC APP to Win32 APP. 19 131
I could not build boost code, 10 116
C++ error cannot convert from std::string to const char * 6 367
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question