Skip to content

Commit 58f9ed2

Browse files
It boots!
1 parent 58fe2cf commit 58f9ed2

File tree

8 files changed

+44
-3
lines changed

8 files changed

+44
-3
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ edition = "2018"
66
build = "build.rs"
77

88
[dependencies]
9+
shared = { path = "src/shared" }
910

1011
[build-dependencies]
1112
llvm-tools = "0.1"

i8086-bootloader.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"eliminate_frame_pointer": true,
2121
"pre-link-args": {
2222
"ld.lld": [
23-
"--script=real/linker.ld"
23+
"--script=src/real/linker.ld"
2424
]
2525
}
2626
}

src/lib.rs

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![no_std]
2+
#![no_main]
3+
4+
mod panic;
5+
6+
#[no_mangle]
7+
fn bootloader_no_optimize() {}

src/panic.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
use core::panic::PanicInfo;
2+
use shared::println;
3+
use shared::utils;
4+
5+
#[panic_handler]
6+
pub fn panic(info: &PanicInfo) -> ! {
7+
println!("[Panic]");
8+
9+
loop {
10+
utils::hlt()
11+
}
12+
}

src/protected/v86/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use core::slice;
77

88
const EFLAG_IF: u32 = 0x00000200;
99
const EFLAG_VM: u32 = 0x00020000;
10+
1011
/*
1112
pub struct V86 {}
1213

src/real/linker.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ SECTIONS {
1212

1313
*(.bootstrap)
1414
*bootsector*
15+
*core*
1516
}
1617

1718
/* We write the magic number in the linker script to cause a link-time error if the bootloader overflows the 512 byte limit */

0 commit comments

Comments
 (0)