flat assembler
Message board for the users of flat assembler.

Index > OS Construction > i need some help for writing a fat32 bootloader

Author
Thread Post new topic Reply to topic
craciun



Joined: 11 Apr 2006
Posts: 7
craciun 18 Oct 2006, 17:59
hi, i've wrote a bootloader code for fat32 file system, and there is something strange in binary format after compiling.

this is code:
;<<<<<<<<<<start>>>>>>>>>>>>
jmp start_code
nop

oemname db 'MSWIN4.1'
bytespersector dw 512
sectorspercluster db 8
ressectors dw 38
numcopiesfat db 2
maxallocrootdir dw 0
maxsectors dw 0
mediadescriptor db 0f8h
sectorsperfat dw 0
sectorspertrack dw 63
heads dw 64
hiddensectors dd 63
bigsectors dd 3173121
bigsectperfat dd 3093
fatflags dw 0
version dw 0
firstclustofroot dd 2
fsinfosector dw 1
backupbootsect dw 6
reserved dd 0,0,0
driveid db 80h
rezervat_nt db 0
bootsignature db 029h
volumeid dd 56291043h
volumelabel db 'ChristmasOS'
filesystemtype db 'FAT32 '

start_code:
; here is the rest of code

I know that the first 3 bytes in a fat32 boot loader should be EB 5A 90
but i had seen on some partitions that byte 5A is 58. Wich is the correct one? I also want some code for reading and/or loading a file from a fat32 partition.
Post 18 Oct 2006, 17:59
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 18 Oct 2006, 18:16
use [code] tags around your code
Post 18 Oct 2006, 18:16
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 18 Oct 2006, 18:36
Just use
Code:
        jmp             start        nop    

You will find bootloader code for fat12, fat16, fat32 written ASM, C, brainf**k .
Also available in red, green, and blue.
Also nice load file from fat32 in asm you can copy, i mean look at.
http://home.no.net/tkos/info/fat.html

PS: Remember google is your friend.
Post 18 Oct 2006, 18:36
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.