Projects on Memory Paging - memory-management

i am studying for a test on operating systems , and i would love it if i can take a look at
free source projects regarding memory management and memory paging.
Thanks very much for your help:)
Nataly

There's plenty of OS kernels with source available, but I have a feeling trying to pick through them is going to be very difficult. A production kernel is a complex piece of work, so it's hard to understand the theory behind it by looking at the code.
What you probably want is an OS simulator that focuses on teaching the theory. We wrote our own in my OS classes. Just a quick google search came up with this list of a number of them:
http://vip.cs.utsa.edu/simulators/

Related

RTOS Alongside Windows

I have a question about a family of softwares, of which one example is INtime, which lets you run a real-time operating system in parallel with Windows.
I have a reasonable grasp on how Windows works, including kernel/driver/application security rings etc. Similarly, I know how a RTOS runs on a dedicated system.
The Simple Question:
How do these go about existing together without fighting over hardware or other similar problems? How is the allocation or resources made, and how is this integrated with Windows?
Slightly more complicated:
What are the steps I would have to take if I wanted to develop something similar myself? Are there some open-source embodiment's of this paradigm I can inspect to glean some more understanding?

High performance OS/hardware/networking optimizations

I am working on a very latency sensitive application, and it's at the point where we are trying to get 10s of microseconds of performance improvements out of it. In addition to code optimizations, hardware and OS specific topics have come up, such as processor affinity and interrupt coalescence.
While this is very useful, I've found that these topics come up as tribal knowledge - someone read an article that mentioned a topic, then we do some research into it, and if it feels promising, we finally try implementing it and measure the results. This feels haphazard to me and I am looking for a more regimented approach to learning about these things. The big problem that I face is not knowing what I don't know.
What is a good approach to learning about lower level OS, hardware and networking specific optimizations? Are there specific books or papers that I should read on the topic, or is it more a matter of reading hardware manuals such as this one?
Vendors: work with Intel and AMD for processor optimisations, work with RedHat, SuSe, and Microsoft for OS optimisations, subscribe to various mailing lists for development updates on compiler technologies: Clang, and library dependencies: Glibc, etc.
Want high speed networking? Contact Mellanox, Solarflare, Intel: all are high end vendors and can offer consulting and technology resources for improving development practice and provide insight into future directions.

Are there memory leaks in Linux?

This question is purely theoretical.
I was wondering whether the Linux source code could have memory leaks, and how they debugged it, considering that it is Linux, after all, that deals with each program's memory?
I obviously understand that Linux, being written in C, has to deal itself with malloc and free. What I don't understand is how we measure the operating system's memory leaks.
Note that this question is not Linux-specific; it also addresses the corresponding issues in Windows and MacOS X (darwin).
Quite frequently non-mainstream drivers and the staging tree has memory leaks. Follow the LKML and you can see occasional fixes for mistakes in the networking code for corner cases handling lists of SKBs.
Due to the nature of the kernel most work is code review and refactoring, but work is ongoing to make more tools:
http://www.linuxfoundation.org/en/Google_Summer_of_Code#kmemtrace_-_Kernel_Memory_Profiler
In certain cases you can use frameworks like Usermode Linux and then use conventional tools like Valgrind to attempt to peer into the running code:
http://user-mode-linux.sourceforge.net/
The implementation of malloc and free (actually brk/sbrk, since malloc and free are implemented by libc in-process) are not magical or special - it's just code, just like anything else, and there are data structures behind it that describe the mappings.
If you want to test correct behavior, one way is to write test programs in user-space that are known to allocate then free all their memory correctly. Run the app, then check the internal memory allocation structures in kernel mode using a debugger (or better yet, make this check a debug assert on process shutdown).
All software has bugs, including operating systems. Some of those bugs will result in memory leaks.
The Linux has a kernel debugger to help track down these things, but one has to discover that they exist before one can track them down. Usually, once a bug has been discovered and can be replicated at will, it becomes much easier to fix (Relatively speaking! Obviously you need a good coder to do the job). The hard part is finding the bugs in the first place and creating reliable test cases that demonstrate them. This is where you need to have a skilled QA team.
So I guess the short version of this answer is that good QA is as important good coding.

Resources to help learn Windows kernel development in an operating systems class?

I am currently in an university operating system class and we are working on the windows kernel, more precisely WRK, the windows research kernel, for our projects. WRK is based off of win2k3 server.
I am however having a real hard time dredging up resources to help learn the basics of OS development, Windows kernel development and just generally getting around the Windows API.
We are using the book Microsoft Internals by Russinovich but I was wondering if any of you had some great resources to recommend to me, whether book, online guides or some old class notes. Thanks!
What specifically are you looking for? Online resources? For that, OSROnline is one of the better websites. Alot of kernel development knowledge is found in the MS and the OSR Mailing lists, that's another place to check that might be better than Stack overflow.
Specifically books, there is the Programming WDM,Developing drivers with KMDF and Advance Windows Debugging. The last specifically will not teach you so much about the kernel and more how to navigate inside it, something you will do quite often if you are writing drivers or researching parts of it.
In order to write drivers, the easiest way is probably to take Windows Driver samples and hack at them, stare the results with windbg and learn more.
microsoft kernel dev? that's just weird. what university are you at?
one of the most interesting things about kernels, in my opinion, is the scheduler algorithms. I'd recommend you check that out.
I can't imagine where you'd start looking for windows stuff though. I did it with the linux kernel and there's a LOT of resources (of course).
http://oreilly.com/catalog/linuxkernel/chapter/ch10.html
The third edition of Tanenbaum's Modern Operating Systems has a chapter devoted to the Vista kernel. I haven't looked into that chapter (I only read the Linux one), but as far as big-picture stuff, it's fantastic. I'm not sure what level of detail you're looking for, but that might be a good resource to check out.

where to start linux kernel programming?

I have been programming in C for a couple of years in Linux. Now I want to work on linux kernel and contribute to kernel, if possible. I have been looking on the internet for the information about a starting point but I couldn't find one. So can any one please tell me where to begin?
I'm not a kernel person at all but I work with a lot of people who are very much into the kernel. They all recommend Linux Kernel Development by Robert Love as a good book on the subject. I've bought the book myself and plan to, in my copious free time, go through it.
The Kernel Mentors mailing list related resources at http://kernelnewbies.org/KernelMentors is also a good place to look at.
I would also recommend the site lxr.linux.no as a browsable source code repository.
It contains version 0.0.1 an up. With the help of this site, it is very easy to search for keywords in the kernel source on different versions.
Basically venturing into kernel programming starts off with a need to fiddle with services provided by the kernel....Me for example ..i had a need to fiddle with the IP packets generated and arriving on the kernel network stack....so started of writing LKMs,.,,kernel modules.And understand becomes easier if you have good understand of general Operating System Concepts.For example there was this book which i referred during my engineering undergraduation days...Operating System Concepts Author Silberschatz Galvin..even though i never cracked my head understanding user space and kernel space..that book did look into core concept at a more naive level...and it looked in from general OS point of view not specific to linux as such..now that i am more into kernel space programming that i realize how beautifully that book ventured into both user space and kernel space concepts....it just starts off with NEED to get into kernel side...from user space

Resources