Page 1 of 1
Boot Sector Troubles
Posted: Sun Sep 22, 2002 9:25 am
by srg
[attachment deleted by admin]
Re:Boot Sector Troubles
Posted: Sun Sep 22, 2002 2:50 pm
by srg
How come, the same FAT12 boot sector code, with relevant BPBs won't work on the different floppy types?
Re:Boot Sector Troubles
Posted: Sun Sep 22, 2002 3:10 pm
by Slasher
check you 714kb floppy definition!!!!
you have Number of Heads set to 0x00ff
Re:Boot Sector Troubles
Posted: Sun Sep 22, 2002 3:35 pm
by srg
Applologies
Here we are, 720K BPB
OEMID db "SG-OS0.1"
BytesPerSector dw $0200
SectorsPerCluster db $02
ReservedSectors dw $0001
NumberOfFATs db $02
RootEntries dw $0070
SmallSectors dw $05a0
MediaDescripter db $0f9
SectorsPerFAT dw $0003
SectorsPerTrack dw $0009
NumberofHeads dw $0002
HiddenSectors dd $00000000
LargeSectors dd $00000000
PhysicalDriveNo db $00
Reserved db $00
ExtBootSig db $29
SerialNumber dd $0a88b3652
VolumeLabel db "NO NAME "
FileSystemType db "FAT12 "
Re:Boot Sector Troubles
Posted: Sun Sep 22, 2002 11:45 pm
by Schol-R-LEA
srg wrote:
How come, the same FAT12 boot sector code, with relevant BPBs won't work on the different floppy types?
Because some of the values (imost notably
SectorsPerTrack and
MediaDescriptor) will be different for different types of disk.
Re:Boot Sector Troubles
Posted: Mon Sep 23, 2002 12:51 am
by srg
Schol-R-LEA wrote:
Because some of the values will be different for different types of disk.
I do realise this and the boot sector above is for a 720K disk, but it's not working even with the right BPB values for that disk, why should this be. Windows can read the disk fine with my boot sector in place, but the BS code hangs for some reason.
Re:Boot Sector Troubles
Posted: Mon Sep 23, 2002 1:47 am
by srg
Hmm this is interesting, I tried a small piece of asm written code and it just worked perfectly. Just my second sage loader that doesn't
Why would my second stage loader run fine on a 1.44MB Disk and not on a 720K disk (which has no errors).
Re:Boot Sector Troubles
Posted: Mon Sep 23, 2002 8:01 am
by Schol-R-LEA
srg wrote:
I do realise this and the boot sector above is for a 720K disk, but it's not working even with the right BPB values for that disk, why should this be. Windows can read the disk fine with my boot sector in place, but the BS code hangs for some reason.
This is what comes of me posting without reading the whole thread more carefully. My apologies.
Re:Boot Sector Troubles
Posted: Tue Sep 24, 2002 8:12 am
by srg
hmm
It seems that it is the boot sector code, as when I change the SectorsPerClustor field of the BPB to 1 (like on a 1.44MB floppy) it works fine, although the disk os now only 511KB.
Putting it back to 2 and the old problem comes back again.
Re:Boot Sector Troubles
Posted: Tue Sep 24, 2002 9:52 am
by Pype.Clicker
why exactly do you wish 1024-byte clusters ?
probably you have a mis-computation about it somewhere ...
Re:Boot Sector Troubles
Posted: Tue Sep 24, 2002 10:36 am
by srg
DOS and Windows format a 720K disk with 1024 byte clusters, every reporting program I've seen shows this.
Re:Boot Sector Troubles
Posted: Tue Sep 24, 2002 1:40 pm
by Slasher
i think they do this so that a 1.44mb disk with 512 bytes per sector will become a 714kb disk.
but if you are working with your own code then i suggest
using 512 bytes and use a lower sector per track setting and number of tracks
ie in 1.44mb we have 18 sectors per track with 512 bytes per sector and 80 tracks( i think no docs around to check number of tracks in a 1.44mb) but you should get my general idea! ;D
Re:Boot Sector Troubles
Posted: Tue Sep 24, 2002 3:30 pm
by srg
Code Slasher wrote:
but if you are working with your own code
I would also like these disks to work perfectly with Windows and MS-DOS.
On second though no, what is the point of bootsector code that can only handle a cluster size of 512KB, it would be useless with hard disks,