os161-1.99
 All Data Structures
vm-stack1.c
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 
00004 #define PAGE_SIZE (4096)
00005 #define PAGES     (9)
00006 #define SIZE      (PAGE_SIZE * PAGES / sizeof(int))
00007 
00008 int
00009 main()
00010 {
00011         unsigned int array[SIZE];
00012         unsigned int i = 0;
00013 
00014         for (i=0; i<SIZE; i++) {
00015                 array[i] = i;
00016         }
00017 
00018         for (i=0; i<SIZE; i++) {
00019                 if (array[i] != i) {
00020                         printf("FAILED array[%d] = %u != %d\n", i, array[i], i);
00021                         exit(1);
00022                 }
00023         }
00024 
00025         printf("SUCCEEDED\n");
00026         exit(0);
00027 }
 All Data Structures