News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Bootstrapping from FAT formatted floppy disk?

Started by Benedikt, Yesterday at 19:57

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Benedikt

Imagine the following scenario:

  • A 3.5" drive is connected as drive B
  • The disk in it has a FAT file system
  • It already contains binaries for some other platform(s), e.g. MS-DOS, MSX-DOS, Enterprise 128, Atari ST
  • We want an additional binary for CPCs

Is there any somewhat convenient way to load and run anything from that disk from Basic?
E.g. a few lines to load a "CPCDOS.SYS" from a known, continuous sequence of sectors?

Thank you in advance!


andycadley

Assuming you have a DOS capable of reading from FAT, you could just store some CPC binary on there. There's nothing in the FAT filesystem for reserving special sectors for a given machine though.

Benedikt

And is there any way to just read a specific sector in a file system agnostic way using Basic and to run it as machine code?
Putting a write-protected system file in a known sequence of sectors is solved problem.

The question is about bootstrapping, i.e a DOS with the relevant capabilities is not already running.

Prodatron

There is

BPB_RsvdSecCnt

"Number of reserved sectors in the Reserved region of the volume
starting at the first sector of the volume. This field must not be 0.
For FAT12 and FAT16 volumes, this value should never be
anything other than 1. For FAT32 volumes, this value is typically
32."

So as all discs are FAT12, there is no chance for having additional reserved sectors at fixed LBAs beside the boot sector.
But you can always reserve clusters on a FAT device using the FAT itself without assigning them to a file (a PC then may want to repair the disc :) ). If you have always the same disc size, this could be done at fixed LBAs (tracks/sectors).

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

andycadley

Quote from: Benedikt on Yesterday at 20:22And is there any way to just read a specific sector in a file system agnostic way using Basic and to run it as machine code?
Putting a write-protected system file in a known sequence of sectors is solved problem.

The question is about bootstrapping, i.e a DOS with the relevant capabilities is not already running.
The only way from BASIC is |CPM which loads track 0, side 0 sector &41. It will only load 512 bytes though (whatever is booted is then expected to load the rest). 

Powered by SMFPacks Menu Editor Mod