init version
This commit is contained in:
6
.cargo/config.toml
Normal file
6
.cargo/config.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[build]
|
||||
target = ".cargo/target-i386.json"
|
||||
|
||||
[unstable]
|
||||
build-std = ["core", "compiler_builtins"]
|
||||
build-std-features = ["compiler-builtins-mem"]
|
||||
58
.cargo/linker-mbr-i386.ld
Normal file
58
.cargo/linker-mbr-i386.ld
Normal file
@@ -0,0 +1,58 @@
|
||||
OUTPUT_FORMAT("binary")
|
||||
ENTRY(_start)
|
||||
|
||||
/* props to https://github.com/rust-osdev/bootloader/blob/main/bios/boot_sector/boot-sector-link.ld */
|
||||
SECTIONS {
|
||||
. = 0x500;
|
||||
_stack_start = .;
|
||||
. = 0x7c00;
|
||||
_stack_end = .;
|
||||
|
||||
_mbr_start = .;
|
||||
.boot :
|
||||
{
|
||||
*(.boot .boot.*)
|
||||
}
|
||||
.text :
|
||||
{
|
||||
*(.text .text.*)
|
||||
}
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata .rodata.*)
|
||||
}
|
||||
.data :
|
||||
{
|
||||
*(.rodata .rodata.*)
|
||||
*(.data .data.*)
|
||||
*(.got .got.*)
|
||||
}
|
||||
_mbr_end = .;
|
||||
|
||||
. = 0x7c00 + 446;
|
||||
_partition_table = .;
|
||||
.partition_table :
|
||||
{
|
||||
/* partition table entry 0 */
|
||||
QUAD(0)
|
||||
QUAD(0)
|
||||
/* partition table entry 1 */
|
||||
QUAD(0)
|
||||
QUAD(0)
|
||||
/* partition table entry 2 */
|
||||
QUAD(0)
|
||||
QUAD(0)
|
||||
/* partition table entry 3 */
|
||||
QUAD(0)
|
||||
QUAD(0)
|
||||
}
|
||||
|
||||
. = 0x7c00 + 510;
|
||||
|
||||
.magic_number :
|
||||
{
|
||||
SHORT(0xaa55) /* magic number for bootable disk */
|
||||
}
|
||||
|
||||
_second_stage_start = .;
|
||||
}
|
||||
26
.cargo/linker-multiboot.ld
Normal file
26
.cargo/linker-multiboot.ld
Normal file
@@ -0,0 +1,26 @@
|
||||
ENTRY(start)
|
||||
|
||||
SECTIONS {
|
||||
. = 1M;
|
||||
|
||||
.boot : ALIGN(16) {
|
||||
KEEP(*(.multiboot2_header))
|
||||
}
|
||||
|
||||
.text ALIGN(4) : {
|
||||
*(.text*)
|
||||
}
|
||||
|
||||
.rodata ALIGN(4) : {
|
||||
*(.rodata*)
|
||||
}
|
||||
|
||||
.data ALIGN(4) : {
|
||||
*(.data*)
|
||||
}
|
||||
|
||||
.bss ALIGN(4) : {
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
}
|
||||
}
|
||||
54
.cargo/linker-vba-i386.ld
Normal file
54
.cargo/linker-vba-i386.ld
Normal file
@@ -0,0 +1,54 @@
|
||||
OUTPUT_FORMAT("binary")
|
||||
ENTRY(_start)
|
||||
|
||||
SECTIONS {
|
||||
. = 0x500;
|
||||
_stack_start = .;
|
||||
. = 0x7c00;
|
||||
_stack_end = .;
|
||||
_mbr_start = .;
|
||||
|
||||
. = 0x7c00 + 512;
|
||||
_vba_start = .;
|
||||
|
||||
. = 0x7c00 + 512 + 0x0E;
|
||||
_vba_BPB_RsvdSecCnt;
|
||||
. = 0x7c00 + 512 + 0x10;
|
||||
_vba_BPB_NumFATs;
|
||||
. = 0x7c00 + 512 + 0x24;
|
||||
_vba_BPB_FATSz32;
|
||||
. = 0x7c00 + 512 + 0x2C;
|
||||
_vba_BPB_RootClus;
|
||||
|
||||
. = 0x7c00 + 512 + 0x5a;
|
||||
_second_stage_start = .;
|
||||
|
||||
.boot :
|
||||
{
|
||||
*(.boot .boot.*)
|
||||
}
|
||||
.text :
|
||||
{
|
||||
*(.text .text.*)
|
||||
}
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata .rodata.*)
|
||||
}
|
||||
.data :
|
||||
{
|
||||
*(.rodata .rodata.*)
|
||||
*(.data .data.*)
|
||||
*(.got .got.*)
|
||||
}
|
||||
|
||||
_second_stage_end = .;
|
||||
|
||||
. = 0x7c00 + 512 + 510;
|
||||
|
||||
.end_marker :
|
||||
{
|
||||
SHORT(0xaa55)
|
||||
}
|
||||
_real_second_stage_start = .;
|
||||
}
|
||||
20
.cargo/target-i386.json
Normal file
20
.cargo/target-i386.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"arch": "x86",
|
||||
"cpu": "i386",
|
||||
"data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128",
|
||||
"dynamic-linking": false,
|
||||
"executables": true,
|
||||
"linker-flavor": "ld.lld",
|
||||
"linker": "rust-lld",
|
||||
"llvm-target": "i386-unknown-none-code16",
|
||||
"max-atomic-width": 64,
|
||||
"position-independent-executables": false,
|
||||
"disable-redzone": true,
|
||||
"target-c-int-width": 32,
|
||||
"target-pointer-width": "32",
|
||||
"target-endian": "little",
|
||||
"panic-strategy": "abort",
|
||||
"os": "none",
|
||||
"vendor": "unknown",
|
||||
"relocation-model": "static"
|
||||
}
|
||||
21
.cargo/target-protected-i386.json
Normal file
21
.cargo/target-protected-i386.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"arch": "x86",
|
||||
"cpu": "i386",
|
||||
"data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128",
|
||||
"dynamic-linking": false,
|
||||
"executables": true,
|
||||
"linker-flavor": "ld.lld",
|
||||
"linker": "rust-lld",
|
||||
"llvm-target": "i386-unknown-none",
|
||||
"max-atomic-width": 64,
|
||||
"position-independent-executables": false,
|
||||
"disable-redzone": true,
|
||||
"target-c-int-width": 32,
|
||||
"target-pointer-width": 32,
|
||||
"target-endian": "little",
|
||||
"panic-strategy": "abort",
|
||||
"os": "none",
|
||||
"vendor": "unknown",
|
||||
"relocation-model": "static",
|
||||
"features": "-sse,-mmx"
|
||||
}
|
||||
Reference in New Issue
Block a user