loading files in real mode

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
anon

loading files in real mode

Post by anon »

If i have a boot-sector that supports the fat file system
can i use an interrupt that will just execute the code in the file ?
I want to load a file which will get into protected mode
Schol-R-LEA

RE:loading files in real mode

Post by Schol-R-LEA »

>On 2002-05-14 00:44:36, anon wrote:
>If i have a boot-sector that supports the fat file system
>can i use an interrupt that will just execute the code in the file ?

Not of itself, no.

While the BIOS has routines for low-level disk
handling, it only deals with the raw disk -
reading and writing a given sector. It has no
support for the file system; that exists in the
MSDOS.SYS file of MS-DOS, or in the equivalent
file system drivers for the OS in question. In
the case of MS-DOS, it adds several interrupts
to the interrupt table, including the disk
interrupts you are probably familiar with.

The confusion seems to be in the idea of
'supporting' the FAT file system. A disk does not
itself support FAT; rather, it is fomratted as
FAT, with the appropriate FIB header, FAT tables,
sector formatting, etc. This is only meaningful,
however, in the context of an OS that can read
and manipulate FAT tables and files. The BIOS
itself won't support it; it has to be part of the
system loaded at boot (or later).

In order to support FAT12 (assuming you are
working with floppies), you would need to code
your own FAT file system, or at least a subset
thereof sufficient to read the FAT table, locate
the file you need, and load it into memory.
Information on implementing FAT can be found in
various older messages in this forum.

Whether these routines would be accessed by
interrupts would be your own decision. :-)

Keep in mind also that, if you intend to use
FAT[12|16|32] formatted disks in your p-mode
kernel, you will need to write the file system
code for those, as well.
Post Reply