Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional lfn/vfat at runtime #95

Open
dbalsom opened this issue Jul 17, 2024 · 2 comments
Open

Optional lfn/vfat at runtime #95

dbalsom opened this issue Jul 17, 2024 · 2 comments

Comments

@dbalsom
Copy link

dbalsom commented Jul 17, 2024

Hi! Thanks for the great crate - I've used it to implement mounting directories as disk images in my PC emulator, MartyPC: https://github.com/dbalsom/martypc

I think it would be useful to be able to control whether LFN/Vfat is enabled when writing. It looks like you can disable lfn via a feature flag, but that means you don't have it at all. Any chance this could be controlled at runtime so that I can, say, create IO.SYS and MSDOS.SYS as the first two directory entries to make a bootable diskette? If there is a vfat entry created before them, then the disk is not bootable using a DOS boot sector.

@rafalh
Copy link
Owner

rafalh commented Jul 29, 2024

Oh, that's interesting. To be more specific you are talking about MS-DOS boot sector? It only looks at first 2 entries in root directory and ignores the rest?
I guess there could be a runtime option, but I'm not sure how the API should look like. Having it as a filesystem option (FsOptions) feels wrong, because you may want to create other files with LFN. It would have to be a flag for Dir::create_file, but I wouldn't want everyone to pass true/false there... I wish Rust had defaults for parameters. Perhaps I should reproduce something like OpenOptions from std lib to allow extensibility.

@dbalsom
Copy link
Author

dbalsom commented Jul 29, 2024

Yes, an MS-DOS boot sector is hardcoded to require those two files as the first entries. For now I have disabled lfn and can create bootable floppies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants