#include "user.h"
#define PGSIZE 4096 // 4K Page size
+#define CURRENTLY_OCCUPIED_MEM 0
+#define STDOUT_FD 1
int
main(int argc, char *argv[])
{
- // Student code goes here
+ // Student code goes here
+ int memsz;
- exit();
-}
\ No newline at end of file
+ /* initialize to current memory */
+ /* TODO look at exec call and see if we care about stack memory */
+ memsz = CURRENTLY_OCCUPIED_MEM;
+
+ /* start allocating memory */
+ while ((int) sbrk(PGSIZE) != -1)
+ memsz += PGSIZE;
+
+ printf(STDOUT_FD, "Maximum Memory Size: 0x%x\n", memsz);
+
+ exit();
+}