Giter VIP home page Giter VIP logo

Comments (10)

rofl0r avatar rofl0r commented on August 26, 2024 3
       throw CannotWriteException();

why would u use fukken C++ voluntarily

from adflib.

t-w avatar t-w commented on August 26, 2024 1

@mankeli, for the operation you wanted, try: adfOpenDev(), adfCreateFlop (), adfCloseDev() (as in examples/adf_floppy_format.c).
As for now, it is tested only for std. floppies, not for hard disks. So let know if you test such case.

For the NATIVE/REAL SYSTEM DEVICES, I repeat again: THE CODE IS NOT TESTED. If you want to try it, do it in a safe way (read comments about it in #31).

from adflib.

lclevy avatar lclevy commented on August 26, 2024

Rootblock is mandatory, so it should be an error eFct and not a warning wFct. Did you try to dump your physical device as image, then mount it using adflib?

from adflib.

mankeli avatar mankeli commented on August 26, 2024

But empty diskettes don't have a rootblock yet. I'm using adfCreateFlop() to initialize diskettes that may have whatever on them. I can work around this by writing a template filesystem on a disk before calling adfMountDev() but that's not really ideal.

Does adfMountDev() have to enforce that there's volumes on the disk? Would it be better suited that volumes are searched when adfMount() or adfDeviceInfo() is called?

from adflib.

lclevy avatar lclevy commented on August 26, 2024

First, what is your goal? Then, we'll see if API is able to answer it, or could be improved

from adflib.

kyz avatar kyz commented on August 26, 2024

It sounds like they would like to use ADFlib to format uninitialized media on a real device, i.e. not adfCreateDumpDevice() then adfCreateFlop(), but adfMountDev() then adfCreateFlop().

Imagine a DOpus program for some kind of CatWeasel device, using ADFlib. The user can format uninitialized floppy disks in their real floppy drive and can read/write files on them thereafter.

from adflib.

mankeli avatar mankeli commented on August 26, 2024

Sorry, forgot to reply! I'm just creating adf images within another image file. Using my own low-level functions, like

nFct->adfInitDevice = ercInitDevice ;
nFct->adfNativeReadSector = ercReadSector ;
nFct->adfNativeWriteSector = ercWriteSector ;
nFct->adfReleaseDevice = ercReleaseDevice ;
nFct->adfIsDevNative = ercIsDevNative;

I worked around this by just using empty pre-formatted adf image that I copy to the memory area before.
The ADFlib API kinda looks like you could just format your native disks with it, so imho it's a bit odd that the existing rootblock is required. :) The DOpus example @kyz came up with, is a good use case too. Same kind of template-writing would be necessary there too.

from adflib.

davidgiven avatar davidgiven commented on August 26, 2024

I have precisely the same problem --- I can't create the Device to pass in to adfCreateFlop without first having a filesystem on the floppy disk.

I eventually managed to make it work by faking up a Device like this:

        struct Device dev = {};
        dev.readOnly = false;
        dev.isNativeDev = true;
        dev.devType = DEVTYPE_FLOPDD;
        dev.cylinders = 80;
        dev.heads = 2;
        dev.sectors = 11;
        adfInitDevice(&dev, nullptr, false);
        int res = adfCreateFlop(&dev,
            (char*)"FluxEngine FFS", 0);
        if (res != RC_OK)
            throw CannotWriteException();

from adflib.

lclevy avatar lclevy commented on August 26, 2024

First, what is your goal? Then, we'll see if API is able to answer it, or could be improved

MountDev has been designed to mount an existing filesystem. If I remember well, CreateFlop only create a valid filesystem on a floppy disk, and not HDD

from adflib.

t-w avatar t-w commented on August 26, 2024

Possible to access empty devices since 0.8.0, improved in 0.9.0.

from adflib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.