-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1999 from ghaerr/reboot
[kernel] Consolidate reboot, shutdown and poweroff into single program
- Loading branch information
Showing
15 changed files
with
115 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
#ifndef __ARCH_8086_SYSTEM_H | ||
#define __ARCH_8086_SYSTEM_H | ||
|
||
/* sys_reboot flag parameter */ | ||
#define RB_REBOOT 0x0123 /* hard reset */ | ||
#define RB_SHUTDOWN 0x6789 /* halt system */ | ||
#define RB_POWEROFF 0xDEAD /* call BIOS APM */ | ||
|
||
#ifdef __KERNEL__ | ||
#include <linuxmt/types.h> | ||
#include <linuxmt/init.h> | ||
|
||
extern byte_t sys_caps; /* system capabilities bits*/ | ||
extern seg_t membase; /* start and end segment of available main memory */ | ||
extern seg_t memend; | ||
|
||
extern unsigned int INITPROC setup_arch(void); | ||
extern void hard_reset_now(void); | ||
extern void apm_shutdown_now(void); | ||
unsigned int INITPROC setup_arch(void); | ||
void ctrl_alt_del(void); | ||
void hard_reset_now(void); | ||
void apm_shutdown_now(void); | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,11 @@ reboot \- close down the system or reboot | |
.SH SYNTAX | ||
.ft B | ||
.nf | ||
#define _MINIX_SOURCE 1 | ||
|
||
#include <unistd.h> | ||
#include <sys/mount.h> | ||
#include <arch/system.h> | ||
|
||
int reboot(int \fIhow\fP) | ||
int reboot(int \fImagic1\fP, int \fImagic2\fP, int \fIhow\fP) | ||
.fi | ||
.ft P | ||
.SH DESCRIPTION | ||
|
@@ -18,27 +18,13 @@ down depending on | |
.IR how : | ||
.PP | ||
.TP 5 | ||
.BI "reboot(RBT_DEFAULT)" | ||
Default shut-down action, the same as used when CTRL+ALT+DEL is pressed | ||
on the keyboard. | ||
.TP | ||
.BI "reboot(RBT_HALT)" | ||
.BI "reboot(0, 0, RB_SHUTDOWN)" | ||
Halt the system. | ||
.TP | ||
.BI "reboot(RBT_PANIC)" | ||
Cause a system panic. This is not normally done from user mode, but by | ||
servers using the | ||
.B sys_abort() | ||
kernel call. | ||
.TP | ||
.BI "reboot(RBT_POWEROFF)" | ||
.BI "reboot(0, 0, RB_POWEROFF)" | ||
Power off the system if possible, reset otherwise. | ||
.TP | ||
.BI "reboot(RBT_REBOOT)" | ||
Reboot the system with a software reset (currently not supported, so | ||
a hardware reset is used). | ||
.TP | ||
.BI "reboot(RBT_RESET)" | ||
.BI "reboot(0, 0, RBT_REBOOT)" | ||
Reboot the system with a hardware reset. | ||
.PP | ||
.B Reboot() | ||
|
@@ -50,7 +36,5 @@ the return value is -1 and an error is indicated by | |
.SH SEE ALSO | ||
.BR shutdown (8), | ||
.BR reboot (8), | ||
.BR halt (8), | ||
.BR poweroff (8), | ||
.BR sync (2). | ||
.SH AUTHOR | ||
Edvard Tuinder ([email protected]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,7 @@ min_init | |
mouse | ||
mount | ||
passwd | ||
poweroff | ||
ps | ||
reboot | ||
sercat | ||
shutdown | ||
sysctl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.