[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Block devices



W dniu 24.08.2011 14:10, Vincent Rivière pisze:
m0n0 wrote:
I think so, maybe these link can help you?

http://sparemint.atariforge.net/cgi-bin/cvsweb/freemint/doc/programmer/block_IO.txt?rev=1.1.2.1&content-type=text/x-cvsweb-markup


http://sparemint.atariforge.net/cgi-bin/cvsweb/freemint/doc/block_IO.txt

Thanks, that doc is useful to understand cache issues.

I know that there is /dev/fd0, - and I believe it is what you call a
block device.

Where is it ? I can't see it.
We are speaking of the floppy drive A:, right ?

But I think it's an completly different story with hard-disks, as you
know, the driver for harddisk is loaded before FreeMiNT kernel. And
filesystem drivers directly create devices like U:/f - for example, and
I'm not sure if they can be called block devices, because the data
transfer ( of blocks) is done by lower layers.

We don't care if the block device is internally handled by TOS drivers
or FreeMiNT stuff.

 From the user view, a disk block device like /dev/sda is just like a
standard file, it can be viewed, edited, copied, etc. And standard Linux
tools like fdisk can use it to create partitions inside it.

Then partition block devices such as /dev/sda1 are similar, but for each
partition inside a disk. They can be viewed, copied, etc, and formated
using standard tools such as mkfatfs, etc.

I didn't check carefully, but it seems that any Linux block device tool
(mkfatfs, df...) must be specifically patched for FreeMiNT, that's a
real pain.

I was talking to FNA about block devices back in 2003 iirc. There are block devices, but there is no block device API, so all /dev/* are just ordinary character devices (and yo really do not want to treat them as such if you want speed). You need some IOCTLs for that.

There is also no internal kernel API for registering/handling block devices. If we had this, creating Falon/Aranym IDE driver is very simple (or any IDE driver that only handles PIO modes (not counting IDE-ATAPI, that turned out to be another story ;))). I think we could also steal some floppy code from EmuTOS, and the only serious work is SCSI (which is told to be hard, esp. for Falcon).

As I'm currently in a process of 'getting back' to FreeMiNT developement, I'll try to help, but I really have no experience in drawing good apis. In the past I just written (incomlete) Falcon IDE driver and adapted some EmuTOS floppy code into FreeMiNT (i think it even works if you do not need writing ;)). IIRC floppy code was revised in EmuTOS after I adapted it, so doing a complete rework here could be a good thing.

Having all that could remove another 'external' subsystem. I'd really like FreeMiNT to be a 'complete' OS.

AdamK