Solved

Can I implement these function when reboot

Posted on 2000-04-03
2
189 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
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 100 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now