Home | x86 Assembly | <<< Previous | Next >>> |
As you know, computers needs to be booted up
using a BOOTABLE DISK. A typical computer disk is divided into portions
known as tracks
and sectors. It so happens that when the computer starts up, it reads
the first sector of the disk into memory, and executes it. This first sector
is known as a boot-sector. A boot-sector can be written in assembly language.
Here is how: |
|
.model tiny .code entry: ; we enter the program jmp start ; required jump statement nop ; nop required to follow the jmp start: ;Add anything--put your code here org 510 dw 0aa55h ; ; add signature of BOOT SECTOR end entry |
If you compile this in
MASM, you'd get a 512 bytes long file.
You can write this file to the first sector of the disk using some utilities like John Fine's Partcopy. Then you can boot the computer using the disk Remember, this is a Rough Guide! |
You can easily add the 'Hello World' program given before to this boot-sector. You'd now have a boot-disk that says 'hello world' when it starts up! You might need more info to do other neat little things. For more on what the memory looks like, click here |
Home | x86 Assembly | <<< Previous | Next >>> |