Quote:
Originally posted by xmdvp
ok
I had to do that at school last year.
First a little knowledge about the boot sequence on a PC:
On power up the BIOS looks for the first executable bootable device (floppy bootsector for example) and loads its contents into memory at the address 0:7C00 (512 bytes will be put out there) and then simply 'jumps' the processor to 0:7C00 and executes that code.
then, your code (at 0:7c00) is supposed to look for the rest of the code because 512 bytes is not enough for a whole OS :P
this part is in general called stage1.
that's where it starts getting interesting. the purpose of stage1 is to find stage2 on the floppy disk, load it in memory and then jump to it!
stage2 is a little bigger that stage1 and it purpose is to load the kernel somewhere in memory (before the 1MB mark obviously), disable interrupts, enable the A20 gate (= access to the rest of the memory), setup the GDT and IDT registry which is used by the protected mode and then jump into protected mode.
Then stage2 must move the kernel at the 1MB memory mark (just above the I/O area) an jump to it.
The kernel can be written in flat C++, but you'll have to write printf yourself and access the video card yourself. Also, you might need to program the keyboard and make a fgets() function.
because there will be no libraries available for you.
still intersted in writing an OS ?
i cannot imagine anything more exciting than what you described above (not that I dont understanf /have not heard it before)