Compare commits
2 Commits
d504aa2a6d
...
3ef8cbbf8c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ef8cbbf8c | ||
|
|
95c8480aac |
6
justfile
6
justfile
@@ -1,6 +1,12 @@
|
||||
default:
|
||||
just --list
|
||||
|
||||
execute_rust_os:
|
||||
#!/usr/bin/env bash
|
||||
cd os-in-rust
|
||||
cargo bootimage
|
||||
qemu-system-x86_64 -drive format=raw,file=target/x86_64_target/debug/bootimage-os-in-rust.bin
|
||||
|
||||
run_gamarjoba: build_gamarjoba
|
||||
./gamarjoba_munde/gamarjoba
|
||||
|
||||
|
||||
6
os-in-rust/.cargo/config.toml
Normal file
6
os-in-rust/.cargo/config.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[unstable]
|
||||
build-std = ["core", "compiler_builtins"]
|
||||
build-std-features = ["compiler-builtins-mem"]
|
||||
|
||||
[build]
|
||||
target = "x86_64_target.json"
|
||||
9
os-in-rust/Cargo.lock
generated
9
os-in-rust/Cargo.lock
generated
@@ -2,6 +2,15 @@
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "bootloader"
|
||||
version = "0.9.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a62c8f6168cd106687ee36a2b71a46c4144d73399f72814104d33094b8092fd2"
|
||||
|
||||
[[package]]
|
||||
name = "os-in-rust"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bootloader",
|
||||
]
|
||||
|
||||
@@ -5,10 +5,6 @@ edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[profile.dev]
|
||||
panic = "abort"
|
||||
|
||||
[profile.release]
|
||||
panic = "abort"
|
||||
|
||||
[dependencies]
|
||||
#bootloader = "0.10.12"
|
||||
bootloader = "0.9.8"
|
||||
|
||||
@@ -8,8 +8,23 @@ fn panic(_info: &PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
||||
static GAMARJOBA: &[u8] = b"Gamarjoba, MVNDE!";
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
let vga_buffer = 0xb8000 as *mut u8;
|
||||
|
||||
for (i, &byte) in GAMARJOBA.iter().enumerate() {
|
||||
let i = i as isize;
|
||||
unsafe {
|
||||
*vga_buffer.offset(i * 2) = byte;
|
||||
*vga_buffer.offset(i * 2 + 1) = 0xd;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
loop {}
|
||||
}
|
||||
|
||||
|
||||
18
os-in-rust/x86_64_target.json
Normal file
18
os-in-rust/x86_64_target.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"llvm-target": "x86_64-unknown-none",
|
||||
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
|
||||
"arch": "x86_64",
|
||||
"target-endian": "little",
|
||||
"target-pointer-width": "64",
|
||||
"target-c-int-width": "32",
|
||||
"os": "none",
|
||||
"executables": true,
|
||||
|
||||
"linker-flavor": "ld.lld",
|
||||
"linker": "rust-lld",
|
||||
|
||||
"panic-strategy": "abort",
|
||||
"disable-redzone": true,
|
||||
|
||||
"features": "-mmx,-sse,+soft-float"
|
||||
}
|
||||
Reference in New Issue
Block a user