https://www.amazon.com/Developing-32-Bit-Operating-System-Cd...
And then wrote my own Game Gear emulator for it one night, just for shits and giggles, like you did. It was also my first attempt at writing a whole system emulator, and the GG, like the GB, was incredibly well understood even back then.
For anyone interested in emulation I think it is a great little project to write a video game emulator. It is enormously fun to watch one of your favorite video games boot up in code that you wrote. And it is fun (for me) to try and debug all the little glitches where you've made errors or omissions in your emulator.
https://www.amazon.com/Developing-32-Bit-Operating-System-Cd...
I knew x86 well from demo scene coding, and I had the Linux and NetBSD sources to help, but the hardest bit was just getting all the boot sector stuff going properly and getting the processor into 386 mode as soon as possible.
I wrote an entire OS that booted into a windowed GUI, multi-threaded, file system support etc, etc and my goal was the whole thing booting happily to the desktop in 4Mb of RAM from a 1.44Mb 3.5" floppy, which it did. Every line was written from scratch in x86 assembler, because I was a masochist like that.
I called it Tinkerbell, for reasons lost to time, and it was hosted at tinkerbell.org back when I owned that domain. I just checked archive.org but sadly they didn't grab it when it was around.
EDIT: 32-bit OS book and the source are here:
It's basically "Writing an Operating System from Scratch for Dummies".
I actually wrote my own graphical x86 OS starting from the code in there.
Here's an examplehttp://www.amazon.com/Developing-32-Bit-Operating-System-Cd-...
It's a bit dated, but so is the x86 platform :) I think most of it is relevant, especially someone asking these sorts of questions about OS development.
Here's a link to the book on Amazon:
http://www.amazon.com/Developing-32-Bit-Operating-System-Cd-...
If you get somewhere be sure to update us on your progress!
I guess with the emulator it depends how much you want to do. You'd be foolish to write a console emulator and not import someone else's CPU code. When I wrote a Game Gear emulator 26 years ago I used off-the-shelf CPU code and just mapped all the in/out and did the graphics bits. Took me and a friend a single evening to get it happily playing games.
And OS is harder. Well, it was last time I wrote one, again about 26 or 27 years ago. Getting something to boot at all was tricky. I used this book as my main source of inspiration:
https://www.amazon.com/Developing-32-Bit-Operating-System-Cd...