mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-28 04:43:23 +00:00
增加对dhcpv4的支持(tcp、udp socket已写好,但由于缺少epoll机制,尚未完整测试) (#237)
* 为virtio网卡完成smoltcp的phy层配置 * raw socket * 初步写完udp和tcp socket * 能够正常通过dhcp获取ipv4地址(具有全局iface btree) --------- Co-authored-by: guanjinquan <1666320330@qq.com>
This commit is contained in:
@ -6,4 +6,5 @@ pub mod fpu;
|
||||
pub mod interrupt;
|
||||
pub mod mm;
|
||||
pub mod pci;
|
||||
pub mod rand;
|
||||
pub mod sched;
|
||||
|
5
kernel/src/arch/x86_64/rand.rs
Normal file
5
kernel/src/arch/x86_64/rand.rs
Normal file
@ -0,0 +1,5 @@
|
||||
use core::arch::x86_64::_rdtsc;
|
||||
|
||||
pub fn rand() -> usize {
|
||||
return unsafe { (_rdtsc() * _rdtsc() + 998244353_u64 * _rdtsc()) as usize };
|
||||
}
|
Reference in New Issue
Block a user