Add a driver for NE2000-compatible ISA Ethernet cards based on the DP8390 controller. Features: - PROM-based MAC address detection and validation - Programmed I/O (PIO) remote DMA for data transfers - Ring buffer management for RX with wrap-around handling - IRQ 9-driven packet reception and transmission - Synchronous TX with timeout - Character device registration as 'eth' class (/dev/ethN) Probe verifies card presence by resetting the controller, configuring it for PROM reading, and checking the MAC is not all-0xFF/all-0x00 (which would indicate no hardware at the I/O base). NE2000 memory layout (16 KiB on-card RAM): - Pages 0x40-0x45: TX buffer (1536 bytes, 1 MTU frame) - Pages 0x46-0x7F: RX ring buffer (~14.5 KiB) Tested with QEMU: `-device ne2k_isa,iobase=0x300,irq=9` correctly detects the card and registers /dev/eth1. Without the NIC option, probe correctly reports 'not found'.
42 lines
655 B
CMake
42 lines
655 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
|
|
add_executable(kernel
|
|
boot.S
|
|
gdt_flush.S
|
|
gdt.c
|
|
idt.c
|
|
isr.c
|
|
pic.c
|
|
pmm.c
|
|
paging.c
|
|
kmalloc.c
|
|
string.c
|
|
driver.c
|
|
vga.c
|
|
tss.c
|
|
process.c
|
|
syscall.c
|
|
cpio.c
|
|
vfs.c
|
|
initrd_fs.c
|
|
devicefs.c
|
|
sysfs.c
|
|
ide.c
|
|
mbr.c
|
|
fat32.c
|
|
floppy.c
|
|
ne2000.c
|
|
env.c
|
|
keyboard.c
|
|
interrupts.S
|
|
kernel.c
|
|
)
|
|
|
|
# Use our custom linker script
|
|
target_link_options(kernel PRIVATE -T ${CMAKE_CURRENT_SOURCE_DIR}/linker.ld)
|
|
|
|
target_include_directories(kernel PRIVATE
|
|
${CMAKE_SOURCE_DIR}/vendor
|
|
${CMAKE_SOURCE_DIR}/include # If created later
|
|
)
|