Skip to content

Commit 71242a3

Browse files
author
Matthew
committed
initial commit
0 parents  commit 71242a3

12 files changed

+485
-0
lines changed

.cargo/config.toml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[unstable]
2+
build-std = ["core", "compiler_builtins"]
3+
build-std-features = ["compiler-builtins-mem"]
4+
5+
[build]
6+
target = "x86_64-kopy_os.json"
7+
8+
[target.'cfg(target_os = "none")']
9+
runner = "bootimage runner"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

.idea/discord.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kopy_os.iml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

+185
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.lock

+44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "kopy_os"
3+
version = "0.1.0"
4+
authors = ["Matthew <[email protected]>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
bootloader = "0.9.11"
11+
volatile = "0.2.6"
12+
spin = "0.7.0"
13+
14+
[dependencies.lazy_static]
15+
version = "1.0"
16+
features = ["spin_no_std"]

src/main.rs

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#![no_std]
2+
#![no_main]
3+
#![feature(custom_test_frameworks)]
4+
5+
// Tests
6+
#![test_runner(crate::test_runner)]
7+
#![reexport_test_harness_main = "test_main"]
8+
9+
mod vga_buffer;
10+
11+
use core::panic::PanicInfo;
12+
13+
#[no_mangle]
14+
pub extern "C" fn _start() -> ! {
15+
println!("8=======D");
16+
17+
#[cfg(test)]
18+
test_main();
19+
20+
loop {}
21+
}
22+
23+
#[panic_handler]
24+
fn panic(info: &PanicInfo) -> ! {
25+
println!("{}", info);
26+
loop {}
27+
}
28+
29+
#[cfg(test)]
30+
fn test_runner(tests: &[&dyn Fn()]) {
31+
println!("Running {} test", tests.len());
32+
for test in tests {
33+
test();
34+
}
35+
}
36+
37+
#[test_case]
38+
fn trivial_assertion() {
39+
print!("trivial assertion... ");
40+
assert_eq!(1, 1);
41+
println!("[ok]")
42+
}

0 commit comments

Comments
 (0)