forked from Rust-for-Linux/linux
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//! Virtual Device Module | ||
use kernel::prelude::*; | ||
|
||
module! { | ||
type: VDev, | ||
name: b"vdev", | ||
license: b"GPL", | ||
} | ||
|
||
struct VDev; | ||
|
||
impl kernel::Module for VDev { | ||
fn init(_name: &'static CStr, _module: &'static ThisModule) -> Result<Self> { | ||
// Print a banner to make sure our moudle is working | ||
pr_info!("------------------------\n"); | ||
pr_info!("starting virtual device!\n"); | ||
pr_info!("------------------------\n"); | ||
Ok(VDev) | ||
} | ||
} |