summaryrefslogtreecommitdiff
path: root/reference/C/CONTRIB/SNIP/memavail.c
diff options
context:
space:
mode:
Diffstat (limited to 'reference/C/CONTRIB/SNIP/memavail.c')
-rwxr-xr-xreference/C/CONTRIB/SNIP/memavail.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/reference/C/CONTRIB/SNIP/memavail.c b/reference/C/CONTRIB/SNIP/memavail.c
new file mode 100755
index 0000000..67400d9
--- /dev/null
+++ b/reference/C/CONTRIB/SNIP/memavail.c
@@ -0,0 +1,32 @@
+/*
+** MEMAVAIL.C - Report available DOS memory
+**
+** public domain by Thor Johnson
+*/
+
+#include <dos.h>
+
+long memavail(void)
+{
+ union REGS regs;
+
+ /* Request impossibly large number of 16-byte paragraphs from DOS */
+
+ regs.h.ah = 0x48;
+ regs.x.bx = 0xFFFF;
+
+ int86(0x21,&regs,&regs);
+
+ return((long)regs.x.bx * 16L);
+}
+
+#ifdef TEST
+
+#include <stdio.h>
+
+main()
+{
+ printf("Available DOS memory = %ld bytes\n", memavail());
+}
+
+#endif /* TEST */
of switch_stack argument of do_work_pending() alpha: don't bother passing switch_stack separately from regs alpha: take SIGPENDING/NOTIFY_RESUME loop into signal.c alpha: simplify TIF_NEED_RESCHED handling
Diffstat (limited to 'kernel/kthread.c')