4
1
mirror of https://github.com/DragonOS-Community/DragonOS.git synced 2025-07-11 11:13:24 +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:
login
2023-04-10 20:22:39 +08:00
committed by GitHub
parent 78bf93f02f
commit 13776c114b
26 changed files with 1723 additions and 105 deletions

@ -5,7 +5,7 @@
#![feature(alloc_error_handler)]
#![feature(panic_info_message)]
#![feature(drain_filter)] // 允许Vec的drain_filter特性
#![feature(c_void_variant)] // used in kernel/src/exception/softirq.rs
#![feature(c_void_variant)]
#[allow(non_upper_case_globals)]
#[allow(non_camel_case_types)]
#[allow(non_snake_case)]
@ -52,6 +52,7 @@ use mm::allocator::KernelAllocator;
use crate::{
arch::asm::current::current_pcb,
include::bindings::bindings::{process_do_exit, BLACK, GREEN},
net::net_core::net_init,
};
// 声明全局的slab分配器
@ -98,5 +99,6 @@ pub fn panic(info: &PanicInfo) -> ! {
#[no_mangle]
pub extern "C" fn __rust_demo_func() -> i32 {
printk_color!(GREEN, BLACK, "__rust_demo_func()\n");
net_init().expect("Failed to init network");
return 0;
}