-
Notifications
You must be signed in to change notification settings - Fork 25
Implemented getcwd_user and pwd #41
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: main
Are you sure you want to change the base?
Conversation
|
I will be reviewing this PR. |
|
Verification Testing
Code walkthrough:
Checklist
Code Checks:
|
|
I will code review this |
|
Verification Testing The one issue I did run into is that /pwd doesn’t execute. This seems to be because you didn’t add pwd to the UPROGS section of the Makefile. Code Walkthrough
Formatting Checklist: High Level Checks: Code Checks: |
|
This is a good implementation of tracking the CWD without using the process level CWD maintained in the kernel. The unfortunate side effect of tracking all the movements yourself is:
There isn't much you can do to avoid that with this approach though. As far as the code goes, I like that this change was moved out to a separate file to decrease the impact on Right now, the way this works, all programs now have a global 'cwd' taking up MAX_PATH characters of space. Instead of doing it this way, we can make 32x64 seems reasonable for your components, but how did you land on that? Honestly, maybe you could base those on MAX_PATH so you know all bases are covered. The dimensions of this array should be constants (initially I was confused when I saw 63 somewhere in your code, wondering what that was for). 4.75/5 |
This is an implementation of the pwd (print working directory) command line user utility. To print our working directory, we need to first get the current working directory. This code below gets the current working directory (cwd) then allows the shell to automatically update with the cwd when we change directories throughout our system. Then pwd will execute as a normal command and print our directory in a new line.