1
0
Fork 0
forked from koniifer/ableos

ARM: work done on getting the bootloader working

This commit is contained in:
able 2023-07-17 00:36:06 -05:00
parent 81e2603c4d
commit ede52eb1db
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-std-features = ["compiler-builtins-mem"]
[build] [build]
target = "./targets/x86_64-ableos.json" # target = "./targets/x86_64-ableos.json"
# target = "./targets/aarch64-virt-ableos.json" target = "./targets/aarch64-virt-ableos.json"
[target.'cfg(target_arch = "x86_64")'] [target.'cfg(target_arch = "x86_64")']
rustflags = ["-C", "target-feature=+rdrand"] rustflags = ["-C", "target-feature=+rdrand"]

View file

@ -3,7 +3,15 @@
// use limine::{TerminalRequest, TerminalResponse}; // use limine::{TerminalRequest, TerminalResponse};
#[no_mangle] #[no_mangle]
#[allow(deprecated)]
unsafe extern "C" fn _kernel_start() -> ! { 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 {} loop {}
} }

View file

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

View file

@ -112,6 +112,15 @@ fn get_fs() -> Result<FileSystem<impl ReadWriteSeek>, io::Error> {
&mut bootdir.create_file("bootx64.efi")?, &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( io::copy(
&mut File::open("repbuild/limine.cfg")?, &mut File::open("repbuild/limine.cfg")?,
&mut fs.root_dir().create_file("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<_> { (|| -> std::io::Result<_> {
io::copy( io::copy(
&mut File::open( &mut File::open(
Path::new("target/x86_64-ableos") Path::new("target/aarch64-virt-ableos")
.join(if release { "release" } else { "debug" }) .join(if release { "release" } else { "debug" })
.join("kernel"), .join("kernel"),
)?, )?,
@ -230,7 +239,7 @@ fn run(release: bool, target: Target) -> Result<(), Error> {
if target == Target::Aarch64 { if target == Target::Aarch64 {
com.args([ com.args([
"-bios", "-bios",
"target/OVMF_CODE.fd", "AAVMF_CODE.fd",
"-M", "-M",
"virt", "virt",
"-device", "-device",