Re: [Freedos-kernel] CF and HOT SWAP

2004-11-16 Thread Arkady V.Belousov
Hi!

16-Ноя-2004 11:13 [EMAIL PROTECTED] (Fab) wrote to
<[EMAIL PROTECTED]>:

F> I'm trying to use a compact flash under FreeDos as removable media.
F> The problem is that the compact flash *must* be present into the card reader
F> (interfaced onto the IDE bus) otherwise the BIOS POST do not recognize the
F> drive as hard disk and do not allow disk I/O functions to access to the card.

 Yes. Unfortunately, BIOS was not designed with supporting hot swap in
mind. Same to DOS: for "local" drives (for which not used external drivers
through "network interface") recognizing performed only at DOS startup and
can't be forced later.

F> I'm trying to do something that allow me to plug the card or change it at any
F> time. I tried to force the BIOS to recognize the card ...

 You can't - there is no such API.

F> I tried to tell to BIOS wich type of fixed disk (...) is connected modifing
F> the table pointer from INT46h (slave on first IDE channel)...

 Dangerous.

F> Finally, I tryed to read a sector using a direct function that read data
F> writing directly to the IDE controller and it run !!!

 Of course, because now you perform recognizing itself.

F> I found a function from TR-DOS that have the same parameters of the standard
F> INT13h function and it run well.
F> The problem is that we don't know the type of card inserted into the card
F> reader.
F> I will try to read the first sector and the boot sector where some
F> information are available but the problem will be that I must use this
F> function every time I need to get data from the compact flash

 Yes. For floppy drives, you have "change line" hardware and service,
which allows to detect, when media was changed. For other swapping devices
without such hardware detection, you should perform "manual" media detection
and probing, for example, "serial number" from boot record is enoughly
portable and safe method.

F> this means that I must write code to handle *all* !!! FAT, DIR, files.

 No, this ("you should internally detect, when media is changed") _not_
mean, that you should also reimplement high-level file system(s) structures
(especially because there may be unknown for you, new file systems).

F> etc etc etc both in read and write !!!
F> Does anyone have an idea how to inform the BIOS about the drive parameters
F> ??

 You can't [reinform BIOS about current media parameters]. :( At least,
I don't know official, portable, safe method to do this.

F> May this function is useful for other one the me ?
F> May be that this idea will be useful and available directly from FreeDOS
F> kernel or from a installable device driver ?




---
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


[Freedos-kernel] CF and HOT SWAP

2004-11-16 Thread Fab



Hi guys.
 
I'm trying to use a compact flash under FreeDos as 
removable media.
 
The problem is that the compact flash *must* be 
present into the card reader (interfaced onto the IDE bus) otherwise the BIOS 
POST do not recognize the drive as hard disk and do not allow disk I/O functions 
to access to the card.
I'm trying to do something that allow me to plug 
the card or change it at any time.
I tried to force the BIOS to recognize the card 
...
I tried to tell to BIOS wich type of fixed disk 
(...) is connected modifing the table pointer from INT46h (slave on first IDE 
channel)...
Finally, I tryed to read a sector using a direct 
function that read data writing directly to the IDE controller and it run 
!!!
I found a function from TR-DOS that have the same 
parameters of the standard INT13h function and it run well.
The problem is that we don't know the type of card 
inserted into the card reader.
I will try to read the first sector and the 
boot sector where some information are available but the problem will 
be that I must use this function every time I need to get data from the compact 
flash this means that I must write code to handle *all* !!! FAT, DIR, 
files. etc etc etc both in read and write !!!
 
Does anyone have an idea how to inform the BIOS 
about the drive parameters ??
 
May this function is useful for other one the me 
?
 
May be that this idea will be useful and available 
directly from FreeDOS kernel or from a installable device driver ?
 
Fab, [EMAIL PROTECTED]
___
Adjust my address removing .italy and adding .it 
to write me directly