Skip to content

Commit

Permalink
Merge branch 'enhancement-contrib-import' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ppenna committed Sep 10, 2024
2 parents 8b1bbce + 58bf5f7 commit 41a2384
Show file tree
Hide file tree
Showing 45 changed files with 4,299 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ target remote tcp::1234
file bin/kernel.elf
symbol-file bin/kernel.elf
handle SIGSEGV nostop noprint nopass
set scheduler-locking step
set confirm off
focus cmd
set detach-on-fork
b _do_start
b _do_ap_start
b _ap_trampoline
b kmain

define hook-stop
Expand Down
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@

[package]
name = "kernel"
version = "0.4.4"
version = "0.5.0"
license-file = "LICENSE.txt"
edition = "2021"
authors = ["The Maintainers of Nanvix"]
description = "Nanvix Kernel"
homepage = "https://github.com/nanvix"

[lib]
name = "sys"
path = "src/lib.rs"

[[bin]]
name = "kernel"
path = "src/kmain.rs"
Expand All @@ -25,7 +29,6 @@ arch = { git = "https://github.com/nanvix/arch", branch = "releases/v1.3.1", fea
"xapic",
] }
cfg-if = "1.0.0"
sys = { git = "https://github.com/nanvix/sys", branch = "releases/v2.0.0" }

[build-dependencies]
cc = "1.1.18"
Expand Down
2 changes: 1 addition & 1 deletion build
Submodule build updated 1 files
+5 −4 kernel/targets/x86.json
24 changes: 4 additions & 20 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,20 @@ fn main() {
Err(_) => panic!("failed to get OUT_DIR environment variable"),
};

// Get PATH environment variable.
let path: String = match env::var("PATH") {
Ok(path) => path,
Err(_) => panic!("failed to get PATH environment variable"),
};

// Get TOOLCHAIN_DIR environment variable.
let toolchain_dir: String = match env::var("TOOLCHAIN_DIR") {
Ok(toolchain_dir) => toolchain_dir,
Err(_) => panic!("failed to get TOOLCHAIN_DIR environment variable"),
};

// Add cross-compiler toolchain to PATH as `targets/*.json` relies on this.
let gcc_home: String = format!("{}/i486/bin", toolchain_dir);
let path: String = format!("{}:{}", gcc_home, path);
println!("cargo::rustc-env=PATH={}", path);
println!("cargo::rerun-if-env-changed=TOOLCHAIN_DIR");

//==============================================================================================
// Configure Toolchain
//==============================================================================================

let cc: String = format!("{}/i486-elf-gcc", gcc_home);
let cc: String = format!("gcc");

let mut cflags: Vec<&str> = vec![
"-nostdlib",
"-ffreestanding",
"-march=pentiumpro",
"-Wa,-march=pentiumpro",
"-Wstack-usage=4096",
"-Wall",
"-m32",
"-Wextra",
"-Werror",
];
Expand Down Expand Up @@ -132,7 +116,7 @@ fn main() {
//==============================================================================================

let status: ExitStatus = Command::new("ar")
.args(&["crus", "libkernel.a"])
.args(&["rcs", "libkernel.a"])
.args(&object_files)
.current_dir(&Path::new(&out_dir))
.status()
Expand Down
27 changes: 27 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright(c) The Maintainers of Nanvix.
// Licensed under the MIT License.

//==================================================================================================
// Configuration
//==================================================================================================

#![deny(clippy::all)]
#![forbid(clippy::large_stack_frames)]
#![forbid(clippy::large_stack_arrays)]
#![feature(ptr_sub_ptr)] // Slab::deallocate() uses this.
#![no_std]

//==================================================================================================
// Imports
//==================================================================================================

extern crate alloc;

//==================================================================================================
// Modules
//==================================================================================================

/// System configuration constants.
mod sys;

pub use sys::*;
Loading

0 comments on commit 41a2384

Please sign in to comment.