Hi Bart!

> > > SYS, by the way, hardcodes BIOS drive number to 0x80 for FAT32 boot. Bad.
> > where does SYS do that? I can't find it: as far as I can see the boot
> > sectors use DL for FAT32 partitions.

Oops. Sorry. In SYS of FreeDOS 2034, the problem is now the other way round!

cont:           mov     ds, ax
                mov     ss, ax
                lea     sp, [bp-0x20]
                sti
                mov     [drive], dl     ; BIOS passes drive number in DL

(for the FAT32 boot sector)

This code will ALWAYS trust the DL value even if a broken boot menu fails
to set it. The code in a previous version on the other hand ALWAYS used
the value from the boot sector without looking at DL as far as I remember.
And the boot sector contains the value 0x80 in most cases.
Both the LBA and the CHS version of the FAT32 boot sector are affected.
I guess we are just VERY low on space so even the following FAT12/FAT16 boot
sector code might be too long:

; Some BIOS don't pass drive number in DL, so don't use it if [drive] is known
                cmp     byte [drive], 0xff ; impossible number written by SYS
                jne     dont_use_dl     ; was SYS drive: other than A or B?
                mov     [drive], dl     ; yes, rely on BIOS drive number in DL
dont_use_dl:                            ; no,  rely on [drive] written by SYS

And last but not least SYS should allow the user to select a [drive] value.
Sometimes programs are not happy with [drive] being 0xFF even though 0xFF
has the advantage of meaning "trust DL from BIOS/boot loader".

Eric.

PS: about the Arkady / Tom / Steve patch discussion problem. I agree that
there are too many kernel patches on freedos-{devel,kernel}, maybe the CVS
list could be used in some creative way instead. And I agree that Arkady
often prefers squeezing the last byte out over having readable code. Every-
body has his weaknesses :-). If you think you need a break from FreeDOS now,
then have fun and thanks for all the fish! I know you will eventually come
back and have a look, and DOSEMU is DOS as well.
Of course I would have preferred if you stayed, especially now that all
the spam / viruses scared away Lucho. For users of exepnsive dialup internet
todays virus / spam situation is really ugly. Even downloading all WinXP
patches regularily more or less requires fast internet.

[-> FreeDOS-devel -> FreeDOS-cvs -> kernel/kernel fattab.c,1.30,1.31 fatfs.c,1.66,1.67 
mail]



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Freedos-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to