I have been doing some study of boot sector programming as a part of my quest to write an operating system (for fun). The boot sector is what gets loaded and executed when the machine boots up, and thus I figured it would be a good place to start. The program contained in the boot sector can be no more than 512 bytes in size, so it poses a challenge to get every thing done in that amount of space. The following program, written in assembly language, will print the "Hello, World!" message on the screen and then halt. In order to use it, the file must be assembled to an 80x86 binary (not exe, elf, a-out, ...). I use the Netwide Assembler (NASM) which can be found on the web. This program must then be copied to the beginning of a DOS formatted disk (yes, it must be formatted, I will fix this soon). When then computer is booted from that drive, the message will be displayed. I cannot guarantee that this program will not destroy your computer, any part of it, or the world in which it exists. If any such thing happens I am in no way responsible and it is your problem to deal with. Although I have no reason to believe this program should have any nasty side effects, I have only tested it on a Compaq 286. Have fun with this thing. At least read the code. You could learn something.
The boot sector code: boot.asm
Another great resource is JeffOS. Unfortunately it would seem that Jeff has closed his website relating to that project. You can download my copy of Jeff's source code here. The file is JeffOS.tgz. The format is a gzipped tar file and can be opened on any system supporting these formats. UNIX systems always support this and I think WinZip will help those of you suffering from Windows. Jeff Thompson's home page was at http://www.advancenet.net/~jwthomp/ but it seems to have left. If there is any problem with me providing this code which is not mine or the above link, please contact me and I will remove them.
Back to my computer resources!
Back to my home page!