Initial commit

This commit is contained in:
Mark Poliakov 2021-08-14 17:37:38 +03:00
commit f7ceb3e02d
8 changed files with 89 additions and 0 deletions

5
.cargo/config.toml Normal file
View File

@ -0,0 +1,5 @@
[unstable]
build-std = ["core", "compiler_builtins"]
[build]
target = "etc/aarch64-unknown-none-rpi3b.json"

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

7
Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "osdev4"
version = "0.1.0"

8
Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "osdev4"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@ -0,0 +1,23 @@
{
"arch": "aarch64",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
"executables": true,
"linker": "rust-lld",
"linker-flavor": "ld.lld",
"linker-is-gnu": true,
"llvm-target": "aarch64-unknown-none",
"features": "+a53,+strict-align",
"max-atomic-width": 128,
"os": "none",
"panic-strategy": "abort",
"position-independent-executables": false,
"target-c-int-width": "32",
"target-endian": "little",
"target-pointer-width": "64",
"disable-redzone": true,
"pre-link-args": {
"ld.lld": [
"-Tetc/aarch64-unknown-none-rpi3b.ld"
]
}
}

View File

@ -0,0 +1,22 @@
ENTRY(_entry);
SECTIONS {
. = 0x80000;
.text : {
KEEP(*(.text.boot))
*(.text)
}
.rodata : {
*(.rodata)
}
.data : {
*(.data)
}
.bss : {
*(.bss)
}
}

5
etc/gdbrc Normal file
View File

@ -0,0 +1,5 @@
symbol-file target/aarch64-unknown-none-rpi3b/debug/osdev4
target remote :1234
layout asm
layout regs
set scheduler-locking on

18
src/main.rs Normal file
View File

@ -0,0 +1,18 @@
#![feature(
global_asm,
)]
#![no_std]
#![no_main]
global_asm!(r#"
.section .text.boot
.global _entry
_entry:
b .
"#);
use core::panic::PanicInfo;
#[panic_handler]
fn panic_handler(_pi: &PanicInfo) -> ! {
loop {}
}