-
Notifications
You must be signed in to change notification settings - Fork 37
refactor: split starry into multiple crates #22
Conversation
|
What mean |
| @@ -34,12 +34,7 @@ pub(crate) fn sys_openat( | |||
| Ok(api::sys_openat(dirfd, path.as_ptr(), flags, modes) as _) | |||
| } | |||
|
|
|||
| #[cfg(target_arch = "x86_64")] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to provide a public API, I think it is best not to expose different functions on different hardware architectures? After all, sys_open of arceos_posix_api is also available on all architectures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the current crate is designed for syscall, I think it is possible to design functions strictly according to the man page. Otherwise, when the user enables target_arch=riscv64 and finds syscall_open and syscall_openat at the same time, he may feel confused?
If you mean methods like But I think part of the core content can also be abstracted into independent crates, such as |
|
An example can be seen at https://github.com/arceos-hypervisor/axvcpu |
| @@ -1,3 +1,9 @@ | |||
| use core::{ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we seperate this or other part as a seperate crate, refer to #22 (comment)
I am now trying to abstract the logic of |
Most notably: the file descriptor table |
Do you have any ideas on naming? Should we stick with the |
use ax* style because we will uniform it with arceos |
And the |
Yep but we can also abstract the |
It may need to store at the |
|
Note here: We decided to do modularization separately later and keep this PR just for the basic split of starry. |
Description
This is the first part of #16, although they seem unrelated.
In order to reduce the pressure of #18 and track the file history (the file changes in #18 are too large for Git to track the file history), I created this simplified version that splits
starryinto three crates. And I think we should also determine the name, function and content of each module here first.Implementation details
This PR splits
starryinto the following three crates:starry-core: monolithic kernel related stuffs, including user apps loading, process managementstarry-api: all syscalls, with address checking, optional tracing and unified return value typeLinuxResult<isize>, so it's basically an advanced version ofarceos_posix_api(we will later merge the similar part ofarceos_posix_apiinto this later)starry(main crate): entrypoint for the kernelTODO
core?