Talk about the operating system theory of books a lot, after reading feel is so, but always feel less what, less is the hands. Want to do, but do not know where to start, is the general confusion for beginners, in order to solve this confusion, but also to record their own learning process, wrote the "With me to write the operating system" this series. The main reference is "an operating system implementation."
10 minutes to write an operating system
I. Development environment.
We compile images under Linux and so on, so we need a Linux development environment. If you're using Windows, install VMware under Windows, install Ubuntu virtual machines in VMware, and use Ubuntu as the development environment.
Note: My development environment is windows--vmware--ubuntu.
Two. Make a floppy boot image under Ubuntu.
1 First make an empty floppy image file Diska.img (1.44Mb floppy image file):
DD If=/dev/zero of=diska.img bs=512 count=2880
2 Make an image file containing Boot.bin boot.img:
DD If=boot.bin of=boot.img bs=512 count=1
3 Copy the data behind the 1 sectors in the diska.img to the back of the boot.img
DD if=diska.img of=boot.img skip=1 seek=1 bs=512 count=2879
This makes it a 1.44Mb image file containing the bootstrap code.
Write with me. Operating system (a)---good start is half the success