source: buchla-68k/orig/GEMDOS/SS.C@ 0170798

Last change on this file since 0170798 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 1.6 KB
Line 
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
12typedef unsigned word;
13
14struct 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
30extern struct basepg *_base;
31
32/*
33
34*/
35
36main()
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}
Note: See TracBrowser for help on using the repository browser.