Skip to content

Commit aa4e13d

Browse files
committed
fix: rename arch to polyhal
1 parent f63a417 commit aa4e13d

File tree

21 files changed

+77
-85
lines changed

21 files changed

+77
-85
lines changed

Cargo.lock

Lines changed: 43 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

byteos.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ MOUNT_IMG_PATH = "mount.img"
1111
target = "riscv64gc-unknown-none-elf"
1212
[bin.riscv64-qemu.configs]
1313
driver = "kvirtio,kgoldfish-rtc,ns16550a"
14+
root_fs = "ext4"
1415

1516
# build for x86_64-qemu
1617
[bin.x86_64-qemu]
1718
target = "x86_64-unknown-none"
1819
[bin.x86_64-qemu.configs]
1920
driver = "kvirtio,kgoldfish-rtc,ns16550a"
20-
root_fs = "ext4"
2121

2222
# build for aarch64-qemu
2323
[bin.aarch64-qemu]

kernel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ logging = { git = "https://github.com/Byte-OS/logging.git", features = []}
1919
log = "0.4"
2020
devices = { git = "https://github.com/Byte-OS/devices.git" }
2121
hal = { git = "https://github.com/Byte-OS/hal.git" }
22-
arch = { git = "https://github.com/Byte-OS/arch.git" }
22+
polyhal = { git = "https://github.com/Byte-OS/polyhal.git" }
2323
fs = { git = "https://github.com/Byte-OS/fs.git" }
2424
fdt = "0.1.5"
2525
executor = { git = "https://github.com/Byte-OS/executor.git" }

kernel/src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ mod syscall;
2929
mod tasks;
3030
mod user;
3131

32-
use arch::addr::{PhysPage, VirtPage};
33-
use arch::multicore::MultiCore;
34-
use arch::{
32+
use polyhal::addr::{PhysPage, VirtPage};
33+
use polyhal::multicore::MultiCore;
34+
use polyhal::{
3535
disable_irq, enable_irq, get_mem_areas, PageAlloc, TrapFrame, TrapFrameArgs, TrapType,
3636
VIRT_ADDR_START,
3737
};
@@ -61,7 +61,7 @@ impl PageAlloc for PageAllocImpl {
6161
}
6262
}
6363

64-
#[arch::arch_interrupt]
64+
#[polyhal::arch_interrupt]
6565
/// Handle kernel interrupt
6666
fn kernel_interrupt(cx_ref: &mut TrapFrame, trap_type: TrapType) {
6767
match trap_type {
@@ -135,7 +135,7 @@ fn kernel_interrupt(cx_ref: &mut TrapFrame, trap_type: TrapType) {
135135
}
136136

137137
/// The kernel entry
138-
#[arch::arch_entry]
138+
#[polyhal::arch_entry]
139139
fn main(hart_id: usize) {
140140
disable_irq();
141141
if hart_id == 0 {
@@ -152,7 +152,7 @@ fn main(hart_id: usize) {
152152
// initialize logging module
153153
logging::init(option_env!("LOG"));
154154

155-
arch::init(&PageAllocImpl);
155+
polyhal::init(&PageAllocImpl);
156156
get_mem_areas().into_iter().for_each(|(start, size)| {
157157
frame_allocator::add_frame_map(start, start + size);
158158
});
@@ -166,7 +166,7 @@ fn main(hart_id: usize) {
166166

167167
devices::prepare_drivers();
168168

169-
if let Some(fdt) = arch::get_fdt() {
169+
if let Some(fdt) = polyhal::get_fdt() {
170170
for node in fdt.all_nodes() {
171171
devices::try_to_add_device(&node);
172172
}

kernel/src/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use arch::{hart_id, shutdown};
1+
use polyhal::{hart_id, shutdown};
22
// use backtrace::backtrace;
33
use core::panic::PanicInfo;
44

kernel/src/socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use core::{cmp, net::SocketAddrV4};
22

33
use alloc::{sync::Arc, vec::Vec};
4-
use arch::debug::DebugConsole;
4+
use polyhal::debug::DebugConsole;
55
use fs::INodeInterface;
66
use lose_net_stack::net_trait::SocketInterface;
77
use sync::Mutex;

kernel/src/syscall/consts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
use core::fmt::{Debug, Display};
55
use core::marker::PhantomData;
66

7-
use arch::addr::VirtAddr;
8-
use arch::pagetable::MappingFlags;
9-
use arch::TrapFrame;
7+
use polyhal::addr::VirtAddr;
8+
use polyhal::pagetable::MappingFlags;
9+
use polyhal::TrapFrame;
1010
use bitflags::bitflags;
1111
use cfg_if::cfg_if;
1212
use fs::VfsError;

kernel/src/syscall/fd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use num_traits::FromPrimitive;
55
use vfscore::FileType;
66

77
use alloc::sync::Arc;
8-
use arch::addr::VirtAddr;
8+
use polyhal::addr::VirtAddr;
99
use bit_field::BitArray;
1010
use executor::yield_now;
1111
use fs::pipe::create_pipe;

kernel/src/syscall/mm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use core::ops::Add;
22

3-
use arch::addr::{VirtAddr, VirtPage};
4-
use arch::PAGE_SIZE;
5-
use arch::USER_VADDR_END;
3+
use polyhal::addr::{VirtAddr, VirtPage};
4+
use polyhal::PAGE_SIZE;
5+
use polyhal::USER_VADDR_END;
66
use frame_allocator::ceil_div;
77
use log::debug;
88

kernel/src/syscall/shm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use core::ops::Add;
22

33
use crate::tasks::{MapedSharedMemory, SharedMemory, SHARED_MEMORY};
44
use alloc::{sync::Arc, vec::Vec};
5-
use arch::addr::{VirtAddr, VirtPage};
6-
use arch::{pagetable::MappingFlags, PAGE_SIZE};
5+
use polyhal::addr::{VirtAddr, VirtPage};
6+
use polyhal::{pagetable::MappingFlags, PAGE_SIZE};
77
use frame_allocator::{ceil_div, frame_alloc_much, FrameTracker};
88
use log::debug;
99

0 commit comments

Comments
 (0)