Skip to content

Commit 9802c75

Browse files
Trying to fix
1 parent 7ad2027 commit 9802c75

File tree

6 files changed

+63
-11
lines changed

6 files changed

+63
-11
lines changed

.cargo/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
target = "src/real/x86_64-real_mode.json"
2+
target = "x86_64-real_mode.json"

build.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ fn main() {
1010
.tool(&exe("llvm-objcopy"))
1111
.expect("llvm-objcopy not found");
1212

13-
build_subproject(
13+
/*build_subproject(
1414
Path::new("src/real/bootsector"),
1515
&[
1616
"_start",
1717
"real_mode_println",
1818
"no_int13h_extensions",
1919
"dap_load_failed",
2020
],
21-
"real/x86_64-real_mode.json",
21+
"x86_64-bootsector.json",
2222
&out_dir,
2323
&objcopy,
24-
);
24+
);*/
2525

2626
build_subproject(
2727
Path::new("src/real/stage_2"),
2828
&[
2929
"second_stage",
3030
],
31-
"real/x86_64-real_mode.json",
31+
"x86_64-stage_2.json",
3232
&out_dir,
3333
&objcopy,
3434
);
@@ -43,7 +43,6 @@ fn build_subproject(
4343
objcopy: &Path,
4444
) {
4545
let dir_name = dir.file_name().unwrap().to_str().unwrap();
46-
let manifest_path = dir.join("Cargo.toml");
4746
let out_path = Path::new(&out_dir);
4847
assert!(
4948
global_symbols.len() > 0,
@@ -52,14 +51,15 @@ fn build_subproject(
5251

5352
// build
5453
let mut cmd = Command::new("cargo");
55-
cmd.arg("xbuild").arg("--release");
56-
54+
cmd.current_dir(&dir);
55+
56+
cmd.arg("xbuild").arg("--release");
5757
cmd.arg("--verbose");
5858

59-
cmd.arg(format!("--manifest-path={}", manifest_path.display()));
6059
cmd.arg(format!(
6160
"--target={}",
62-
dir.join("..").join("..").join(target).display()
61+
//dir.join(target).display()
62+
target
6363
));
6464
cmd.arg("-Z").arg("unstable-options");
6565
cmd.arg("--out-dir").arg(&out_dir);

src/real/stage_2/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use shared::linker_symbol;
88
use shared::println;
9-
use v86::gdt::{Descriptor, GlobalDescriptorTable, TaskStateSegment};
9+
use shared::structures::gdt::{Descriptor, GlobalDescriptorTable, TaskStateSegment};
1010

1111
use lazy_static::lazy_static;
1212

src/real/stage_2/x86_64-stage_2.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"arch": "x86",
3+
"cpu": "i386",
4+
"data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128",
5+
"dynamic-linking": false,
6+
"executables": true,
7+
"linker-flavor": "ld.lld",
8+
"linker": "rust-lld",
9+
"llvm-target": "i386-unknown-none-code16",
10+
"max-atomic-width": 64,
11+
"position-independent-executables": false,
12+
"disable-redzone": true,
13+
"target-c-int-width": "32",
14+
"target-pointer-width": "32",
15+
"target-endian": "little",
16+
"panic-strategy": "abort",
17+
"os": "none",
18+
"vendor": "unknown",
19+
"relocation_model": "static",
20+
"eliminate_frame_pointer": true,
21+
"pre-link-args": {
22+
"ld.lld": [
23+
"--script=real/linker.ld"
24+
]
25+
}
26+
}

x86_64-real_mode.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"arch": "x86",
3+
"cpu": "i386",
4+
"data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128",
5+
"dynamic-linking": false,
6+
"executables": true,
7+
"linker-flavor": "ld.lld",
8+
"linker": "rust-lld",
9+
"llvm-target": "i386-unknown-none-code16",
10+
"max-atomic-width": 64,
11+
"position-independent-executables": false,
12+
"disable-redzone": true,
13+
"target-c-int-width": "32",
14+
"target-pointer-width": "32",
15+
"target-endian": "little",
16+
"panic-strategy": "abort",
17+
"os": "none",
18+
"vendor": "unknown",
19+
"relocation_model": "static",
20+
"eliminate_frame_pointer": true,
21+
"pre-link-args": {
22+
"ld.lld": [
23+
"--script=real/linker.ld"
24+
]
25+
}
26+
}

0 commit comments

Comments
 (0)