Operating Systems: Design and Implementation by Tanenbaum and Woodhull is pretty much the book on operating systems. There's also Modern Operating Systems by Tanenbaum, which I haven't read yet. Design and Implementation is good except that it focuses on Tanenbaum's own OS, MINIX a little too much. It should probably be called MINIX: Design and Implementation. It is good, though; it explains some theory and gives explanations of different algorithms (e.g., for scheduling). I don't know what the other one is about, so it might be factual (how specific modern operating systems work) or conceptual (how modern operating systems work in general, which would be more useful to someone who wants to write one).
Basically anything by Tanenbaum.
Oh, and, if you're planning to write one, get the documentation of the system. If nothing else, you have to read the platform documentation. AMD and Intel have free downloads on their websites.
This book has actual programming exercises after each chapter. It has you modify/add some Linux commands, read some of Linux's source code, etc. Even has a bunch of code straight from Linux (Ubuntu 10.04 I think) through out the chapters.
As chrisname said Operating Systems Design and implementation is the best book to start with. I read the second and third editions of it. I disagree with it being a problem that it focus on minix too much - you cannot learn this stuff in the abstract and a (relatively) simple model is needed - hence minix.
The second edition refers to minix 2. This was designed specifically as a teaching aid. Since then, Tanenbaum has published / released minix 3 which has very different objectives now. You cant go wrong by getting a cheap old copy of the 2nd edition and downloading minix 2.