1,105,450 Community Members

how to create asm boot sector

Member Avatar
emorjon2
Light Poster
28 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

hello anyones!

I'm trying to create a boot sector using assember. I have compile it into a bin file
and put it into the memory stick. when I'm start the computer and press f12 and shoose
my memory stick, it may write hello world on screen, but nothing happend! X(
how can I place the file in memory stick so that code is the first thing the computer will see when booting memo stick. my plan is to make my own OS, but first I'm must set
the boot sector in right place, and I don't know how to do this. and if I put the bin file first, will that make problems when run memo stick in windows??? :S

here is the code

ORG 0x7c00
    mov ah, 0eh
    xor bl, bl
    mov al, 'h'
    int 10h
    mov al, 'e'
    int 10h
    mov al, 'l'
    int 10h
    mov al, 'l'
    int 10h
    mov al, 'o'
    int 10h
    mov al, ' '
    int 10h
    mov al, 'w'
    int 10h
    mov al, 'o'
    int 10h
    mov al, 'r'
    int 10h
    mov al, 'l'
    int 10h
    mov al, 'd'
p:
    jmp p
times 512 - ($ - $$) db 0
Member Avatar
sDJh
Posting Whiz in Training
268 posts since Aug 2005
Reputation Points: 39 [?]
Q&As Helped to Solve: 32 [?]
Skill Endorsements: 0 [?]
 
0
 

you need the MBR signature. Make your fill-up 2 Bytes shorter and put an 0xAA55 at the end of the file. Have a look here: http://en.wikipedia.org/wiki/Master_boot_record

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: