Skip to content

Commit c156d4c

Browse files
authored
Merge pull request #10 from sdslabs/update
update dependency crates to newer versions and make accommodating changes
2 parents 806e4dd + e48ee69 commit c156d4c

File tree

11 files changed

+256
-30
lines changed

11 files changed

+256
-30
lines changed

.github/workflows/kernel.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions-rs/toolchain@v1
2323
with:
2424
profile: minimal
25-
toolchain: nightly-2020-12-07
25+
toolchain: nightly-2021-12-07
2626
- name: Install `rust-src` Rustup Component
2727
run: rustup component add rust-src
2828
- name: Run `cargo build`
@@ -38,7 +38,7 @@ jobs:
3838
uses: actions-rs/toolchain@v1
3939
with:
4040
profile: minimal
41-
toolchain: nightly-2020-12-07
41+
toolchain: nightly-2021-12-07
4242
- name: Checkout Repository
4343
uses: actions/checkout@v2
4444
- name: Install Rustup Components
@@ -64,7 +64,7 @@ jobs:
6464
uses: actions-rs/toolchain@v1
6565
with:
6666
profile: minimal
67-
toolchain: nightly-2020-12-07
67+
toolchain: nightly-2021-12-07
6868
components: rustfmt
6969
override: true
7070
- name: Run `cargo fmt`
@@ -83,7 +83,7 @@ jobs:
8383
uses: actions-rs/toolchain@v1
8484
with:
8585
profile: minimal
86-
toolchain: nightly-2020-12-07
86+
toolchain: nightly-2021-12-07
8787
components: clippy, rust-src
8888
override: true
8989
- name: Run `cargo clippy`

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
# will have compiled files and executables
33
/target/
44

5-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
7-
Cargo.lock
8-
95
# These are backup files generated by rustfmt
106
**/*.rs.bk
117

128
# Remove generated binaries
13-
/kernel/target/**
9+
/kernel/target/**
10+
11+
# Remove code editor files
12+
.vscode

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ default: help
1010

1111
## install: Install toolchain dependencies
1212
install:
13-
@rustup override set nightly-2020-12-07
13+
@rustup override set nightly-2021-12-07
1414
@rustup component add rust-src
1515
@rustup component add llvm-tools-preview
1616
@rustup component add clippy
@@ -49,4 +49,4 @@ kernel_run:
4949
help: Makefile
5050
@printf "\nRusticOS, Lightweight OS implementation in Rust\n\n"
5151
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
52-
@printf "\nDo check out the code at https://github.com/sdslabs/rusticos\n\n"
52+
@printf "\nDo check out the code at https://github.com/sdslabs/rusticos\n\n"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Open your favourite terminal and perform the following tasks:-
4545
Do check out the code at https://github.com/sdslabs/rusticos
4646
```
4747

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

5050
> This is necessary to enable some of the dependency crates
5151

kernel/Cargo.lock

Lines changed: 226 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kernel/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ edition = "2018"
1010
bootloader = { version = "0.9.8", features = ["map_physical_memory"]}
1111
volatile = "0.2.6"
1212
spin = "0.5.2"
13-
x86_64 = "0.13.6"
13+
x86_64 = "0.14.2"
1414
uart_16550 = "0.2.0"
15-
pic8259_simple = "0.2.0"
15+
pic8259 = "0.10.1"
1616
pc-keyboard = "0.5.0"
17-
linked_list_allocator = "0.8.0"
17+
linked_list_allocator = "0.9.0"
1818

1919
[dependencies.lazy_static]
2020
version = "1.0"

kernel/src/allocator/fixed_size_block.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ pub struct FixedSizeBlockAllocator {
1414

1515
impl FixedSizeBlockAllocator {
1616
pub const fn new() -> Self {
17+
const EMPTY: Option<&'static mut ListNode> = None;
1718
FixedSizeBlockAllocator {
18-
list_heads: [None; BLOCK_SIZES.len()],
19+
list_heads: [EMPTY; BLOCK_SIZES.len()],
1920
fallback_allocator: linked_list_allocator::Heap::empty(),
2021
}
2122
}

kernel/src/interrupts/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{gdt, print, println};
22
use lazy_static::lazy_static;
3-
use pic8259_simple::ChainedPics;
3+
use pic8259::ChainedPics;
44
use spin;
55
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
66

@@ -49,18 +49,18 @@ pub fn init_idt() {
4949
IDT.load();
5050
}
5151

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

5656
extern "x86-interrupt" fn double_fault_handler(
57-
stack_frame: &mut InterruptStackFrame,
57+
stack_frame: InterruptStackFrame,
5858
_error_code: u64,
5959
) -> ! {
6060
panic!("EXCEPTION: DOUBLE FAULT\n{:#?}", stack_frame);
6161
}
6262

63-
extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: &mut InterruptStackFrame) {
63+
extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFrame) {
6464
print!(".");
6565
unsafe {
6666
PICS.lock()
@@ -69,7 +69,7 @@ extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: &mut InterruptSt
6969
}
7070

7171
extern "x86-interrupt" fn general_protection_fault_handler(
72-
stack_frame: &mut InterruptStackFrame,
72+
stack_frame: InterruptStackFrame,
7373
error_code: u64,
7474
) {
7575
println!(
@@ -78,7 +78,7 @@ extern "x86-interrupt" fn general_protection_fault_handler(
7878
);
7979
}
8080

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

107107
extern "x86-interrupt" fn page_fault_handler(
108-
stack_frame: &mut InterruptStackFrame,
108+
stack_frame: InterruptStackFrame,
109109
error_code: PageFaultErrorCode,
110110
) {
111111
use x86_64::registers::control::Cr2;

0 commit comments

Comments
 (0)