Yes, OS development is hard. It is probably the most difficult area of programming there is (along with game development and compiler development). I've tried it, and though it's fun and you learn alot, it is incredibly hard. I welcome you to try it, though; go through a tutorial or two, read some articles on the OSDev Wiki (which helios posted a link to), read the documentation for your chosen architecture (e.g., x86, x86_64, SPARC, etc.). I recommend x86 as most people on OSDev.org write their OS for x86 and it has easily the most documentation available. x86_64 is a little more complicated since you have to have an intermediate step between the bootloader and the kernel proper to switch the CPU to long (64-bit) mode (the computer starts in real (16-bit) mode, the bootloader should put you in protected (32-bit) mode, and then your intermediate code will switch to long mode so that your kernel can boot).
Advice:
- RTFM
- Learn the assembly language of your target architecture and learn it
well. This is very, very important and lots of people try to skip this step
- Use this as a reference for interrupts (x86 only):
http://www.ctyme.com/rbrown.htm
- Be prepared to write the same code over and over again until its perfect
- Be prepared for random, inexplicable bugs that seem to just appear, and then you realise there were some serious bugs in your string library implementation (did I mention that you have to implement every function you want to use by yourself? Because you have to implement every function you want to use by yourself)
- Linux seems to be more convenient, although me saying that is quite likely down to my own prejudice
- Follow the cross-compiler tutorial on OSDev wiki and build a gcc cross-compiler, it makes everything easier if you're on Windows (I'm not sure if you need to do it on Linux; I never bothered but it might be a good idea to do it anyway. The reason you need to do it on Windows is because otherwise you cannot create ELF executables, only Windows PE which is not supported by GRUB or other bootloaders*)
- Install Qemu and GDB; you can use GDB to debug your kernel while it's running under Qemu
- Don't code while sleep deprived, this leads to mistakes like this:
http://forum.osdev.org/viewtopic.php?f=1&t=21947
- Set up a decent build system - learn to write your own Makefiles, ld (linker) scripts, other scripts that might be useful (I used numerous Bash and Perl scripts for generating test floppies, initial ramdisks, etc.)
- Get rid of bugs _early_. Check all your code for possible bugs. I cannot stress how annoying it is when you compile your kernel and find out that somewhere there is a bug (or several), but you don't know where and it's incredibly hard to find out (the only way (GDB can't do this when running with Qemu) is to remove sections of source code and try compiling without them, but removing parts of the kernel without modifying other parts is nearly impossible unless you design your kernel with that in mind)
* Unless you write your own, but then you have to write a PE loader. In assembly. With a maximum program size of 512 bytes (unless you use multiple stages, but then things get super complicated, super fast, because you have to deal with BIOS functions, BIOS incompatibility (seriously, BIOS is fucked up), stupid reasons why floppy disks randomly don't work, and a whole host of other problems that you have to predict and work around).
In short, writing an OS is really, really, really hard, and may well drive you insane. On the other hand, when things work it is incredibly rewarding.