Would that work in a multicore/multiprocessor system (i.e., would it leave the machine in a predictable state)?XCHG wrote:Oh you can also restart the PC by setting Bit#0 in keyboard’s microcontroller output port. First you have to poll Port 0x64 and see if Bit#0 is zero and then go on if yes. Then send the command 0xD1 to Port 0x64 and poll the same port and wait until Bit#0 is zero again just like you did at the first step. Now send the command 0x01 to Port 0x60 and the PC will be restarted. Here is the code that I wrote:
Hope that it helps.Code: Select all
@@__WaitInputEmpty: IN AL , 0x64 TEST AL , 0x01 JNE @@__WaitInputEmpty MOV AL , 0xD1 OUT 0x64 , AL @@__WaitAgain: IN AL , 0x64 TEST AL , 0x01 JNE @@__WaitAgain MOV AL , 0x01 OUT 0x60 , AL
Shutting Down and Restarting the computer?
It is on the wiki, though pretty hidden...
http://www.osdev.org/wiki/Keyboard_Controller
You didn't have to resurrect a year-old thread if you had looked harder...
http://www.osdev.org/wiki/Keyboard_Controller
You didn't have to resurrect a year-old thread if you had looked harder...
"Sufficiently advanced stupidity is indistinguishable from malice."
- CmpXchg
- Member
- Posts: 61
- Joined: Mon Apr 28, 2008 12:14 pm
- Location: Petrozavodsk, Russia during school months, Vänersborg Sweden in the summertime
Well, talking about shutdown, things ain't so sad.
Using the datasheet, I figured out how to shutdown my own PC via motherboard registers:
If you also happen to have a VIA VT82x chipset, you could test it on your machine. PS: I wonder if there's a universal way, is it possible to shutdown from within Protected Mode?
Using the datasheet, I figured out how to shutdown my own PC via motherboard registers:
Code: Select all
%define pcidev(dev,func) (dev<<3)+func
...
;get I/O base
call pci_read_config_dword,pcidev(17,0),88h
;if pci_read returned, say, 4001h, adding 3 gives 4004h,
;which corresponds to I/O offset 4.
add ax,3
;do the magic;)
mov dx,ax
in ax,dx
or ah,00101000b
and ah,11111110b
out dx,ax
;the system should now go down ;) the next instruction is never executed, put hlt just in case
hlt