PDA

View Full Version : FreeBSD and Memory


synack
May 13th, 2009, 07:18
Hi,

I am currently studying computer science at university and am looking at computer memory in one of my subjects. I would like to know which area of the FreeBSD source code (/usr/src) do I need to look at to get an idea of how FreeBSD handles memory, both physical and virtual.

thanks for any help,

synack.

synack
May 13th, 2009, 07:30
just a quick note.. I have ordered a copy of "Design and Implementation of the FreeBSD Operating System" which seems to be dealing with FreeBSD 5.2. Is this code still available for download?

synack.

Oko
May 13th, 2009, 07:45
just a quick note.. I have ordered a copy of "Design and Implementation of the FreeBSD Operating System" which seems to be dealing with FreeBSD 5.2. Is this code still available for download?

synack.
Yes it is available. Check the ftp server. I assume you do know
by heart Lion's Commentary on Unix and Design of the UNIX Operating System by Maurice J. Bach when you want to read
"Design and Implementation of the FreeBSD Operating System";)

synack
May 15th, 2009, 09:13
so... is someone going to point me in the direction of the code that deals with memory? or am I going to have to wait for the book to arrive in the mail?.

vivek
May 15th, 2009, 10:23
You can find memory manager and kernel related files in /usr/src directory if you installed kernel source code. I'm not aware of memory manager functions or files. But one can use grep command to locate specific functions:
grep -R 'function_name' *

hydra
May 15th, 2009, 11:28
For source files browsing I recommend devel/cscope.

Maledictus
May 16th, 2009, 12:01
Or start here:
http://fxr.watson.org/fxr/source/vm/

rwatson@
May 16th, 2009, 14:48
Or start here:
http://fxr.watson.org/fxr/source/vm/

This is the best starting spot for the kernel VM system and kernel slab allocator (UMA) -- here are a few other places to start reading:

- Kernel malloc, a thin wrapper around UMA - http://fxr.watson.org/fxr/source/kern/kern_malloc.c
- User malloc, a thicker wrapper around VM (and especially mmap(2)) - http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/malloc.c?rev=1.147.2.7;content-type=text%2Fplain