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

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.

Related

First Windows driver development exercise: dev/random or dev/null?

What follows is really a learning exercise and not necessarily a search for a production solution. I've recently done a bunch of reading about Windows driver development and am looking for a first good exercise in practical application before potentially proceeding toward a future win10 mobile device family project.
Just to get my feet wet with win10 driver development, I was thinking it would be interesting to develop (and then publish) a filesystem driver project that implemented a dumb Windows equivalent of /dev/null or /dev/random - really, any virtual device that I can read a stream of data from.
I haven't done much Windows development in the past, but after reading through a couple books on Safari I've landed on MS's driver samples GitHub page, which seems like a good start, but doesn't seem to provide a clear way forward from what I've read so far.
Right now I'm still casting about with web searches and would sure appreciate some guidance in how to proceed toward this goal (references, reading materials, etc) I'll be happy to publish whatever silly project(s) I wind up generating for others to learn from in the future.
One of the best way to start Windows driver development is with toaster sample . It will provide you basic workable understanding of Windows driver development. You will be able to understand basics for writing bus driver, function driver and filter drivers(upper, lower) in Windows.

Are filter drivers intended to extend system drivers?

Are filter drivers intended to extend system drivers?
Is this their main purpose?
Are they basically just an extra layer that sits between the driver and the user?
This seems overly simple an explanation and I am wondering if I am missing something.
Are there good ways to learn more?
The driver topic is a very advanced one.
To get an overview, you can have a closer look on the Windows Driver Kit (WDK) sides.
If you decide to get into this stuff, then you need a lot of time, frustration resistance and fanaticism.
The first thing you should do (befor you touch the WDK!) is, to start reading a good book.
If you want to develop for windows file system, read Rajeev Nagar's book "Windows NT File System Internals : A Developer's Guide". It's published in 1997, but it's something like the "bible" of NTFS.
For common driver developement you can find books like "Developing Drivers with the Windows Driver Foundation", written by Penny Orwick.
These books describes programming kernel mode software, which is done in C language. So, you should have a good base knowlege on C before you start.
Among others there are the OSR side (www.osr.com) and SysInternals on technet (http://technet.microsoft.com/de-DE/sysinternals), which are truely worth to have a closer look on.
More than the halfe time you spend on reading debug outputs and crash dumps, so it's wise to know what these things are meaning and how to get this information, but there are good books for windows debugging too.
I hope, I was able to give a short overview on the question for the ways to learn more.
In a way yes.
For example, if file system filter driver is for file encryption/compression/security, it is enhancing the file system functionality.
The filter driver does not handle talking to actual devices. They rely on lower level drivers to communicate with device. The filter drivers are add-on to the drivers to implement certain functionality. The active drivers which modify data/request are to enhance vanilla drivers while the passive filter drivers are just pass-throughs without any direct enhancements.
So I think your assumptions are correct.
Will like to hear different views though.

Socket communication with ActiveX EXE

I am developing socket reading on an ActiveX EXE (i.e on a seperate thread).
How many sockets i can safely read independently?
I am working on windows XP OS.
I think this might be an operating system limit - I think I remember running up against a limit of 80 sockets on the XP machine I was using several years ago.
I would recommend that you abandon your effort and go with a commercial solution. I remember going down this path back in the 90s and running into a brick wall with ActiveX EXEs as far as threading goes. The thing is that ActiveX EXEs are apartment threaded, not free-threaded, so you don't get completely independent threads.
And doing server side threads properly is hard enough in modern languages, let alone ones that weren't designed for this purpose.
I ended up purchasing Server Sockets from Dart. Easily the best investment for that project. The performance is truly great - you are only limited by the system resources.
MSWINSCK.OCX is a very old way of doing things; it came with Visual Basic 6.0 and i remember using it way back when. i'm not sure the licensing on it... apparently it registers fine under 32-bit win7, but not 64-bit; here's a link to how to get it to register on 64-bit systems: http://angrybyte.com/windows-hacks/mswinsck-ocx-for-64-bit-windows-7-vista/
if you have an MSDN subscription or similar that gives you the ability to download the developer tools (bizSpark, etc. will do it too) then i believe that will also give you a license to redistribute the .ocx.
(btw, i don't actually remember the interface, but i seem to remember it being at least slightly more intuitive than the berkeley socket() interfaces.)
however, personal recommendation given your requirements: learn the APIs, there are lots of examples out there, and just write yourself a class that encapsulates them in a similar way as, say, the .NET Socket class... the APIs aren't that hard and i'm sure there's lots of help to be had here as well, and that's probably better than relying on something that's out-of-date like the control...

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

learning Windows Development from a Linux background

No I didn't reverse my operating systems in that question! My background has been exclusively Linux/OSX to date, and I honestly don't know a thing about Windows development. Visusal *, *.NET, Powershell, WinForms, Win32, not a clue. They're just words to me. This is starting to be a problem because I've been tasked to port Linux/OSX software to Windows, and Cygwin doesn't begin to cut it.
Does anyone have advice on how to get into Windows development tools? There are a million introductions to UNIX out there, but every google search for "Windows for Linux programmers" gets the opposite result!
EDIT: To give more information I guess what I need the most right now is to learn how to compile and cross-compile using the Microsoft compilers, an overview of the Windows libraries (I guess that's the .NET stuff?), and Powershell. Sorry for being so broad. I guess what's happening is when I sit in front of a Windows machine I revert to a web surfer instead of a programmer because I don't know any of the standard tools outside of Cygwin.
This is going to sound snippy, and I don't mean it that way, but...
Is it at all possible to involve a Windows developer in this effort? It takes a significant amount of time to come up to speed in windows, and if you've been tasked with porting code over, you probably haven't been allocated enough time to come up to speed before starting work. Even bringing in a consultant would provide you with someone to get you going, and steer you away from the rocks once in a while.

Resources