Skip to content

Commit

Permalink
Merge pull request #10 from sdslabs/update
Browse files Browse the repository at this point in the history
update dependency crates to newer versions and make accommodating changes
  • Loading branch information
Bashar-Ahmed authored May 17, 2022
2 parents 806e4dd + e48ee69 commit c156d4c
Show file tree
Hide file tree
Showing 11 changed files with 256 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/kernel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-12-07
toolchain: nightly-2021-12-07
- name: Install `rust-src` Rustup Component
run: rustup component add rust-src
- name: Run `cargo build`
Expand All @@ -38,7 +38,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-12-07
toolchain: nightly-2021-12-07
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Rustup Components
Expand All @@ -64,7 +64,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-12-07
toolchain: nightly-2021-12-07
components: rustfmt
override: true
- name: Run `cargo fmt`
Expand All @@ -83,7 +83,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-12-07
toolchain: nightly-2021-12-07
components: clippy, rust-src
override: true
- name: Run `cargo clippy`
Expand Down
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# will have compiled files and executables
/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# Remove generated binaries
/kernel/target/**
/kernel/target/**

# Remove code editor files
.vscode
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ default: help

## install: Install toolchain dependencies
install:
@rustup override set nightly-2020-12-07
@rustup override set nightly-2021-12-07
@rustup component add rust-src
@rustup component add llvm-tools-preview
@rustup component add clippy
Expand Down Expand Up @@ -49,4 +49,4 @@ kernel_run:
help: Makefile
@printf "\nRusticOS, Lightweight OS implementation in Rust\n\n"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@printf "\nDo check out the code at https://github.com/sdslabs/rusticos\n\n"
@printf "\nDo check out the code at https://github.com/sdslabs/rusticos\n\n"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Open your favourite terminal and perform the following tasks:-
Do check out the code at https://github.com/sdslabs/rusticos
```

1. Run `make install` to install the necessary toolchain dependencies and change Rust version to nightly-2020-12-07.
1. Run `make install` to install the necessary toolchain dependencies and change Rust version to nightly-2021-12-07.

> This is necessary to enable some of the dependency crates

Expand Down
226 changes: 226 additions & 0 deletions kernel/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ edition = "2018"
bootloader = { version = "0.9.8", features = ["map_physical_memory"]}
volatile = "0.2.6"
spin = "0.5.2"
x86_64 = "0.13.6"
x86_64 = "0.14.2"
uart_16550 = "0.2.0"
pic8259_simple = "0.2.0"
pic8259 = "0.10.1"
pc-keyboard = "0.5.0"
linked_list_allocator = "0.8.0"
linked_list_allocator = "0.9.0"

[dependencies.lazy_static]
version = "1.0"
Expand Down
3 changes: 2 additions & 1 deletion kernel/src/allocator/fixed_size_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ pub struct FixedSizeBlockAllocator {

impl FixedSizeBlockAllocator {
pub const fn new() -> Self {
const EMPTY: Option<&'static mut ListNode> = None;
FixedSizeBlockAllocator {
list_heads: [None; BLOCK_SIZES.len()],
list_heads: [EMPTY; BLOCK_SIZES.len()],
fallback_allocator: linked_list_allocator::Heap::empty(),
}
}
Expand Down
14 changes: 7 additions & 7 deletions kernel/src/interrupts/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{gdt, print, println};
use lazy_static::lazy_static;
use pic8259_simple::ChainedPics;
use pic8259::ChainedPics;
use spin;
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};

Expand Down Expand Up @@ -49,18 +49,18 @@ pub fn init_idt() {
IDT.load();
}

extern "x86-interrupt" fn breakpoint_handler(stack_frame: &mut InterruptStackFrame) {
extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) {
println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
}

extern "x86-interrupt" fn double_fault_handler(
stack_frame: &mut InterruptStackFrame,
stack_frame: InterruptStackFrame,
_error_code: u64,
) -> ! {
panic!("EXCEPTION: DOUBLE FAULT\n{:#?}", stack_frame);
}

extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: &mut InterruptStackFrame) {
extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFrame) {
print!(".");
unsafe {
PICS.lock()
Expand All @@ -69,7 +69,7 @@ extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: &mut InterruptSt
}

extern "x86-interrupt" fn general_protection_fault_handler(
stack_frame: &mut InterruptStackFrame,
stack_frame: InterruptStackFrame,
error_code: u64,
) {
println!(
Expand All @@ -78,7 +78,7 @@ extern "x86-interrupt" fn general_protection_fault_handler(
);
}

extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: &mut InterruptStackFrame) {
extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStackFrame) {
use pc_keyboard::{layouts, HandleControl, Keyboard, ScancodeSet1};
use spin::Mutex;
use x86_64::instructions::port::Port;
Expand All @@ -105,7 +105,7 @@ use crate::hlt_loop;
use x86_64::structures::idt::PageFaultErrorCode;

extern "x86-interrupt" fn page_fault_handler(
stack_frame: &mut InterruptStackFrame,
stack_frame: InterruptStackFrame,
error_code: PageFaultErrorCode,
) {
use x86_64::registers::control::Cr2;
Expand Down
Loading

0 comments on commit c156d4c

Please sign in to comment.