mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-15 15:37:51 -04:00
Prepare mount for more features
This commit is contained in:
parent
4f3fb72f1a
commit
106f53d9d3
@ -13,9 +13,8 @@
|
||||
|
||||
static constexpr const size_t BUFFER_SIZE = 4096;
|
||||
|
||||
int main(int, char*[]){
|
||||
//TODO Add support to mount new directories
|
||||
|
||||
int main(int argc, char* argv[]){
|
||||
if(argc == 1){
|
||||
auto buffer = new char[BUFFER_SIZE];
|
||||
|
||||
auto mp_result = mounts(buffer, BUFFER_SIZE);
|
||||
@ -46,3 +45,27 @@ int main(int, char*[]){
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if(argc < 4){
|
||||
printf("usage: mount fs device mountpoint\n");
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
auto fs_str = argv[1];
|
||||
auto device_str = argv[2];
|
||||
auto mount_point_str = argv[3];
|
||||
|
||||
std::string fs(fs_str);
|
||||
|
||||
if(fs == "fat32"){
|
||||
printf("mkfs: Mounting %s fat32 filesystem on %s\n", mount_point_str, device_str);
|
||||
|
||||
//TODO Mount new directory
|
||||
} else {
|
||||
printf("mkfs: Unsupported filesystem %s\n", fs_str);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user