Course‎ > ‎

Operating System Kernel Design





Module 3


vin process.c

main()
{
        int j=0;
        int k;
        int *ptr;
        ptr=(int *)malloc(70000*sizeof(int));
        while(1)
        {
                j++;
                if(j=100)
                        j=0;
        }
}

# cat /proc/5767/maps

00400000-00401000 r-xp 00000000 08:01 137910                             /home/jestinjoy/process/a.out
00600000-00601000 rw-p 00000000 08:01 137910                             /home/jestinjoy/process/a.out
00e1a000-00e3b000 rw-p 00000000 00:00 0                                  [heap]
7fd3c3c74000-7fd3c3df4000 r-xp 00000000 08:01 656659                     /lib/x86_64-linux-gnu/libc-2.13.so
7fd3c3df4000-7fd3c3ff4000 ---p 00180000 08:01 656659                     /lib/x86_64-linux-gnu/libc-2.13.so
7fd3c3ff4000-7fd3c3ff8000 r--p 00180000 08:01 656659                     /lib/x86_64-linux-gnu/libc-2.13.so
7fd3c3ff8000-7fd3c3ff9000 rw-p 00184000 08:01 656659                     /lib/x86_64-linux-gnu/libc-2.13.so
7fd3c3ff9000-7fd3c3ffe000 rw-p 00000000 00:00 0
7fd3c3ffe000-7fd3c401e000 r-xp 00000000 08:01 656662                     /lib/x86_64-linux-gnu/ld-2.13.so
7fd3c41fd000-7fd3c4200000 rw-p 00000000 00:00 0
7fd3c421b000-7fd3c421d000 rw-p 00000000 00:00 0
7fd3c421d000-7fd3c421e000 r--p 0001f000 08:01 656662                     /lib/x86_64-linux-gnu/ld-2.13.so
7fd3c421e000-7fd3c421f000 rw-p 00020000 08:01 656662                     /lib/x86_64-linux-gnu/ld-2.13.so
7fd3c421f000-7fd3c4220000 rw-p 00000000 00:00 0
7fffc3c01000-7fffc3c22000 rw-p 00000000 00:00 0                          [stack]
7fffc3cb8000-7fffc3cb9000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

The first two regions refer to the code and data and then we have heap region. After we have regions based on standard C library which is specified by the files in /lib. After that we have stack segment and segments which is used for system calls.



Comments