Implement DHCP client subsystem and dhcp app (AI)
- Created src/dhcp.h: DHCP packet struct, lease info struct, message types, options codes, client states, discover/receive/get_lease API - Created src/dhcp.c: DHCP client with DISCOVER/OFFER/REQUEST/ACK flow, manual IP+UDP header construction for broadcast, option parsing for subnet mask/router/DNS/lease time/server ID, lease table, auto-applies configuration to ethernet interface on ACK, sysfs /sys/dhcp/status - Created apps/dhcp/dhcp.c: reads /sys/dhcp/status to display DHCP info - Kernel calls dhcp_init() at boot - Tested: clean boot, DHCP initialized, dhcp app in CPIO
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "ethernet.h"
|
||||
#include "ipv4.h"
|
||||
#include "arp.h"
|
||||
#include "dhcp.h"
|
||||
#include "framebuffer.h"
|
||||
|
||||
/* Global framebuffer info, parsed from multiboot2 tags. */
|
||||
@@ -427,6 +428,9 @@ void kernel_main(uint32_t magic, uint32_t addr) {
|
||||
arp_init();
|
||||
offset_print("ARP subsystem initialized\n");
|
||||
|
||||
dhcp_init();
|
||||
offset_print("DHCP subsystem initialized\n");
|
||||
|
||||
init_drivers();
|
||||
EARLY_PRINT("DRV ");
|
||||
offset_print("Drivers initialized\n");
|
||||
|
||||
Reference in New Issue
Block a user