So the options are:
1) current
- use 0xFF in BPB.drive to indicate to boot code to use BIOS provided
drive in DL, otherwise use value in BPB.drive
- the boot sector code can be anywhere and is similar to:
cmp [BPB.drive], 0xFF
jmp dont_use_bios
mov [BPB.drive], dl
dont_use_bios:
- sys defaults to setting BPB.drive to 0 for floppy (A: or B:) and
0xFF for any other drive, but using /B # option you can have it
set any arbitrary value you want Pros: the detection code is in the boot sector, default behavior
handles whatever BIOS drive booted from even if changed
since SYS was performed and no fixed position code.
No position specific code to keep in sync with sys.
[This also works with both our FD bootsector and the OEM one.]
Cons: if one needs compatibility with other boot sectors or
has a buggy value passed to the boot sector, one must
explicitly provide the drive value to use (via sys /B #
or with a disk editor)2) Alternate
- use 0 or 80 only in the boot sector (or really any value the
user wants, but default to 0 or 80)
- the boot sector code has at a fixed location
useBIOSorNotFixedLocation:
mov [drive], dl
- SYS is then responsible for determining if BIOS provided value
is used or not by patching useBIOSorNotFixedLocation with NOPs
if BPB.drive is to be used or not touching it to use provided value
e.g. SYS C: /USEBPBDRIVE sets BPB.drive to 0x80 and NOPs
out the mov [drive], dl code, but SYS C: /B 81 only sets the
BPB.drive to 0x81 still using the provided boot drive not the
value in BPB.drive (so the 0x81 is for other programs).
A value of 0xFF will no longer be a magic value. Pros: seems most compatible as our boot sector will have 0 or 80
most of the time, user can still specify arbitrary value
Cons: another position specific chunk of code in the boot code
for sys to keep up with. Needs another option or to change
the option to indicate both value in the BPB and whether to
patch out the use of the provided value or not.(In case your curious, we only need to set [BPB.drive] once as later we reload and use the value in [BPB.drive], which if not overwritten by DL will be the value put in the BPB by sys.)
Although I dislike the idea of patching the bootsector, choice 2 does seem most compatible and is slightly smaller boot code (as the logic is moved to sys). Please indicate which choice you prefer, or if you feel the alternate should be done a simpler method, please specify.
Thanks, Jeremy
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel
