OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:09 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Shutdown the computer
PostPosted: Sat May 20, 2017 1:33 am 
Offline
Member
Member
User avatar

Joined: Sat May 20, 2017 1:25 am
Posts: 51
Location: PCI bus: 3, slot: 9, function: 5
How can I shutdown NOT REBOOT the computer at protected mode using assembly?
(NASM for x86 CPU)

_________________
How people react when a new update of your OS is coming:
Linux user: Cool, more free stuff!
Mac user: Ooh I have to pay!
Windows user: Ah not again!


Top
 Profile  
 
 Post subject: Re: Shutdown the computer
PostPosted: Sat May 20, 2017 1:42 am 
Offline
Member
Member

Joined: Mon Jan 03, 2011 6:58 pm
Posts: 283
http://wiki.osdev.org/Shutdown


Top
 Profile  
 
 Post subject: Re: Shutdown the computer
PostPosted: Sat May 20, 2017 4:34 am 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
ARISTOS wrote:
How can I shutdown NOT REBOOT the computer at protected mode using assembly?
(NASM for x86 CPU)

The same way you would using any other language.

_________________
You know your OS is advanced when you stop using the Intel programming guide as a reference.


Top
 Profile  
 
 Post subject: Re: Shutdown the computer
PostPosted: Sat May 20, 2017 4:46 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
Maybe you should first figure out why it is rebooting the computer? Are you just triggering a protection fault and letting the system reset itself?

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
 Post subject: Re: Shutdown the computer
PostPosted: Sat May 20, 2017 7:15 am 
Offline
Member
Member

Joined: Thu Aug 13, 2015 4:57 pm
Posts: 384
onlyonemac wrote:
Maybe you should first figure out why it is rebooting the computer? Are you just triggering a protection fault and letting the system reset itself?


I took it the OP isn't interested how to reboot, and thus made the distinction.

Nice use of google and the Wiki though =)

http://lmgtfy.com/?q=osdev+shutdown


Top
 Profile  
 
 Post subject: Re: Shutdown the computer
PostPosted: Sun May 21, 2017 12:01 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
@ARISTOS, please elaborate on what you need, and what you have tried. The question leaves a lot of details out that we will need in order to answer it, starting with, what code have you already seen that works for rebooting, but not shutting down? It is unusual for a code example or tutorial to cover one but not the other, without at least a link to a parallel one for the other problem. Also, the answers would require details about the platform; since you mentioned NASM, we can probably assume x86 protected mode, but if you are in either real mode or long mode, the answers will be different.

LtG wrote:
onlyonemac wrote:
Maybe you should first figure out why it is rebooting the computer? Are you just triggering a protection fault and letting the system reset itself?


I took it the OP isn't interested how to reboot, and thus made the distinction.


I think that you missed OnlyOneMac's point, though I am not sure that OOM understood the OP's point either.

Onlyonemac seems to be reading this as 'the code I wrote to shut the system off is causing it to reboot instead', and concluded that the code in question is causing a segfault, making it look as if it were running 'correctly' but doing the wrong thing (that is, that the information the OP had was given as being for shutting down but was actually the code for a soft reboot) when in fact it is buggy.

However, that seems to assume facts not in evidence. The OP never stated that the code in use is rebooting the OS, or mentioned any existing code at all. There just isn't enough information in the original post, period.

So, I repeat: @ARISTOS, please elaborate on what you need, and what you have tried.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Last edited by Schol-R-LEA on Sun May 21, 2017 10:05 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Shutdown the computer
PostPosted: Sun May 21, 2017 8:02 pm 
Offline
Member
Member
User avatar

Joined: Wed Aug 17, 2016 4:55 am
Posts: 251
Yeah I also assumed it was just asking explicitly for shutdown and not reboot. I know there are a lot of tutorials around on how to reboot the computer (without making use of APM and ACPI), but not as much stuff explaining how to turn off the computer (or for that matter, how to reboot without resorting to legacy tricks).


Top
 Profile  
 
 Post subject: Re: Shutdown the computer
PostPosted: Sun May 21, 2017 10:11 pm 
Offline
Member
Member

Joined: Thu Aug 13, 2015 4:57 pm
Posts: 384
Schol-R-LEA wrote:
LtG wrote:
onlyonemac wrote:
Maybe you should first figure out why it is rebooting the computer? Are you just triggering a protection fault and letting the system reset itself?


I took it the OP isn't interested how to reboot, and thus made the distinction.


I think that you missed OnlyOneMac's point, though I am not sure that OOM understood the OP's point either.

Onlyonemac seems to be reading this as 'the code I wrote to shut the system off is causing it to reboot instead', and concluded that the code in question is causing a segfault, making it look as if it were running 'correctly' but doing the wrong thing (that is, that the information the OP had was given as being for shutting down but was actually the code for a soft reboot) when in fact it is buggy.


I guess I should've been clearer. I think I got OOM's point: "triple fault -> reboot", or something along those lines. I was trying to convey that the reason "NOT REBOOT" was mentioned in OP is because presumably the OP has found how to reboot but not found how to shut down, and is therefore explicitly stating that he/she isn't interested in help with rebooting.

So I was trying to say that "NOT REBOOT" was mentioned to avoid possible mix-ups and that the OP isn't interested in reboot and that's the reason reboot is even mentioned in OP.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], SemrushBot [Bot] and 78 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group