Osdeving on Daddy's preciousss computer ?
keep in mind that there are PcEmulators too
- As long as you don't include code that performs disk writes, you're quite safe even on your main platform. Hard disk access should be delayed until you have a kernel stable enough that you can trust (e.g. it should not start writing at random places in memory, be protected against NULL pointers and things alike). The advantage of being in protected mode here is that even if you jump by hazard into the BIOS rom code or on an INT 13/21 instructions, the realmode BIOS will not be able to execute at all.
- Give your file system code a try on a ramdisk first. The ramdisk content could be constructed from scratch or generated from datas loaded by your bootloader (GRUB's module loading facility will be your friend here ;) Make sure you have the ability to check what has been written in the ramdisk without getting through the
- When developing a component that will perform disk accesses, make sure you test it on a PcEmulators first and that it behaves as expected. Enforce boundary checks in the disk functions so that you'll not getting out of a partition or things alike. You may even hardcode boundaries in your low-level driver and report a fatal condition if the upper component requires it to go out of the 'safe' array on the disk ...
Try to get a cheap Krash machine (ask Santa for one, a Pentium 1 with 500MB of disk is even enough ...), or at least a Krash disk and limit your accesses to that disk/machine. If you use a Krash disk on your main machine, make sure it will be on a different controller (e.g. different IDE cable) from your main disk, so that your code will access IO ports that couldn't harm your main disk.
Note: I intentionally did not explain how you can test without having to reboot or write to a boot floppy: this is a different problem, though there are similar solutions (use Bochs, etc)
