Boot Sector Troubles

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
srg

Boot Sector Troubles

Post by srg »

[attachment deleted by admin]
srg

Re:Boot Sector Troubles

Post by srg »

How come, the same FAT12 boot sector code, with relevant BPBs won't work on the different floppy types?
Slasher

Re:Boot Sector Troubles

Post by Slasher »

check you 714kb floppy definition!!!!
you have Number of Heads set to 0x00ff :o
srg

Re:Boot Sector Troubles

Post 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 "
Schol-R-LEA

Re:Boot Sector Troubles

Post 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.
srg

Re:Boot Sector Troubles

Post 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.
srg

Re:Boot Sector Troubles

Post 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).
Schol-R-LEA

Re:Boot Sector Troubles

Post 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.
srg

Re:Boot Sector Troubles

Post 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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Boot Sector Troubles

Post by Pype.Clicker »

why exactly do you wish 1024-byte clusters ?
probably you have a mis-computation about it somewhere ...
srg

Re:Boot Sector Troubles

Post by srg »

DOS and Windows format a 720K disk with 1024 byte clusters, every reporting program I've seen shows this.
Slasher

Re:Boot Sector Troubles

Post 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
srg

Re:Boot Sector Troubles

Post 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,
Post Reply