From 73fc87ec642fb9b8f8fddeb569f5b00693e150dc Mon Sep 17 00:00:00 2001 From: yufeng <321353225@qq.com> Date: Sat, 3 Aug 2024 13:52:17 -0400 Subject: [PATCH] feat: support new polyhal --- .gitignore | 3 ++- .vscode/settings.json | 13 +++---------- Cargo.lock | 29 ++++++++++++++++------------- Makefile | 12 ++++++++++-- byteos.yaml | 7 ++++++- kernel/Cargo.toml | 2 +- kernel/linker.lds.S | 17 +---------------- kernel/src/main.rs | 14 +++++++++----- kernel/src/panic.rs | 10 ++++++++-- kernel/src/socket.rs | 2 +- kernel/src/syscall/consts.rs | 4 ++-- kernel/src/syscall/mm.rs | 4 ++-- kernel/src/syscall/shm.rs | 4 ++-- kernel/src/syscall/sys.rs | 2 +- kernel/src/syscall/task.rs | 3 ++- kernel/src/tasks/elf.rs | 4 ++-- kernel/src/tasks/initproc.rs | 4 ++-- kernel/src/tasks/memset.rs | 4 ++-- kernel/src/tasks/mod.rs | 2 +- kernel/src/tasks/task.rs | 7 ++----- kernel/src/user/entry.rs | 4 ++-- kernel/src/user/mod.rs | 7 +++++-- kernel/src/user/signal.rs | 6 ++++-- tools/iso/boot/grub/grub.cfg | 13 +++++++++++++ 24 files changed, 99 insertions(+), 78 deletions(-) create mode 100644 tools/iso/boot/grub/grub.cfg diff --git a/.gitignore b/.gitignore index d4ea57a..e6515c8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ packets.pcap kernel/*.lds qemu.log kernel/src/drivers.rs -graph.png \ No newline at end of file +graph.png +tools/iso/example diff --git a/.vscode/settings.json b/.vscode/settings.json index 36456ba..c4d11d7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,5 @@ { - "rust-analyzer.checkOnSave.allTargets": false, - "rust-analyzer.checkOnSave.extraArgs": [ - // "--target", - // "riscv64imac-unknown-none-elf" - // "x86_64-unknown-none" - ], - "files.associations": { - "*.in": "cpp", - "fcntl.h": "c" - } + "rust-analyzer.check.allTargets": false, + "rust-analyzer.check.extraArgs": [], + "rust-analyzer.procMacro.enable": true } \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 8a13223..35cdcbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,9 +38,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] -name = "arm_gic" +name = "arm_gicv2" version = "0.1.0" -source = "git+https://github.com/Byte-OS/arm_gic#7a0693ebe4113cfeb2f5ee93920e6e7ea3afe99a" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d25e73c949c69f75d1b9dba39c5475523403b31eb8c2fdc99da4dc33bc1aca" dependencies = [ "tock-registers", ] @@ -48,7 +49,8 @@ dependencies = [ [[package]] name = "arm_pl011" version = "0.1.0" -source = "git+https://github.com/Byte-OS/arm_pl011.git#8a66e24c7e6ac2a01841cd29c5e1690323aa1d8d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efcf6afca4502993a737ba1e00952d1321078689da92bf7aab27d4e5756c0bec" dependencies = [ "tock-registers", ] @@ -156,7 +158,7 @@ dependencies = [ [[package]] name = "devices" version = "0.1.0" -source = "git+https://github.com/Byte-OS/devices.git#28ba385a63b5ba6e08131f022551ad66edb490c9" +source = "git+https://github.com/Byte-OS/devices.git#89a7844a041117af8465b2f484f3627aef929a32" dependencies = [ "fdt", "frame_allocator", @@ -189,7 +191,7 @@ checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" [[package]] name = "executor" version = "0.1.0" -source = "git+https://github.com/Byte-OS/executor.git#1fa479565027f0377de4ea1b64ce683ee10e6d39" +source = "git+https://github.com/Byte-OS/executor.git#7cab69999a3b48e12addd861dfaa4471fd8afba9" dependencies = [ "downcast-rs", "hashbrown", @@ -225,7 +227,7 @@ checksum = "784a4df722dc6267a04af36895398f59d21d07dce47232adf31ec0ff2fa45e67" [[package]] name = "frame_allocator" version = "0.1.0" -source = "git+https://github.com/Byte-OS/bit_frame_allocator.git#e401675aef8a404cdda5c09c603afd51fe3231a9" +source = "git+https://github.com/Byte-OS/bit_frame_allocator.git#b989b6a4e17d960fca1e77c83f060cb6006fc924" dependencies = [ "bit_field", "log", @@ -415,7 +417,7 @@ dependencies = [ [[package]] name = "logging" version = "0.1.0" -source = "git+https://github.com/Byte-OS/logging.git#3e749346c6085e89b4ae61e520a0cfeadd222f11" +source = "git+https://github.com/Byte-OS/logging.git#242f79a5628f9d2dfa79b287bca6125575ce98bf" dependencies = [ "devices", "log", @@ -544,11 +546,11 @@ checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "polyhal" -version = "0.1.0" -source = "git+https://github.com/Byte-OS/polyhal.git#3cfa99e25f41a0594d3c52f26d70f39699cac59b" +version = "0.1.2" +source = "git+https://github.com/Byte-OS/polyhal.git#bbfe118fc45861c253b110a049e56deb954b4e30" dependencies = [ "aarch64-cpu", - "arm_gic", + "arm_gicv2", "arm_pl011", "bitflags 2.4.2", "cfg-if", @@ -569,8 +571,9 @@ dependencies = [ [[package]] name = "polyhal-macro" -version = "0.1.0" -source = "git+https://github.com/Byte-OS/polyhal.git#3cfa99e25f41a0594d3c52f26d70f39699cac59b" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa314a044c9b63aac7e5633f7d709c0ea28e6f97f98e3932ae10bbb2ff3a27ce" dependencies = [ "proc-macro2", "quote", @@ -620,7 +623,7 @@ dependencies = [ [[package]] name = "ramfs" version = "0.1.0" -source = "git+https://github.com/Byte-OS/ramfs.git#57167265b20e428295c33e0c4e33eaf8ab7f3638" +source = "git+https://github.com/Byte-OS/ramfs.git#55d83b65cfc6b3f0c2d83403515c1618a578a99a" dependencies = [ "frame_allocator", "log", diff --git a/Makefile b/Makefile index ae4b1d2..94f07d3 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ ifeq ($(ROOT_FS), fat32) sudo mount $(FS_IMG) mount/ -o uid=1000,gid=1000 sudo rm -rf mount/* else ifeq ($(ROOT_FS), ext4_rs) - mkfs.ext4 $(FS_IMG) + mkfs.ext4 -b 4096 $(FS_IMG) mkdir mount/ -p sudo mount $(FS_IMG) mount/ else @@ -161,4 +161,12 @@ gdb: addr2line: addr2line -sfipe $(KERNEL_ELF) | rustfilt -.PHONY: all run build clean gdb justbuild + +iso: build + cp $(KERNEL_ELF) tools/iso/example + grub-mkrescue -o bootable.iso tools/iso + +boot-iso: iso + qemu-system-x86_64 -cdrom bootable.iso -serial stdio + +.PHONY: all run build clean gdb justbuild iso boot-iso diff --git a/byteos.yaml b/byteos.yaml index 63f1e4c..534045c 100644 --- a/byteos.yaml +++ b/byteos.yaml @@ -3,7 +3,8 @@ global: configs: board: "qemu" # Available are fat32, ext4 and ext4_rs. - root_fs: "fat32" + # root_fs: "fat32" + root_fs: "ext4_rs" env: HEAP_SIZE: "0x0180_0000" MOUNT_IMG_PATH: "mount.img" @@ -22,6 +23,10 @@ bin: target: "x86_64-unknown-none" configs: driver: "kvirtio,kgoldfish-rtc,ns16550a" + x86_64-generic: + target: "x86_64-unknown-none" + configs: + driver: "kramdisk,kgoldfish-rtc,ns16550a" aarch64-qemu: target: "aarch64-unknown-none-softfloat" configs: diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index e71d05c..d9fd705 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -19,7 +19,7 @@ logging = { git = "https://github.com/Byte-OS/logging.git", features = []} log = "0.4" devices = { git = "https://github.com/Byte-OS/devices.git" } hal = { git = "https://github.com/Byte-OS/hal.git" } -polyhal = { git = "https://github.com/Byte-OS/polyhal.git" } +polyhal = { git = "https://github.com/Byte-OS/polyhal.git", features = ["trap"]} fs = { git = "https://github.com/Byte-OS/fs.git" } fdt = "0.1.5" executor = { git = "https://github.com/Byte-OS/executor.git" } diff --git a/kernel/linker.lds.S b/kernel/linker.lds.S index 478cee4..3b2621e 100644 --- a/kernel/linker.lds.S +++ b/kernel/linker.lds.S @@ -38,23 +38,8 @@ SECTIONS *(.sigtrx .sigtrx.*) } - _load_end = .; - - . = ALIGN(4K); - _percpu_start = .; - .percpu 0x0 : AT(_percpu_start) { - _percpu_load_start = .; - *(.percpu .percpu.*) - _percpu_load_end = .; - . = ALIGN(64); - _percpu_size_aligned = .; - - . = _percpu_load_start + _percpu_size_aligned * %SMP%; - } - . = _percpu_start + SIZEOF(.percpu); - _percpu_end = .; - .bss ALIGN(4K): { + _load_end = .; *(.bss.stack) _sbss = .; *(.bss .bss.*) diff --git a/kernel/src/main.rs b/kernel/src/main.rs index ce8c32b..f46c6f0 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -31,12 +31,14 @@ mod user; use core::sync::atomic::{AtomicBool, Ordering}; -use devices::{self, get_int_device}; +use devices::{self, get_int_device, VIRT_ADDR_START}; use executor::current_task; use frame_allocator::{self, frame_alloc_persist, frame_unalloc}; use polyhal::addr::{PhysPage, VirtPage}; +use polyhal::common::{get_fdt, get_mem_areas, PageAlloc}; use polyhal::irq::IRQ; -use polyhal::{get_mem_areas, PageAlloc, TrapFrame, TrapFrameArgs, TrapType, VIRT_ADDR_START}; +use polyhal::trap::TrapType; +use polyhal::trapframe::{TrapFrame, TrapFrameArgs}; use tasks::UserTask; use user::user_cow_int; use vfscore::OpenFlags; @@ -155,7 +157,7 @@ fn main(hart_id: usize) { // initialize logging module logging::init(option_env!("LOG")); - polyhal::init(&PageAllocImpl); + polyhal::common::init(&PageAllocImpl); get_mem_areas().into_iter().for_each(|(start, size)| { info!("memory area: {:#x} - {:#x}", start, start + size); frame_allocator::add_frame_map(start, start + size); @@ -170,7 +172,7 @@ fn main(hart_id: usize) { devices::prepare_drivers(); - if let Some(fdt) = polyhal::get_fdt() { + if let Some(fdt) = get_fdt() { for node in fdt.all_nodes() { devices::try_to_add_device(&node); } @@ -179,7 +181,8 @@ fn main(hart_id: usize) { // get devices and init devices::regist_devices_irq(); - polyhal::instruction::Instruction::ebreak(); + // TODO: test ebreak + // Instruction::ebreak(); // initialize filesystem fs::init(); @@ -221,6 +224,7 @@ fn main(hart_id: usize) { // init kernel threads and async executor tasks::init(); + log::info!("run tasks"); // loop { arch::wfi() } tasks::run_tasks(); diff --git a/kernel/src/panic.rs b/kernel/src/panic.rs index ec22e4e..8ef9a04 100644 --- a/kernel/src/panic.rs +++ b/kernel/src/panic.rs @@ -1,7 +1,13 @@ -use polyhal::{hart_id, shutdown}; // use backtrace::backtrace; use core::panic::PanicInfo; +use polyhal::instruction::Instruction; + +#[inline] +fn hart_id() -> usize { + 0 +} + // 程序遇到错误 #[panic_handler] fn panic_handler(info: &PanicInfo) -> ! { @@ -21,5 +27,5 @@ fn panic_handler(info: &PanicInfo) -> ! { // backtrace(); println!("!TEST FINISH!"); // loop {} - shutdown() + Instruction::shutdown() } diff --git a/kernel/src/socket.rs b/kernel/src/socket.rs index 19ce853..79c9204 100644 --- a/kernel/src/socket.rs +++ b/kernel/src/socket.rs @@ -3,7 +3,7 @@ use core::{cmp, net::SocketAddrV4}; use alloc::{sync::Arc, vec::Vec}; use fs::INodeInterface; use lose_net_stack::net_trait::SocketInterface; -use polyhal::debug::DebugConsole; +use polyhal::debug_console::DebugConsole; use sync::Mutex; use vfscore::{Metadata, PollEvent, VfsResult}; diff --git a/kernel/src/syscall/consts.rs b/kernel/src/syscall/consts.rs index 3d20cc1..e67df41 100644 --- a/kernel/src/syscall/consts.rs +++ b/kernel/src/syscall/consts.rs @@ -10,8 +10,8 @@ use fs::VfsError; use hal::TimeVal; use num_derive::FromPrimitive; use polyhal::addr::VirtAddr; -use polyhal::pagetable::MappingFlags; -use polyhal::TrapFrame; +use polyhal::trapframe::TrapFrame; +use polyhal::MappingFlags; use signal::SigProcMask; #[repr(i32)] diff --git a/kernel/src/syscall/mm.rs b/kernel/src/syscall/mm.rs index 439d3cb..e23f9e5 100644 --- a/kernel/src/syscall/mm.rs +++ b/kernel/src/syscall/mm.rs @@ -1,10 +1,10 @@ use core::ops::Add; +use devices::PAGE_SIZE; use frame_allocator::ceil_div; use log::debug; use polyhal::addr::{VirtAddr, VirtPage}; -use polyhal::PAGE_SIZE; -use polyhal::USER_VADDR_END; +use polyhal::pagetable::USER_VADDR_END; use crate::syscall::consts::from_vfs; use crate::syscall::consts::MSyncFlags; diff --git a/kernel/src/syscall/shm.rs b/kernel/src/syscall/shm.rs index 8fee6e9..01f1d60 100644 --- a/kernel/src/syscall/shm.rs +++ b/kernel/src/syscall/shm.rs @@ -2,10 +2,10 @@ use core::ops::Add; use crate::tasks::{MapedSharedMemory, SharedMemory, SHARED_MEMORY}; use alloc::{sync::Arc, vec::Vec}; +use devices::PAGE_SIZE; use frame_allocator::{ceil_div, frame_alloc_much, FrameTracker}; use log::debug; -use polyhal::addr::{VirtAddr, VirtPage}; -use polyhal::{pagetable::MappingFlags, PAGE_SIZE}; +use polyhal::{addr::{VirtAddr, VirtPage}, MappingFlags}; use crate::user::UserTaskContainer; diff --git a/kernel/src/syscall/sys.rs b/kernel/src/syscall/sys.rs index 3cc834d..1ed8411 100644 --- a/kernel/src/syscall/sys.rs +++ b/kernel/src/syscall/sys.rs @@ -150,7 +150,7 @@ impl UserTaskContainer { pub async fn sys_arch_prctl(&self, code: usize, addr: usize) -> SysResult { use crate::syscall::consts::{ArchPrctlCode, LinuxError}; use num_traits::FromPrimitive; - use polyhal::TrapFrameArgs; + use polyhal::trapframe::TrapFrameArgs; let arch_prctl_code = FromPrimitive::from_usize(code).ok_or(LinuxError::EINVAL)?; debug!( diff --git a/kernel/src/syscall/task.rs b/kernel/src/syscall/task.rs index 18d14d4..df9273c 100644 --- a/kernel/src/syscall/task.rs +++ b/kernel/src/syscall/task.rs @@ -17,6 +17,8 @@ use alloc::{ {boxed::Box, sync::Arc}, }; use async_recursion::async_recursion; +use devices::PAGE_SIZE; +use polyhal::{trapframe::TrapFrameArgs, MappingFlags, Time, VirtPage}; use core::cmp; use executor::{select, thread, tid2task, yield_now, AsyncTask}; use frame_allocator::{ceil_div, frame_alloc_much, FrameTracker}; @@ -25,7 +27,6 @@ use fs::TimeSpec; use hal::{current_nsec, TimeVal}; use log::{debug, warn}; use num_traits::FromPrimitive; -use polyhal::{addr::VirtPage, pagetable::MappingFlags, time::Time, TrapFrameArgs, PAGE_SIZE}; use signal::SignalFlags; use sync::Mutex; use vfscore::OpenFlags; diff --git a/kernel/src/tasks/elf.rs b/kernel/src/tasks/elf.rs index 2f14f68..4e04f47 100644 --- a/kernel/src/tasks/elf.rs +++ b/kernel/src/tasks/elf.rs @@ -1,8 +1,8 @@ use alloc::{collections::BTreeMap, string::String, sync::Arc, vec::Vec}; +use devices::PAGE_SIZE; use executor::AsyncTask; use log::warn; -use polyhal::addr::VirtPage; -use polyhal::{TrapFrame, TrapFrameArgs, PAGE_SIZE}; +use polyhal::{addr::VirtPage, trapframe::{TrapFrame, TrapFrameArgs}}; use xmas_elf::{ program::Type, sections::SectionData, diff --git a/kernel/src/tasks/initproc.rs b/kernel/src/tasks/initproc.rs index fb44350..3a740c0 100644 --- a/kernel/src/tasks/initproc.rs +++ b/kernel/src/tasks/initproc.rs @@ -12,7 +12,7 @@ use fs::{ }; use log::debug; use logging::get_char; -use polyhal::{debug::DebugConsole, hart_id, shutdown}; +use polyhal::{debug_console::DebugConsole, instruction::Instruction}; use vfscore::INodeInterface; use crate::tasks::add_user_task; @@ -407,6 +407,6 @@ pub async fn initproc() { }) .is_none() { - shutdown(); + Instruction::shutdown(); } } diff --git a/kernel/src/tasks/memset.rs b/kernel/src/tasks/memset.rs index 013226d..3690653 100644 --- a/kernel/src/tasks/memset.rs +++ b/kernel/src/tasks/memset.rs @@ -1,4 +1,5 @@ use alloc::{sync::Arc, vec::Vec}; +use devices::PAGE_SIZE; use core::{ cmp::min, fmt::Debug, @@ -6,8 +7,7 @@ use core::{ }; use frame_allocator::FrameTracker; use fs::File; -use polyhal::addr::VirtPage; -use polyhal::{pagetable::PageTable, PAGE_SIZE}; +use polyhal::{addr::VirtPage, PageTable}; /// Memory set for storing the memory and its map relation. #[derive(Debug)] diff --git a/kernel/src/tasks/mod.rs b/kernel/src/tasks/mod.rs index 2614d1d..814d08a 100644 --- a/kernel/src/tasks/mod.rs +++ b/kernel/src/tasks/mod.rs @@ -4,7 +4,7 @@ use alloc::{sync::Arc, vec::Vec}; use devices::get_net_device; use executor::{current_task, thread, yield_now, AsyncTask, TaskId, DEFAULT_EXECUTOR}; use hal::{ITimerVal, TimeVal}; -use polyhal::get_cpu_num; +use polyhal::common::get_cpu_num; use crate::syscall::{exec_with_process, NET_SERVER}; use crate::user::entry::user_entry; diff --git a/kernel/src/tasks/task.rs b/kernel/src/tasks/task.rs index ae5b5eb..44ee300 100644 --- a/kernel/src/tasks/task.rs +++ b/kernel/src/tasks/task.rs @@ -5,15 +5,12 @@ use alloc::{ sync::{Arc, Weak}, vec::Vec, }; +use devices::PAGE_SIZE; use executor::{release_task, task::TaskType, task_id_alloc, AsyncTask, TaskId}; use frame_allocator::{ceil_div, frame_alloc_much}; use fs::File; use log::debug; -use polyhal::{ - addr::{PhysPage, VirtAddr, VirtPage}, - pagetable::{MappingFlags, MappingSize, PageTableWrapper}, - {TrapFrame, TrapFrameArgs, PAGE_SIZE}, -}; +use polyhal::{addr::{PhysPage, VirtAddr, VirtPage}, trapframe::{TrapFrame, TrapFrameArgs}, MappingFlags, MappingSize, PageTableWrapper}; use signal::{SigAction, SigProcMask, SignalFlags, REAL_TIME_SIGNAL_NUM}; use sync::{Mutex, MutexGuard, RwLock}; use vfscore::OpenFlags; diff --git a/kernel/src/user/entry.rs b/kernel/src/user/entry.rs index 966d21b..29c1c22 100644 --- a/kernel/src/user/entry.rs +++ b/kernel/src/user/entry.rs @@ -4,7 +4,7 @@ use executor::{yield_now, AsyncTask}; use futures_lite::future; use hal::TimeVal; use log::debug; -use polyhal::{kernel_page_table, TrapFrame}; +use polyhal::{boot::boot_page_table, trapframe::TrapFrame}; use signal::SignalFlags; use crate::tasks::{current_user_task, UserTaskControlFlow}; @@ -114,7 +114,7 @@ impl UserTaskContainer { } debug!("exit_task: {}", self.task.get_task_id()); - kernel_page_table().change(); + boot_page_table().change(); } } diff --git a/kernel/src/user/mod.rs b/kernel/src/user/mod.rs index e7c6e04..acfd02a 100644 --- a/kernel/src/user/mod.rs +++ b/kernel/src/user/mod.rs @@ -1,10 +1,12 @@ +use polyhal::trap::{run_user_task, EscapeReason}; +use polyhal::trapframe::{TrapFrame, TrapFrameArgs}; +use polyhal::{MappingFlags, Time}; use ::signal::SignalFlags; use alloc::sync::Arc; use executor::{AsyncTask, TaskId}; use frame_allocator::frame_alloc; use log::{debug, warn}; use polyhal::addr::VirtPage; -use polyhal::{pagetable::MappingFlags, run_user_task, time::Time, TrapFrame, TrapFrameArgs}; use crate::tasks::{MapTrack, MemType, UserTask}; use crate::{ @@ -71,6 +73,7 @@ pub fn user_cow_int(task: Arc, cx_ref: &mut TrapFrame, addr: usize) { ppn } }; + drop(pcb); task.map(ppn, vpn, MappingFlags::URWX); } else { @@ -82,7 +85,7 @@ impl UserTaskContainer { /// Handle user interrupt. pub async fn handle_syscall(&self, cx_ref: &mut TrapFrame) -> UserTaskControlFlow { let ustart = Time::now().raw(); - if let Some(()) = run_user_task(cx_ref) { + if matches!(run_user_task(cx_ref), EscapeReason::SysCall) { self.task .inner_map(|inner| inner.tms.utime += (Time::now().raw() - ustart) as u64); diff --git a/kernel/src/user/signal.rs b/kernel/src/user/signal.rs index 00ff253..d340494 100644 --- a/kernel/src/user/signal.rs +++ b/kernel/src/user/signal.rs @@ -2,7 +2,7 @@ use core::mem::size_of; use executor::AsyncTask; use log::debug; -use polyhal::{TrapFrameArgs, SIG_RETURN_ADDR}; +use polyhal::trapframe::TrapFrameArgs; use signal::SignalFlags; use crate::syscall::consts::{SignalUserContext, UserRef}; @@ -68,7 +68,9 @@ impl UserTaskContainer { tcb.cx[TrapFrameArgs::SP] = sp; tcb.cx[TrapFrameArgs::SEPC] = sigaction.handler; tcb.cx[TrapFrameArgs::RA] = if sigaction.restorer == 0 { - SIG_RETURN_ADDR + // SIG_RETURN_ADDR + // TODO: add sigreturn addr. + 0 } else { sigaction.restorer }; diff --git a/tools/iso/boot/grub/grub.cfg b/tools/iso/boot/grub/grub.cfg new file mode 100644 index 0000000..5724d92 --- /dev/null +++ b/tools/iso/boot/grub/grub.cfg @@ -0,0 +1,13 @@ +set timeout=2 +set default=0 # Set the default menu entry + +menuentry "OS Name" { + insmod all_video + # set gfxmode=text + # set gfxpayload=text + # terminal_output console + # The multiboot command replaces the kernel command + # For multiboot v2, use the multiboot2 command + multiboot /example + boot +}