Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can I implement these function when reboot

Posted on 2000-04-03
2
Medium Priority
?
196 Views
Last Modified: 2010-04-02
In my project,there is a PCI card which controls two harddisk's power. Each of the harddisk has a operating system.I want to write a program, in which I click the button and a signal will be sent to the card. Then the card will let the PC reboot,  and switch the power from one harddisk to another.
In this way, the machine is abnormally reboot .Can I let the PC normally reboot and implement this function? In a word, what is the right time that I send a signal to the card after I let the windows normally reboot(The card has a pin connected to the reset line)
0
Comment
Question by:seuwind
[X]
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
2 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2682745
this doesn't sound like a C++ programming question .. more of a operating system / hardware question.

good luck getting an answer here.
0
 
LVL 1

Accepted Solution

by:
LordDragon earned 300 total points
ID: 2709130
I'll answer it anyway ...

....you need to patch into the boot process fairly early (for windows) or into the reboot code fairly late (Linux).

For windows 95/98/Win31/DOS:

1) replace the autoexec.bat file with one which calls a program which:
    a) restores the original autoexec.bat file
    b) flips whatever needs flipping on the card
    c) reboots the computer to use the other hard-drive
2) Cause windows to reboot the computer (many ways to do this).

For NT:
I don't know

For Linux (and most other UNI):
1) You'll need a bit of research here, but you need to find the init.d script which controls the shutdown process, and insert code to flip the card information right before the machine is rebooted (I'd trigger it on the presence of a file in the root directory, which is deleted right before the flip [after it's seen of course]), and then all you have to do is create the file and issue a reboot ('init 6' I think).
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

618 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