Page 3 of 3
Re: Unable to get FAT16 boot loader working
Posted: Sun Aug 16, 2015 2:24 pm
by SpyderTL
vbguyny wrote:@Octocontrabass: Unbelievable! What is the point of the BPB if it can't be trusted?! Thanks for the info.
Because at one point in history, it was your only option. The BIOS method was added later.
Re: Unable to get FAT16 boot loader working
Posted: Sun Aug 16, 2015 2:26 pm
by Octocontrabass
vbguyny wrote:What is the point of the BPB if it can't be trusted?!
Most values in the BPB are filesystem parameters, and can be trusted because the filesystem will be unreadable if they are wrong.
Very early BIOSes don't support INT 13h AH=08h for floppy disks. The disk geometry was probably put in the BPB so DOS could use the same bootloader on different types of floppy disks while still supporting such old BIOSes.
All PCs with a 386 or better will support INT 13h AH=08h, so the only reason to use the values in the BPB is if your floppy disk bootloader needs to support older machines. Fortunately, most formatting utilities automatically detect standard floppy disk sizes and fill in the expected values.
Re: Unable to get FAT16 boot loader working
Posted: Sun Aug 16, 2015 6:18 pm
by vbguyny
Thanks guys for the history lesson. Good stuff!
Re: Unable to get FAT16 boot loader working
Posted: Sun Aug 16, 2015 6:50 pm
by BASICFreak
vbguyny wrote:Thanks guys for the history lesson. Good stuff!
If you like history lessons, I found this an interesting (though outdated) read.
BIOS Enhanced Disk Drive Specification Version 1.1, May 9, 1995
Phoenix Technologies Ltd.
http://www-pc.uni-regensburg.de/hardwar ... EDD_11.PDF
It does explain why BPB values may vary, plus a lot of other mostly useless (though some very helpful) information.
Re: Unable to get FAT16 boot loader working
Posted: Sun Aug 16, 2015 10:35 pm
by BASICFreak
vbguyny wrote:I would be interested in trying your boot loader. I already have a stage two loader
If your still interested I have just finished up the "BETA"
Set to load OSLOADER.SYS to 0BE0:0000 - but it's easily changeable (if you know anything about ASM)
Attached...
NOTE: This was only tested ONCE (under Bochs) before I posted it, and it is probably not error free, It just does what I wanted
ALSO NOTE: I push a lot of information to the stack before stage two, you can remove them unless you choose to conform to my strange ways
Re: Unable to get FAT16 boot loader working
Posted: Mon Aug 31, 2015 3:36 pm
by vbguyny
@BASICFreak: I couldn't figure out how to use your loader. I tried to look at your code but wasn't largely wasn't commented. Thanks for the code however.
As I mentioned in my previous post I was able to get my FAT16 boot loader working. I just recently discovered a bug in my routines that I used to "walk the FAT" and that is it only supported up to 255 logical clusters
I had to manually patch it to support the maximum 65535 clusters that FAT16 supports.
Re: Unable to get FAT16 boot loader working
Posted: Mon Aug 31, 2015 4:59 pm
by BASICFreak
vbguyny wrote:@BASICFreak: I couldn't figure out how to use your loader. I tried to look at your code but wasn't largely wasn't commented. Thanks for the code however.
Yea, I only commented function IN/OUTs and the parts that gave me trouble... (mostly the bit-shift math)
I didn't want to spend more time on it than I had to, and I'm pretty sure that I can only access a few clusters as space is tight and 32 bit math in 16 bit code takes 2 extra bytes per instruction.
My OSLoader has an extended fat16 driver which adds support for the whole FS instead of just the root dir and the first (I guess 256 safely) FAT Entries. (but at the cost of space - my OSLOADER.SYS is 3KB and just the full fat driver is about 800Bytes)
Also as I said This code is not fully tested, I still haven't placed it on HW (as I need the some sort of UI to be able to transfer new items - for lack of better term - into the system) and this is still a rough draft.
And, yes, I did see you had yours working that's why I said "If your still interested".