-
Notifications
You must be signed in to change notification settings - Fork 10
[Devin AI] implement dd command #6
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
base: master
Are you sure you want to change the base?
[Devin AI] implement dd command #6
Conversation
- Add cmd_dd function with support for file copying and disk formatting - Support standard dd syntax: if=input of=output [bs=blocksize] [count=blocks] - Add cmd_dd_format function for FAT12 filesystem formatting - Add cmd_dd_copy function for file-to-file copying operations - Import BlockDevice trait to enable sector-level disk operations Addresses issue krustowski#2 from krustowski/rou2exOS Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
- Add skip= and seek= parameters for input/output offset positioning - Add status= parameter for progress reporting (none, progress, noxfer) - Add filesystem format selection: fs=fat12 or fs=raw - Implement cmd_dd_format_raw for zero-fill raw formatting - Enhanced block size validation (1-4096 bytes) - Improved copy logic with proper offset handling and count limits - Better error handling for invalid parameters and file operations - Progress indicators for raw formatting operations Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
- Make 'format' keyword optional in dd command syntax - Support direct fs= parameter detection for filesystem operations - Fix type conversion errors (usize to u64) for sector operations - Fix buffer size mismatches for fs.read_file calls - Add unsafe blocks for fs.write_file operations - Update help text to reflect simplified command syntax Examples: - dd fs=raw if=data.txt (instead of dd format fs=raw if=data.txt) - dd fs=fat12 bs=512 - dd fs=raw if=data.txt of=image.img Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
…anager.devin.ai/proxy/github.com/erkinalp/rou2exOS into devin/1751314602-implement-dd-command
- Remove [format] from usage syntax line - Fix status=progress example to include output location - Help text now reflects simplified dd command syntax Addresses GitHub comment: help strings need to be updated to syntax without dd format Co-Authored-By: Erkin Alp Güney <erkinalp9035@gmail.com>
Hi @erkinalp, Thank you very much for your contribution. Will look at it in more detail later. I have been cleaning branches a bit and merged the relevant one to |
Thank you for the merge update of the branch. And I am sorry it's taking so long. The fact is that I have been working on the external program execution and isolation, and this new command could be made into a solitaire program too. All programs run by kernel must implement and use the system ABI via syscalls. There is also a new repository with more details about current implementation with examples in C++, Go, NASM and Rust. Therefore that repository is to be a home for all external applications/programs/modules in any language that is linkable into the ELF format. A simple implementation of the ELF loader is almost done, and experimentally it works for almost any ELF executable. The problem is with a program exit, its graceful termination. In the current release (v0.8.1), there is a very simple flat binary loader, that is capable of returning back to shell. This is now being changed into the standard memory protection state, where kernel runs in so-called Ring 0, and other (user) programs in Ring 3. Memory has to be explicitly mapped with the user attribute to be accessible by user program (see Thank you for your patience and understanding. |
I intend to keep the dd as an internal command to reuse some of the privileged calls in the internal command parser and keep in spirit with original JCL dd. |
Okay, Shell will be running in higher privilege zone (Ring 2) than other userland (Ring 3) programs to be able to reach some special system calls. |
Some architectures such as ARM and RISC-V only have two rings, a three-ring architecture might necessiate using a type 2 hypervisor to emulate the extra rings in two-ring systems. |
Yeah, I have been reading some chunks about the ring topology in other architectures too. Great point! In two-ring systems the shell would be running in Ring 0, I suppose. As far as ARM is concerned, I would like to port the kernel to this architecture as well, but some changes need to be applied to the kernel structure to be able to switch archs more easily. I am thinking about something like the |
resolves #2 by providing an initial implementation of dd