Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
merge
This commit is contained in:
Generated
+16
@@ -8,10 +8,20 @@ version = "2.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9"
|
||||
dependencies = [
|
||||
"shlex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kernel"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"lib_example",
|
||||
"limine",
|
||||
]
|
||||
@@ -28,3 +38,9 @@ checksum = "9ca87cab008b8efeebdbe037cd4d1438037d48c5cb6fed939ffa5aa06315a321"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shlex"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
||||
|
||||
+4
-1
@@ -7,9 +7,12 @@ edition = "2021"
|
||||
limine = "0.3.1"
|
||||
lib_example = { path = "../lib_example" }
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1.2.14"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
[[bin]]
|
||||
name = "kernel"
|
||||
path = "src/main.rs"
|
||||
path = "src/main.rs"
|
||||
|
||||
+6
-1
@@ -1,9 +1,14 @@
|
||||
use std::process::Command;
|
||||
use std::{env, path::Path};
|
||||
use cc;
|
||||
|
||||
fn main() {
|
||||
// Tell cargo to rerun if these files change
|
||||
println!("cargo:rerun-if-changed=src");
|
||||
println!("cargo:rerun-if-changed=linker.ld");
|
||||
println!("cargo:rerun-if-changed=../config/limine.conf");
|
||||
}
|
||||
|
||||
cc::Build::new()
|
||||
.file("src/main.c")
|
||||
.compile("lib");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
int add(int x, int y) {
|
||||
return x+y;
|
||||
}
|
||||
@@ -28,6 +28,11 @@ static _START_MARKER: RequestsStartMarker = RequestsStartMarker::new();
|
||||
#[link_section = ".requests_end_marker"]
|
||||
static _END_MARKER: RequestsEndMarker = RequestsEndMarker::new();
|
||||
|
||||
|
||||
extern "C" {
|
||||
pub fn add(x: i32, y: i32) -> i32;
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn kmain() -> ! {
|
||||
// All limine requests must also be referenced in a called function, otherwise they may be
|
||||
@@ -35,6 +40,8 @@ unsafe extern "C" fn kmain() -> ! {
|
||||
assert!(BASE_REVISION.is_supported());
|
||||
|
||||
lib_example::add_nums(1, 2);
|
||||
add(1, 2);
|
||||
|
||||
|
||||
if let Some(framebuffer_response) = FRAMEBUFFER_REQUEST.get_response() {
|
||||
if let Some(framebuffer) = framebuffer_response.framebuffers().next() {
|
||||
|
||||
Reference in New Issue
Block a user