Skip to content

Kernelmodule system#39

Open
F42J wants to merge 12 commits intomainfrom
feature/kernelmodules
Open

Kernelmodule system#39
F42J wants to merge 12 commits intomainfrom
feature/kernelmodules

Conversation

@F42J
Copy link
Member

@F42J F42J commented Mar 1, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 1, 2026 21:04
@github-actions
Copy link

github-actions bot commented Mar 1, 2026

LCOV of commit 876aad7 during Osiris CI #319

Total coverage: 13.75%

lcov: WARNING: lcov: WARNING: RC option 'lcov_branch_coverage' is deprecated.  Consider using 'branch_coverage. instead.  (Backward-compatible support will be removed in the future
Summary coverage rate:
  lines......: 13.8% (232 of 1687 lines)
  functions..: 16.0% (39 of 244 functions)
  branches...: no data found

Files changed coverage rate: n/a

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an in-tree kernel module system backed by build-time code generation, aiming to auto-discover kernel modules and generate a matching userspace-callable API for module calls.

Changes:

  • Adds build-script discovery of #[kernelmod_init], #[kernelmod_exit], and #[kernelmod_call] functions and generates kernel dispatch + userspace wrappers.
  • Introduces a PosixError errno enum and integrates it into the module-call return path.
  • Extends proc-macros with a #[kernelmod_call] wrapper generator and updates syscall inline-asm stubs to return isize.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
build.rs Adds kernel-module discovery and generates modules_kernel.rs/modules_uspace.rs.
macros/src/lib.rs Adds #[kernelmod_call] proc-macro and wrapper generation logic.
src/modules.rs Adds module system entrypoints and includes generated kernel module glue.
src/uspace.rs Includes generated userspace module wrapper code.
src/error.rs Adds PosixError errno definitions and conversions.
src/lib.rs Exposes new modules and error modules from the crate root.
machine/arm/src/asm.rs Updates syscall macro implementation to return a value via inline asm.
machine/testing/src/asm.rs Updates syscall macro stubs to return isize for non-zero-arg forms.
src/modules/sample_module.rs Adds a commented-out sample kernel module illustrating expected patterns.
.gitignore Adds ignores for module-related generated files (paths currently appear mismatched).
src/utils.rs Whitespace-only change.
src/uspace/.gitkeep Adds placeholder to keep src/uspace/ directory in git.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants