1 /* Test memory Aliasing for MMURTL V1.0 */
\r
2 /* Copyright (c) 1994 R.A. Burgess */
\r
3 /* All Rights Reserved */
\r
6 This simple program shows how memory aliasing works in MMURTL.
\r
7 To build this, use MakeIt.bat in DOS, or use CM32 and DASM:
\r
13 #define U32 unsigned long
\r
15 #define U16 unsigned int
\r
17 #define U8 unsigned char
\r
28 /* Includes for OS public calls and structures */
\r
30 #include "\OSSource\MMemory.h"
\r
31 #include "\OSSource\MKbd.h"
\r
32 #include "\OSSource\MStatus.h"
\r
34 /**************** BEGIN Data ********************/
\r
40 /**************** BEGIN Code ********************/
\r
42 void main(U32 argc, U8 argv[])
\r
44 unsigned long erc, key;
\r
46 erc = GetPhyAdd(1, 3072, &OSPhy);
\r
48 printf("ERROR %d on GetPhyAdd.\r\n", erc);
\r
50 printf("Aliasing Job 1 Linear Address %08x\r\n", 3072);
\r
51 printf("Physical Address is %08x\r\n", OSPhy);
\r
53 erc = AliasMem(3072, 8000, 1, &Alias);
\r
56 printf("ERROR %d on AliasMem.\r\n", erc);
\r
58 erc = GetPhyAdd(3, Alias, &AliasPhy);
\r
61 printf("ERROR %d on GetPhyAdd.\r\n", erc);
\r
63 printf("Alias Linear address is %08x\r\n", Alias);
\r
64 printf("Physical Address is %08x\r\n", AliasPhy);
\r
66 printf("Press a key to continue...\r\n");
\r
69 erc = DeAliasMem(Alias, 8000, 3);
\r
71 printf("ERROR %d on DeAliasMem.\r\n", erc);
\r