ARM: work done on getting the bootloader working

master
able 2023-07-17 00:36:06 -05:00
parent 78379402bb
commit 0fbe5100bb
4 changed files with 22 additions and 5 deletions

View File

@ -3,8 +3,8 @@ build-std = ["core", "compiler_builtins", "alloc"]
build-std-features = ["compiler-builtins-mem"]
[build]
target = "./targets/x86_64-ableos.json"
# target = "./targets/aarch64-virt-ableos.json"
# target = "./targets/x86_64-ableos.json"
target = "./targets/aarch64-virt-ableos.json"
[target.'cfg(target_arch = "x86_64")']
rustflags = ["-C", "target-feature=+rdrand"]

View File

@ -3,7 +3,15 @@
// use limine::{TerminalRequest, TerminalResponse};
#[no_mangle]
#[allow(deprecated)]
unsafe extern "C" fn _kernel_start() -> ! {
use limine::{Framebuffer, FramebufferRequest, NonNullPtr};
static FB_REQ: FramebufferRequest = FramebufferRequest::new(0);
let fb1: &NonNullPtr<Framebuffer> = &FB_REQ.get_response().get().unwrap().framebuffers()[0];
unsafe {
fb1.address.as_ptr().expect("REASON").write_volatile(0x00);
}
loop {}
}

View File

@ -1,4 +1,4 @@
${ABLEOS_KERNEL}=boot:///kernel
${ABLEOS_KERNEL}=boot:///{$ARCH}/kernel
# TODO: Make a boot background image for ableOS
DEFAULT_ENTRY=1

View File

@ -112,6 +112,15 @@ fn get_fs() -> Result<FileSystem<impl ReadWriteSeek>, io::Error> {
&mut bootdir.create_file("bootx64.efi")?,
)?;
io::copy(
&mut File::open("limine/BOOTAA64.EFI")
.into_report()
.attach_printable(
"copying Limine bootloader arm version (have you pulled the submodule?)",
)?,
&mut bootdir.create_file("bootaa64.efi")?,
)?;
io::copy(
&mut File::open("repbuild/limine.cfg")?,
&mut fs.root_dir().create_file("limine.cfg")?,
@ -166,7 +175,7 @@ fn build(release: bool, target: Target) -> Result<(), Error> {
(|| -> std::io::Result<_> {
io::copy(
&mut File::open(
Path::new("target/x86_64-ableos")
Path::new("target/aarch64-virt-ableos")
.join(if release { "release" } else { "debug" })
.join("kernel"),
)?,
@ -230,7 +239,7 @@ fn run(release: bool, target: Target) -> Result<(), Error> {
if target == Target::Aarch64 {
com.args([
"-bios",
"target/OVMF_CODE.fd",
"AAVMF_CODE.fd",
"-M",
"virt",
"-device",