1 | /*
|
---|
2 | =============================================================================
|
---|
3 | ss.c -- show sysem memory allocation values
|
---|
4 | Version 1 -- 1988-06-02 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "stddefs.h"
|
---|
9 | #include "stdio.h"
|
---|
10 | #include "osbind.h"
|
---|
11 |
|
---|
12 | typedef unsigned word;
|
---|
13 |
|
---|
14 | struct basepg {
|
---|
15 |
|
---|
16 | char *lowtpa; /* low TPA (basepage) address */
|
---|
17 | char *hitpa; /* high TPA (initial stack) address */
|
---|
18 | word *tbase; /* text segment base */
|
---|
19 | long tlen; /* text segment length */
|
---|
20 | word *dbase; /* data segment base */
|
---|
21 | long dlen; /* data segment length */
|
---|
22 | word *bbase; /* bss segment base */
|
---|
23 | long blen; /* bss segment length */
|
---|
24 | char *dta; /* initial DTA */
|
---|
25 | struct basepg *parent; /* pointer to parent's basepage */
|
---|
26 | long resptr; /* reserved pointer */
|
---|
27 | char *envstr; /* environment string pointer */
|
---|
28 | };
|
---|
29 |
|
---|
30 | extern struct basepg *_base;
|
---|
31 |
|
---|
32 | /* |
---|
33 |
|
---|
34 | */
|
---|
35 |
|
---|
36 | main()
|
---|
37 | {
|
---|
38 | long savessp, memsize, tpasize, syssize;
|
---|
39 | long *membot, *memtop;
|
---|
40 | long mb, mt;
|
---|
41 |
|
---|
42 | membot = (long *)0x0000432L;
|
---|
43 | memtop = (long *)0x0000436L;
|
---|
44 |
|
---|
45 | printf("GEMDOS System memory allocation information:\n");
|
---|
46 |
|
---|
47 | savessp = Super(0L); /* do this in supervisor mode */
|
---|
48 |
|
---|
49 | mb = *membot; /* TPA start */
|
---|
50 | mt = *memtop; /* TPA end */
|
---|
51 |
|
---|
52 | Super(savessp); /* back to user mode */
|
---|
53 |
|
---|
54 | memsize = mt - mb; /* size of the maximum possible TPA */
|
---|
55 | tpasize = (long)_base->hitpa - (long)_base->lowtpa; /* actual TPA */
|
---|
56 | syssize = memsize - tpasize; /* system size */
|
---|
57 |
|
---|
58 | printf("syssize = %ld, tpasize = %ld\n", syssize, tpasize);
|
---|
59 | }
|
---|