flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Nop at start of bootloader

Author
Thread Post new topic Reply to topic
Qu4Z



Joined: 11 Feb 2007
Posts: 2
Qu4Z 11 Feb 2007, 10:31
Hi!
I'm reasonably new to this forum, so forgive me if I didn't read any forum rules that weren't jumping in my face.
I've been coding a floppy bootloader in FASM (cliche' I know, but what'm I going to do?), and upon looking through some examples on this forum i noticed that most seem to start with
Code:
jmp start
nop
start: 
;bladibla
    

I read somewhere that FASM required it, and my bootloader seems to boot fine, even without it. Is this perhaps something to do with FAT12 that doesn't affect me 'cause I'm using unformatted floppies?
Or it a hardware compatibility thing (to be compatible with some types of hardware).
As I said, my computer seems to boot it fine, as does bochs, so I'm a little confused as to why it's there.

Regards,
Qu4Z
Post 11 Feb 2007, 10:31
View user's profile Send private message MSN Messenger Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 11 Feb 2007, 14:23
Qu4Z wrote:
Hi!
I'm reasonably new to this forum, so forgive me if I didn't read any forum rules that weren't jumping in my face.
I've been coding a floppy bootloader in FASM (cliche' I know, but what'm I going to do?), and upon looking through some examples on this forum i noticed that most seem to start with
Code:
jmp start
nop
start: 
;bladibla
    

I read somewhere that FASM required it, and my bootloader seems to boot fine, even without it. Is this perhaps something to do with FAT12 that doesn't affect me 'cause I'm using unformatted floppies?
Or it a hardware compatibility thing (to be compatible with some types of hardware).
As I said, my computer seems to boot it fine, as does bochs, so I'm a little confused as to why it's there.

Regards,
Qu4Z

that is because after the 3 first bytes is found the parameters table and the
'jmp' sometimes is just 2 bytes some people add a 'nop' or use a 'jmp word' wich is 3 bytes in size if your boot code do not have a parameter (not a fat system) table you do not neet this jmp at all.
Post 11 Feb 2007, 14:23
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 14 Feb 2007, 13:25
Isn't FAT something like this:

Code:
jmp start
nop

; data here (format header whatever)
db ...

start:
; code here    

But why doesn't it put at the end? it would be much simpler, and without the jump. So if you don't use FAT and need some data, try it at the end Wink
Post 14 Feb 2007, 13:25
View user's profile Send private message Reply with quote
Qu4Z



Joined: 11 Feb 2007
Posts: 2
Qu4Z 23 Feb 2007, 21:44
Thanks Wink
Post 23 Feb 2007, 21:44
View user's profile Send private message MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.