We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,478 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

how to create asm boot sector

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
2
Contributors
1
Reply
1 Hour
Discussion Span
2 Years Ago
Last Updated
2
Views
emorjon2
Newbie Poster
23 posts since Sep 2010
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 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

sDJh
Posting Whiz in Training
260 posts since Aug 2005
Reputation Points: 56
Solved Threads: 30
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0542 seconds using 2.67MB