started setting up support for C code in the kernel

This commit is contained in:
2025-02-20 17:13:40 +00:00
parent 294e6f0e33
commit 60efcf39b6
9 changed files with 71 additions and 2 deletions
+7
View File
@@ -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() {