diff --git a/repos/libports/src/lib/vfs/fatfs/README b/repos/libports/src/lib/vfs/fatfs/README index 43ffbfa9ab..bb56f1b9f0 100644 --- a/repos/libports/src/lib/vfs/fatfs/README +++ b/repos/libports/src/lib/vfs/fatfs/README @@ -3,40 +3,7 @@ This plugin provides resource-optimized FAT and exFAT support to the VFS library Usage ~~~~~ -The plugin takes two configuration options as XML attributes, 'codepage' and 'drive'. -A codepage number is required only for non-ASCII filename support. The 'drive' option -takes an integer value between 1 and 10 and is simply a symbolic identifier passed -thru the Block session request. In this manner multiple drives are supported. - -Codepages -~~~~~~~~~ - -Support for non-ACII filenames is experimental and only one codepage -may be in use for any number of drives. - -Supported codepages --------------------------------- -437 | U.S. -720 | Arabic -737 | Greek -771 | KBL -775 | Baltic -850 | Latin 1 -852 | Latin 2 -855 | Cyrillic -857 | Turkish -860 | Portuguese -861 | Icelandic -862 | Hebrew -863 | Canadian French -864 | Arabic -865 | Nordic -866 | Russian -869 | Greek 2 -932 | Japanese (DBCS) -936 | Simplified Chinese (DBCS) -949 | Korean (DBCS) -950 | Traditional Chinese (DBCS) +The plugin takes no configuration options. Caching ~~~~~~~~ diff --git a/repos/libports/src/lib/vfs/fatfs/vfs_fatfs.cc b/repos/libports/src/lib/vfs/fatfs/vfs_fatfs.cc index f507732d54..95033f984e 100644 --- a/repos/libports/src/lib/vfs/fatfs/vfs_fatfs.cc +++ b/repos/libports/src/lib/vfs/fatfs/vfs_fatfs.cc @@ -312,38 +312,13 @@ class Fatfs::File_system : public Vfs::File_system : _vfs_env(env) { { - static unsigned codepage = 0; - unsigned const cp = config.attribute_value( - "codepage", 0); - - if (codepage != 0 && codepage != cp) { - Genode::error( - "cannot reinitialize codepage for FAT library, please " - "use additional VFS instances for additional codepages"); - throw ~0; - } - - if (f_setcp(cp) != FR_OK) { - Genode::error("invalid OEM code page '", cp, "'"); + if (f_setcp(0) != FR_OK) { + Genode::error("failed to set codepage to 0"); throw FR_INVALID_PARAMETER; } - codepage = cp; } - - auto const drive_num = config.attribute_value( - "drive", Genode::String<4>("0")); - -#if _USE_MKFS == 1 - if (config.attribute_value("format", false)) { - Genode::log("formatting drive ", drive_num, "..."); - if (f_mkfs((const TCHAR*)drive_num.string(), 1, 0) != FR_OK) { - Genode::error("format of drive ", drive_num, " failed"); - throw ~0; - } - } -#endif - /* mount the file system */ + Genode::String<4> const drive_num { "0" }; switch (f_mount(&_fatfs, (const TCHAR*)drive_num.string(), 1)) { case FR_OK: { TCHAR label[24] = { '\0' }; @@ -827,22 +802,10 @@ class Fatfs::File_system : public Vfs::File_system struct Fatfs_factory : Vfs::File_system_factory { - struct Inner : Vfs::File_system_factory - { - Inner(Genode::Env &env, Genode::Allocator &alloc) { - Fatfs::block_init(env, alloc); } - - Vfs::File_system *create(Vfs::Env &env, Genode::Xml_node node) override - { - return new (env.alloc()) - Fatfs::File_system(env, node); - } - }; - Vfs::File_system *create(Vfs::Env &vfs_env, Genode::Xml_node node) override { - static Inner factory(vfs_env.env(), vfs_env.alloc()); - return factory.create(vfs_env, node); + Fatfs::block_init(vfs_env.env(), vfs_env.alloc()); + return new (vfs_env.alloc()) Fatfs::File_system(vfs_env, node); } };