A interpreter for Fat 16 images.
You can run it with xmake or with docker.
To run with xmake:
xmake && xmake r interpreter <path-to-img>
To run with docker:
- Build the image and create the container with the script (this will open container after create)
./scripts/create_container
- To run the app, you can use the script:
./scripts/run <path-to-img>
- To delete the image and the container after usage, you can run:
./scripts/delete_container
- To use another image, you have 3 options:
- Move the image to the
assets
folder before create the docker image; - Copy the object from the local machine to the
assets
folder and re-build the project with the following command:
# in the local machine docker cp <path-to-img-in-local-machine> matozinho_fat16:/home/cppdev/assets
# in the container xmake build -a
- Copy the image directly to the folder with the executable
# in the local machine docker cp <path-to-img-in-local-machine> matozinho_fat16:/home/cppdev/build/linux/x86_64/release/assets
- Move the image to the
# if the container is stopped, start and connect to it
docker start matozinho_fat16 && docker attach matozinho_fat16
# list all running containers
docker ps
The interpreter starts on the root dir of the image, and you can use the command help
to see all available commands.
[cppdev@12283e978376 ~]$ ./scripts/run assets/fat16_4sectorpercluster.img
|> help
Available commands:
+---------+----------------------------------------+----------------+
| Command | Description | Arguments |
+---------+----------------------------------------+----------------+
| clear | Clear the console | ()> |
+---------+----------------------------------------+----------------+
| pwd | Show the path to the current directory | ()> |
+---------+----------------------------------------+----------------+
| cd | Change to the specified directory | (std::string)> |
+---------+----------------------------------------+----------------+
| cat | Show the content of the specified file | (std::string)> |
+---------+----------------------------------------+----------------+
| ls | List all the entries of the directory | ()> |
+---------+----------------------------------------+----------------+
|>
./scripts/create_container
[cppdev@9c4cc4d9c605 ~]$ ./scripts/run assets/fat16_4sectorpercluster.img
|> help
Available commands:
+---------+----------------------------------------+----------------+
| Command | Description | Arguments |
+---------+----------------------------------------+----------------+
| clear | Clear the console | ()> |
+---------+----------------------------------------+----------------+
| pwd | Show the path to the current directory | ()> |
+---------+----------------------------------------+----------------+
| cd | Change to the specified directory | (std::string)> |
+---------+----------------------------------------+----------------+
| cat | Show the content of the specified file | (std::string)> |
+---------+----------------------------------------+----------------+
| ls | List all the entries of the directory | ()> |
+---------+----------------------------------------+----------------+
|>