Initial freemap, multi-arch ISO
This commit is contained in:
parent
f48426c59c
commit
c8fb0f76d8
@ -2,15 +2,19 @@ env_scripts = [
|
||||
'''
|
||||
#!@duckscript
|
||||
if eq ${TARGET} "x86_64-unknown-none"
|
||||
set_env ARCH "x86-64"
|
||||
set_env QEMUCOMMAND "qemu-system-x86_64"
|
||||
set_env LIMINEBIN "BOOTX64.EFI"
|
||||
else if eq ${TARGET} "aarch64-unknown-none"
|
||||
set_env ARCH "aarch64"
|
||||
set_env QEMUCOMMAND "qemu-system-aarch64"
|
||||
set_env LIMINEBIN "BOOTAA64.EFI"
|
||||
else if eq ${TARGET} "riscv64gc-unknown-none-elf"
|
||||
set_env ARCH "riscv64"
|
||||
set_env QEMUCOMMAND "qemu-system-riscv64"
|
||||
set_env LIMINEBIN "BOOTRISCV64.EFI"
|
||||
else if eq ${TARGET} "loongarch64-unknown-none"
|
||||
set_env ARCH "loongarch64"
|
||||
set_env QEMUCOMMAND "qemu-system-loongarch64"
|
||||
set_env LIMINEBIN "BOOTLOONGARCH64.EFI"
|
||||
end
|
||||
@ -103,6 +107,7 @@ dependencies = ["bins"]
|
||||
script = '''
|
||||
mkdir -p build/initramfs/system/bin
|
||||
mkdir -p build/initramfs/system/cfg
|
||||
mkdir -p build/${ARCH}
|
||||
|
||||
for bin in $(echo ${BINS} | tr ";" " ")
|
||||
do
|
||||
@ -110,7 +115,7 @@ script = '''
|
||||
done
|
||||
cp configs/server_config.toml build/initramfs/system/cfg/
|
||||
|
||||
tar -c --lzma -f build/initramfs.tar.lzma build/initramfs
|
||||
tar -c --lzma -f build/${ARCH}/initramfs.tar.lzma build/initramfs
|
||||
'''
|
||||
|
||||
[tasks.iso]
|
||||
@ -126,15 +131,16 @@ dependencies = ["kernel", "initramfs"]
|
||||
script = '''
|
||||
mkdir -p build/iso/boot/limine
|
||||
mkdir -p build/iso/EFI/BOOT
|
||||
mkdir -p build/iso/boot/${ARCH}
|
||||
|
||||
cp -f configs/limine.conf build/iso/
|
||||
cp -f ${LIMINEDIR}/limine-bios.sys build/iso/boot/limine/
|
||||
cp -f ${LIMINEDIR}/limine-bios-cd.bin build/iso/boot/limine/
|
||||
cp -f ${LIMINEDIR}/limine-uefi-cd.bin build/iso/boot/limine/
|
||||
cp -f ${LIMINEDIR}/${LIMINEBIN} build/iso/EFI/BOOT
|
||||
cp -f build/initramfs.tar.lzma build/iso/boot/
|
||||
cp -f build/${ARCH}/initramfs.tar.lzma build/iso/boot/${ARCH}
|
||||
|
||||
cp -f ${ARTIFACTDIR}/kernel build/iso/boot/
|
||||
cp -f ${ARTIFACTDIR}/kernel build/iso/boot/${ARCH}/gila
|
||||
|
||||
mkdir -p build/iso/system/bin
|
||||
mkdir -p build/iso/system/tmp
|
||||
|
@ -1,7 +1,7 @@
|
||||
timeout: 0
|
||||
timeout: 3
|
||||
|
||||
/Gila
|
||||
protocol: limine
|
||||
kernel_path: boot():/boot/kernel
|
||||
cmdline: -loglevel=Trace -logdev=display,serial -initramfs=/boot/initramfs.tar.lzma
|
||||
module_path: boot():/boot/initramfs.tar.lzma
|
||||
kernel_path: boot():/boot/${ARCH}/gila
|
||||
cmdline: -loglevel=Trace -logdev=display,serial -initramfs=/boot/${ARCH}/initramfs.tar.lzma
|
||||
module_path: boot():/boot/${ARCH}/initramfs.tar.lzma
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2025 shibedrill
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
|
||||
use crate::{LOGGER, LogLevel, format, log_info, log_trace};
|
||||
use alloc::string::String;
|
||||
use lazy_static::lazy_static;
|
||||
@ -9,11 +10,41 @@ use limine::{
|
||||
request::{ExecutableAddressRequest, HhdmRequest, MemoryMapRequest, PagingModeRequest},
|
||||
response::HhdmResponse,
|
||||
};
|
||||
|
||||
use spin::Mutex;
|
||||
use core::pin::*;
|
||||
use crate::memory::alloc::boxed::Box;
|
||||
use talc::*;
|
||||
|
||||
pub extern crate alloc;
|
||||
|
||||
pub struct FreeFrameBlockList {
|
||||
head: Option<Pin<Box<FreeFrameBlock>>>,
|
||||
}
|
||||
|
||||
impl FreeFrameBlockList {
|
||||
pub fn push(&mut self) {
|
||||
if let Some(inner) = &self.head {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This structure represents a set of
|
||||
// contiguous free page frames
|
||||
pub struct FreeFrameBlock {
|
||||
/// Number of contiguous 4KiB frames this block holds
|
||||
num_frames: usize,
|
||||
/// Pointer to the next block
|
||||
next_block: Option<Pin<Box<FreeFrameBlock>>>,
|
||||
}
|
||||
|
||||
impl FreeFrameBlock {
|
||||
fn num_frames(&self) -> usize { self.num_frames }
|
||||
fn next_block(&self) -> &Option<Pin<Box<FreeFrameBlock>>> { &self.next_block }
|
||||
}
|
||||
|
||||
pub fn log_memory() {
|
||||
// Panic if this is absent. It's needed to set up the GDT and paging
|
||||
let mmap_response = MEMMAP_REQUEST
|
||||
|
Loading…
Reference in New Issue
Block a user