mmap.c and region.c in minix 3.1.4

198 views
Skip to first unread message

snell

unread,
May 16, 2009, 2:30:43 AM5/16/09
to minix3
hi all,
Can anyone tell me the work done in mmap.c and region.c??

and from where is this do_map() of mmap.c called ??... CALLMAP
(VM_MMAP, do_mmap, ANYEPM);

Guanqun Lu

unread,
May 16, 2009, 2:47:54 AM5/16/09
to min...@googlegroups.com
On Sat, May 16, 2009 at 2:30 PM, snell <snel...@gmail.com> wrote:
>
> hi all,
> Can anyone tell me the work done in mmap.c and region.c??

mmap.c, i'm afraid is easy to understand, as long as you have a try
with 'mmap()' and munmap() function in unix-like operating system.
region.c contains the operation of managing virtual addresses in process.

>
> and from where is this do_map() of mmap.c called ??... CALLMAP
> (VM_MMAP, do_mmap, ANYEPM);

ANYEPM means every process can call 'do_mmap'.
do_mmap() is called by c library implementation.

> >
>



--
Guanqun

snell

unread,
May 16, 2009, 3:14:12 AM5/16/09
to minix3
what does map_page_region() do ??

Guanqun Lu

unread,
May 16, 2009, 3:38:23 AM5/16/09
to min...@googlegroups.com
On Sat, May 16, 2009 at 3:14 PM, snell <snel...@gmail.com> wrote:
>
> what does map_page_region() do ??

It checks whether a region is available to use, technically whether a
hole between two consecutive regions is availabe to fit the lengh
required. And map the physical address into the page table. The
physical address can be slab-allocated or user specified.

HTH.

But I'm afraid you should get a overview of what's going on in memory
management first. Otherwise, you will be lost in the mass of details.

>
> >
>



--
Guanqun

snell

unread,
May 16, 2009, 6:20:53 AM5/16/09
to minix3
When does page fault occurs and from where is the pagefault called??

Guanqun Lu

unread,
May 16, 2009, 6:58:56 AM5/16/09
to min...@googlegroups.com
On Sat, May 16, 2009 at 6:20 PM, snell <snel...@gmail.com> wrote:
>
> When does page fault occurs and from where is the pagefault called??

Look at servers/vm/pagefaults.c, you'll get some clues.

> >
>



--
Guanqun

snell

unread,
May 17, 2009, 4:15:07 AM5/17/09
to minix3
Do we have a fixed virtual memory in minix 3.1.4 .... if so what it
is ...??
in windows we can change the virtual memory .. can we do that in minix
also ??????

Guanqun Lu

unread,
May 17, 2009, 6:32:39 AM5/17/09
to min...@googlegroups.com
Sorry, I don't understand your problem.
What do you mean by "fixed" virtual memory?

PS: DO NOT use so many question marks, it looks annoying, and it won't
help you get more answers.
--
Guanqun

snell

unread,
May 17, 2009, 7:04:40 AM5/17/09
to minix3


sorry , if that irritates you ..

am trying to run this simple program

#include<stdio.h>
int main()
{
int a[1000][100];
int b[1000][100];
return 0;
}

it gives the error ::
VM:pagefault : SIGSEGV 71175 bad addr 0x7fedaf2c err 0x6 nopage write
a.out 71175 0x59 0x49
PM:signal 11 for 173 / a.out
dumpcore for 173/ a.out
memory fault (core dumped)
Message has been deleted
Message has been deleted

Alexander Ray

unread,
May 18, 2009, 1:12:19 AM5/18/09
to min...@googlegroups.com
I just compiled and ran your test program and it worked fine (compiled with cc).

What version are you using?

Rafael Vargas

unread,
May 18, 2009, 11:58:00 PM5/18/09
to min...@googlegroups.com
On Sun, May 17, 2009 at 1:04 PM, snell <snel...@gmail.com> wrote:
> it gives the error ::
> VM:pagefault : SIGSEGV 71175 bad addr 0x7fedaf2c err 0x6 nopage write
> a.out 71175 0x59 0x49
> PM:signal 11 for 173 / a.out
> dumpcore for 173/ a.out
> memory fault (core dumped)

Where are you running this program at (Virtual Machine, Bare metal, etc)?


--
Rafael Vargas
http://rafavargas.com

Rahmat M. Samik-Ibrahim

unread,
May 22, 2009, 11:20:32 PM5/22/09
to min...@googlegroups.com
Rafael Vargas wrote:

> snell wrote:
>> it gives the error ::
>> VM:pagefault : SIGSEGV 71175 bad addr 0x7fedaf2c err 0x6 nopage write
>> a.out 71175 0x59 0x49
>> PM:signal 11 for 173 / a.out
>> dumpcore for 173/ a.out
>> memory fault (core dumped)
> Where are you running this program at (Virtual Machine, Bare metal, etc)?

I have just tried to replicate this.
I am running it on a Pentium4/HT 3GHz, Ubuntu 9.04,
VMware-server 2.0.1 with Minix 3.1.4

The /var/log/messages output is:
May 23 10:13:46 172 kernel: VM: pagefault: SIGSEGV 71109 bad addr
0x7ff3c908 err 0x6 nopage write
May 23 10:13:46 172 kernel: coba 71109 0x59 0x49
May 23 10:13:46 172 kernel: PM: signal 11 for 119 / coba
May 23 10:13:46 172 kernel: dumpcore for 119 / coba

when executing the program "coba" above
(+ "Memory fault (core dumped)").

--
Rahmat M. Samik-Ibrahim --- vLSM.org

ravi prakash

unread,
May 25, 2009, 1:31:41 AM5/25/09
to min...@googlegroups.com
as far as in know i dont thin minix has virtual memory thats the reason when v have many processes the page tables become full and v can run any more processes v have to suspend the virtaul machine completely
pls correct me if its wrong
--
RAVIPRAKASH D
NITK Surathkal

Ben Gras

unread,
May 25, 2009, 7:10:34 AM5/25/09
to minix3
This is because the given stack size (in virtual address space) isn't
big enough to contain the

int a[1000][100];
int b[1000][100];

so increase the virtual stack region (currently the chmem value is
used, default 128k) or declare those variables globally.
Reply all
Reply to author
Forward
0 new messages