flat assembler
Message board for the users of flat assembler.

Index > OS Construction > A question on the size of boot loaders

Author
Thread Post new topic Reply to topic
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 12 Dec 2009, 00:46
I know they have to be 512b in size and end with 55aah. But I was wondering if it's okay for the actual code for the boot loader to meet those requirements but be put at the start of the whole program. ex.
Code:
;boot code
rb 510 + $$ - $
db 055h, 0aah
;This would be loaded by boot code
    

The reason I want to know is, because I don't know how to write/copy a file to a specific location i.e. the boot sector.
EDIT: Grammar and diction
Post 12 Dec 2009, 00:46
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 12 Dec 2009, 01:22
yep, to access disk, first, try INT13h. fnction 2 to read, 3 to write.
do it sector by sectors.

and then, load the sector where you want.
to call it, use a fr pointer.
set the segment to have the good offset.

in Real mode :
segment * 16 + offset = linear.
Post 12 Dec 2009, 01:22
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 12 Dec 2009, 05:35
I like to keep booter sperate so once its done, its done.
You can write it to disk and forget about it.
If you do it your way you will be writing the disk a lot more than needed.
You can use PARTCOPY or RAWWRITE or even DEBUG to do the writing.
Just be careful with these programs as they will do what you say
even if what you say is not entirely correct.
Also BOOTPROG is a nice FAT12 bootloader, you may want to get it.
Post 12 Dec 2009, 05:35
View user's profile Send private message 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.