aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/apm
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/apm')
-rw-r--r--src/kernel/apm/apm.asm37
-rw-r--r--src/kernel/apm/apm.c5
-rw-r--r--src/kernel/apm/apm.h10
3 files changed, 52 insertions, 0 deletions
diff --git a/src/kernel/apm/apm.asm b/src/kernel/apm/apm.asm
new file mode 100644
index 0000000..e39cc84
--- /dev/null
+++ b/src/kernel/apm/apm.asm
@@ -0,0 +1,37 @@
+global apm_check
+global apm_connect
+global apm_poweroff
+global apm_sleep
+
+extern apm_error
+
+apm_check:
+ mov ah,53h
+ mov al,00h
+ xor bx,bx
+ int 15h
+ jc apm_error
+ ret
+
+apm_connect:
+ mov ah, 53h
+ mov al, 03h
+ xor bx, bx
+ int 15h
+ jc apm_error
+
+apm_poweroff:
+ mov ah, 53h
+ mov al, 07h
+ mov bx, 0001h
+ mov cx, 03h
+ int 15h
+ jc apm_error
+
+apm_sleep:
+ mov ah, 53h
+ mov al, 07h
+ mov bx, 0001h
+ mov cx, 01h
+ int 15h
+ jc apm_error \ No newline at end of file
diff --git a/src/kernel/apm/apm.c b/src/kernel/apm/apm.c
new file mode 100644
index 0000000..ce25da8
--- /dev/null
+++ b/src/kernel/apm/apm.c
@@ -0,0 +1,5 @@
+#include "../graphics/graphics.h"
+
+void apm_error() {
+ terminal_write_line("APM has errors.");
+} \ No newline at end of file
diff --git a/src/kernel/apm/apm.h b/src/kernel/apm/apm.h
new file mode 100644
index 0000000..38deb3d
--- /dev/null
+++ b/src/kernel/apm/apm.h
@@ -0,0 +1,10 @@
+#ifndef MELVIX_APM_H
+#define MELVIX_APM_H
+
+extern void apm_poweroff();
+
+extern void apm_sleep();
+
+void apm_error();
+
+#endif