-
Notifications
You must be signed in to change notification settings - Fork 1
Development #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development #128
Conversation
Caution Review failedThe pull request is closed. WalkthroughIntroduces a basic Ethernet networking stack: a generic NIC registry and poller, IPv4/ARP/ICMP layers, and RX paths in E1000/RTL8139. Integrates stack initialization into kernel boot (replacing per-driver init) and polls NICs from the timer IRQ. Adds a shell “ping” command. Updates docs and string utilities. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Shell
participant ICMP as Icmp.c
participant IP as Ip.c
participant ARP as Arp.c
participant NIC as Network.c/Device
Note over Shell,NIC: Outbound ping flow
User->>Shell: ping 10.0.2.2
Shell->>ICMP: IcmpSendEchoRequest(dest_ip)
ICMP->>IP: IpSend(dest_ip, ICMP, icmp_payload)
IP->>ARP: ArpResolve(dest_ip, out_mac)
alt MAC known
IP->>NIC: send_packet(ETH[IPv4+ICMP])
else MAC unknown
ARP->>NIC: send_packet(ETH[ARP Request])
Note right of ARP: Caller drops packet
end
sequenceDiagram
autonumber
participant IRQ as Timer IRQ (case 32)
participant Net as Net_Poll
participant E1000 as E1000_HandleReceive
participant RTL as Rtl8139_HandleReceive
participant IP as IpHandlePacket
participant ARP as ArpHandlePacket
Note over IRQ,RTL: Inbound polling path
IRQ->>Net: Poll all devices
Net->>E1000: poll_receive()
E1000->>IP: IPv4 frames
E1000->>ARP: ARP frames
Net->>RTL: poll_receive()
RTL->>IP: IPv4 frames
RTL->>ARP: ARP frames
sequenceDiagram
autonumber
participant NIC as NIC RX
participant IP as Ip.c
participant ICMP as Icmp.c
participant NIC2 as NIC TX
Note over NIC,ICMP: ICMP echo reply
NIC->>IP: IPv4 packet (protocol=ICMP)
IP->>ICMP: IcmpHandlePacket(ip_hdr, icmp_hdr)
alt Echo Request
ICMP->>NIC2: send_packet(ETH[IPv4+ICMP Echo Reply])
else Echo Reply
ICMP-->>IP: log reception
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (20)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Refactor
Documentation
Chores