warning: `/home/winddevil/.cargo/config` is deprecated in favor of `config.toml` note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml` warning: `/home/winddevil/.cargo/config` is deprecated in favor of `config.toml` note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml` warning: `/home/winddevil/.cargo/config` is deprecated in favor of `config.toml` note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml` warning: `/home/winddevil/.cargo/config` is deprecated in favor of `config.toml` note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml` Compiling log v0.4.21 Compiling cfg-if v1.0.0 Compiling tock-registers v0.8.1 Compiling bitflags v2.6.0 Compiling axerrno v0.1.0 Compiling byteorder v1.4.3 Compiling const-default v1.0.0 Compiling memory_addr v0.3.1 Compiling bit_field v0.10.2 Compiling percpu v0.1.3 Compiling lock_api v0.4.10 Compiling lazyinit v0.2.1 Compiling axconfig v0.1.0 (/home/winddevil/workspace/arceos/modules/axconfig) Compiling int_ratio v0.1.0 Compiling static_assertions v1.1.0 Compiling linkme v0.3.27 Compiling scopeguard v1.2.0 Compiling handler_table v0.1.1 Compiling kernel_guard v0.1.1 Compiling axdriver_base v0.1.0 (https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e) Compiling aarch64-cpu v9.4.0 Compiling rlsf v0.2.1 Compiling dw_apb_uart v0.1.0 Compiling arm_gicv2 v0.1.0 Compiling arm_pl011 v0.1.0 Compiling bitmap-allocator v0.1.0 Compiling heapless v0.7.16 Compiling kspin v0.1.0 Compiling zerocopy v0.7.35 Compiling hash32 v0.2.1 Compiling stable_deref_trait v1.2.0 Compiling smoltcp v0.10.0 (https://github.com/rcore-os/smoltcp.git?rev=2ade274#2ade2747) Compiling axdriver v0.1.0 (/home/winddevil/workspace/arceos/modules/axdriver) Compiling num-traits v0.2.16 Compiling managed v0.8.0 Compiling axlog v0.1.0 (/home/winddevil/workspace/arceos/modules/axlog) Compiling bitflags v1.3.2 Compiling axio v0.1.0 Compiling spin v0.9.8 Compiling allocator v0.1.0 (https://github.com/arceos-org/allocator.git?tag=v0.1.0#16496d88) Compiling axdriver_net v0.1.0 (https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e) Compiling axalloc v0.1.0 (/home/winddevil/workspace/arceos/modules/axalloc) Compiling virtio-drivers v0.7.4 Compiling axhal v0.1.0 (/home/winddevil/workspace/arceos/modules/axhal) Compiling chrono v0.4.38 Compiling page_table_entry v0.4.0 Compiling axdriver_virtio v0.1.0 (https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e) Compiling axdriver_pci v0.1.0 (https://github.com/arceos-org/axdriver_crates.git?tag=v0.1.0#78686a7e) Compiling page_table_multiarch v0.4.0 error[E0425]: cannot find function `init_boot_page_table` in module `crate::platform::mem` --> modules/axhal/src/platform/aarch64_common/boot.rs:100:27 | 100 | crate::platform::mem::init_boot_page_table(addr_of_mut!(BOOT_PT_L0), addr_of_mut!(BOOT_PT_L1)); | ^^^^^^^^^^^^^^^^^^^^ not found in `crate::platform::mem`
error[E0425]: cannot find value `rust_entry` in module `crate::platform` --> modules/axhal/src/platform/aarch64_common/boot.rs:139:38 | 139 | entry = sym crate::platform::rust_entry, | ^^^^^^^^^^ not found in `crate::platform`
error[E0425]: cannot find value `rust_entry_secondary` in module `crate::platform` --> modules/axhal/src/platform/aarch64_common/boot.rs:170:38 | 170 | entry = sym crate::platform::rust_entry_secondary, | ^^^^^^^^^^^^^^^^^^^^ not found in `crate::platform`
error[E0425]: cannot find value `PSCI_METHOD` in crate `axconfig` --> modules/axhal/src/platform/aarch64_common/psci.rs:82:31 | 82 | let ret = match axconfig::PSCI_METHOD { | ^^^^^^^^^^^ not found in `axconfig`
error[E0425]: cannot find value `PSCI_METHOD` in crate `axconfig` --> modules/axhal/src/platform/aarch64_common/psci.rs:85:58 | 85 | _ => panic!("Unknown PSCI method: {}", axconfig::PSCI_METHOD), | ^^^^^^^^^^^ not found in `axconfig`
error[E0425]: cannot find value `UART_PADDR` in crate `axconfig` --> modules/axhal/src/platform/aarch64_common/pl011.rs:9:43 | 9 | const UART_BASE: PhysAddr = pa!(axconfig::UART_PADDR); | ^^^^^^^^^^ not found in `axconfig`
For more information about this error, try `rustc --explain E0425`. error: could not compile `axhal` (lib) due to 6 previous errors warning: build failed, waiting for other jobs to finish...
/// Prints to the standard output, with a newline. #[macro_export] macro_rules! println { () => { $crate::print!("\n") }; ($($arg:tt)*) => { $crate::io::__print_impl(format_args!("\x1b[31m{}\n\x1b[0m", format_args!($($arg)*))); } }
/// Write a slice of bytes to the console. pubfnwrite_bytes(bytes: &[u8]) { let color_begin = "\x1b[31m"; let color_end = "\x1b[0m"; for c in color_begin.bytes() { putchar(c); } for c in bytes { putchar(*c); } for c in color_end.bytes() { putchar(c); } } } ... ...
随后worker2获取到双端队列之后,尝试输出队列最前边的内容.全部输出完之后,进入另一个分支输出worker2: nothing to do!,并且yield.但是由于vruntime仍然是worker2最小,因此又运行了两次,一共运行三次以后才切换回worker1.(这说明cfs调度算法的yield是考虑切换,而不是直接把当前任务放进队列最后)
#[macro_use] #[cfg(feature = "axstd")] externcrate axstd as std;
use core::{mem, str}; use std::os::arceos::modules::axhal::mem::phys_to_virt;
/// Physical address for pflash#1 const PFLASH_START: usize = 0x2200_0000;
#[cfg_attr(feature = "axstd", no_mangle)] fnmain() { // Makesure that we can access pflash region. let va = phys_to_virt(PFLASH_START.into()).as_usize(); let ptr = va as *constu32; unsafe { println!("Try to access dev region [{:#X}], got {:#X}", va, *ptr); let magic = mem::transmute::<u32, [u8; 4]>(*ptr); println!("Got pflash magic: {}", str::from_utf8(&magic).unwrap()); } }
#[macro_use] #[cfg(feature = "axstd")] externcrate axstd as std;
use core::{mem, str}; use std::thread; use std::os::arceos::modules::axhal::mem::phys_to_virt;
/// Physical address for pflash#1 const PFLASH_START: usize = 0x2200_0000;
#[cfg_attr(feature = "axstd", no_mangle)] fnmain() { println!("Multi-task is starting ...");
let worker = thread::spawn(move || { println!("Spawned-thread ...");
// Makesure that we can access pflash region. let va = phys_to_virt(PFLASH_START.into()).as_usize(); let ptr = va as *constu32; let magic = unsafe { mem::transmute::<u32, [u8; 4]>(*ptr) }; ifletOk(s) = str::from_utf8(&magic) { println!("Got pflash magic: {s}"); 0 } else { -1 } });
let ret = worker.join(); // Makesure that worker has finished its work. assert_eq!(ret, Ok(0));
[ 21.794824 0 fatfs::dir:139] Is a directory [ 22.065035 0 fatfs::dir:139] Is a directory [ 22.359963 0 fatfs::dir:139] Is a directory [ 22.490439 0 fatfs::dir:139] Is a directory app: /sbin/origin paddr: PA:0x80642000 Mapping user stack: VA:0x3fffff0000 -> VA:0x4000000000 New user address space: AddrSpace { va_range: VA:0x0..VA:0x4000000000, page_table_root: PA:0x80641000, } Enter user space: entry=0x1000, ustack=0x4000000000, kstack=VA:0xffffffc080697010 handle_syscall ... [SYS_EXIT]: process is exiting .. monolithic kernel exit [Some(0)] normally!
if populate { // allocate all possible physical frames for populated mapping. for addr in PageIter4K::new(start, start + size).unwrap() { ifletSome(frame) = alloc_frame(true) { ifletOk(tlb) = pt.map(addr, frame, PageSize::Size4K, flags) { tlb.ignore(); // TLB flush on map is unnecessary, as there are no outdated mappings. } else { returnfalse; } } } true } else { // Map to a empty entry for on-demand mapping. let flags = MappingFlags::empty(); pt.map_region(start, |_| 0.into(), size, flags, false, false) .map(|tlb| tlb.ignore()) .is_ok() }