?
Solved

Can I implement these function when reboot

Posted on 2000-04-03
2
Medium Priority
?
195 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

777 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